HKey key shown on HPlot
Source code name: "canvas2D_hkey.py"
Programming language: Python
Topic: Plots/2D
DMelt Version 1. Last modified: 05/09/2015. License: Pro
https://datamelt.org/code/cache/canvas2D_hkey_3822.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  HPlot,HKey

c1 = HPlot("Canvas",600,500)
c1.visible()
c1.setGridAll(0,0)
c1.setGridAll(1,0)
c1.setGTitle("HKey types")
c1.removeAxes()
c1.setRange(0,100,0,100)

for j in range(0,13):
     title = "key type="+str(j)
     hh = HKey(title,15,97-7*(j+1))
     c= Color(30+j*10,65 + j*10,10*j)
     hh.setKey(j,2.0,c)
     hh.setKeySpace(4.0)
     c1.add(hh)

h = HKey("key type=20",55,90)
h.setKey(20,7.0,Color.blue)
h.setKeySpace(4.0)
c1.add(h)


h1 =HKey("key type=21",55,83)
h1.setKey(21,7.0,Color.blue)
h1.setKeySpace(4.0)
c1.add(h1)
    
h1 =HKey("key type=30",55,76)
h1.setKey(30,7.0,Color.blue)
h1.setKeySpace(4.0)
c1.add(h1)
    

h1 =HKey("key type=31",55,69)
h1.setKey(31,7.0,Color.green)
h1.setKeySpace(4.0)
c1.add(h1)

h1 =HKey("key type=32",55,62)
h1.setKey(32,7.0,Color.red)
h1.setKeySpace(4.0)
c1.add(h1)







c1.update()


You see the box below because you did not login.