Annotations on 2D canvaces. Show a LaTeX equation
Code: "symbols_latex.py". Programming language: Python
DMelt Version 1. Last modified: 05/09/2015. License: Pro
https://datamelt.org/code/cache/symbols_latex_8472.py
To run this script using the DMelt IDE,
copy the above URL link to the menu [File]→[Read script from URL] of the DMelt IDE.
from jhplot import *
from java.awt import *
from java.util import Random
c1 = HPlot("Canvas",600,400,1, 1)
c1.visible(1)
c1.setAutoRange()
c1.setMarginLeft(70)
h1 = H1D("Simple1",30, -2, 2.0)
rand = Random()
for i in range(1000):
h1.fill(rand.nextGaussian())
c1.draw(h1)
c1.setAutoRange()
h1.setPenWidthErr(2)
c1.setNameX("X_{sub}")
c1.setNameY("Y^{sup}")
c1.setName("Canvas title for F_{2}")
# set HLabel in the normilised coordinate system
lab=HLabel("HLabel F_{2}", 0.8, 0.7, "NDC")
lab.setColor(Color.blue)
c1.add(lab)
# show latex equation
lab=HLabelEq("\int_{i=1}^{100}\omega_{i}(x)dx+\sum_{i=0}^{200}\sqrt{i^2}", 0.15, 0.8, "NDC")
lab.setFontSize(16)
lab.setColor(Color.blue);
c1.add(lab)
c1.update()
You see the box below because you did not login.