Annotation. Symbols and characters of type I for HPlot canvases
Source code name: "symbols1.py"
Programming language: Python
Topic: Graphics/Annotation
DMelt Version 1. Last modified: 07/23/2017. License: Pro
https://datamelt.org/code/cache/symbols1_6700.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 java.awt import Font,Color
from jhplot  import  *

c1 = HPlot("Canvas",600,700)
c1.visible()
c1.setGridAll(0,0)
c1.setGridAll(1,0)
c1.setGTitle("jHPlot symbols I")
c1.removeAxes()
c1.setRange(0,100,0,100)
c1.setName("Add \'&\' in front and terminate by \';\'")

from jhplot import *
http='http://datamelt.org/examples/data/'
file='characters.txt'
print Web.get(http+file)
d=[]
# read file
f=open(file, 'r')
data=f.readlines()
f.close()

font=Font("Lucida Sans", Font.BOLD, 14)

d.append(['subs','d_{3}']);
d.append(['super','d^{3}']);
d.append(['','#bar{d} #bar{s},#bar{a}']);

# run over all supported characters
for i in range(len(data)):
      s=data[i]
      kk=s.find(',');
      if (kk>1):
              a1=s[1:kk-1]
              ss='&'+a1+';';
              d.append([a1,ss]);
              print "character=",ss
              

max=20
if (max>len(d)): max=len(d)
i=1
for j in range(max):
      a=d[j]
      t=a[1]+" "+a[0]
      y=100-10*i
      hh = HLabel(t,0,y)
      hh.setFont(font)
      c1.add(hh)
      i=i+1
   
max1=2*max
if (max1>len(d)): max1=len(d)
i=1
for j in range(max,max1):
      a=d[j]
      t=a[1]+" "+a[0]
      y=100-10*i
      hh = HLabel(t,20,y)
      hh.setFont(font)
      c1.add(hh)
      i=i+1

max1=3*max
if (max1>len(d)): max1=len(d)
i=1
for j in range(2*max,max1):
      a=d[j]
      t=a[1]+" "+a[0]
      y=100-10*i
      hh = HLabel(t,40,y)
      hh.setFont(font)
      c1.add(hh)
      i=i+1

max1=4*max
if (max1>len(d)): max1=len(d)
i=1
for j in range(3*max,max1):
      a=d[j]
      t=a[1]+" "+a[0]
      y=100-10*i
      hh = HLabel(t,60,y)
      hh.setFont(font)
      c1.add(hh)
      i=i+1

max1=5*max
if (max1>len(d)): max1=len(d)
i=1
for j in range(4*max,max1):
      a=d[j]
      t=a[1]+" "+a[0]
      y=100-10*i
      hh = HLabel(t,80,y)
      hh.setFont(font)
      c1.add(hh)
      i=i+1

max1=6*max
if (max1>len(d)): max1=len(d)
i=1
for j in range(5*max,max1):
      a=d[j]
      t=a[1]+" "+a[0]
      y=100-10*i
      hh = HLabel(t,100,y)
      hh.setFont(font)
      c1.add(hh)
      i=i+1

max1=7*max
if (max1>len(d)): max1=len(d)
i=1
for j in range(6*max,max1):
      a=d[j]
      t=a[1]+" "+a[0]
      y=100-10*i
      hh = HLabel(t,120,y)
      hh.setFont(font)
      c1.add(hh)
      i=i+1

c1.update()


You see the box below because you did not login.