Showing a 2D histogram in 3D
Source code name: "histo2D.py"
Programming language: Python
Topic: Histograms/2D
DMelt Version 1. Last modified: 12/12/2015. License: Free
https://datamelt.org/code/cache/histo2D_4980.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 HPlot3D,SHPlot3D,H2D
from java.util import Random


# build a standard canvas
c1 = HPlot3D("Canvas",600,400)

# build a singleton
# c1=SHPlot3D.getCanvas()

c1.setGTitle("Global title")
c1.setNameX("Xaxis")
c1.setNameY("Yaxis")
c1.visible(1)

h1 = H2D("My 2D Test",20,-3.0, 3.0, 20, -3.0, 3.0)
rand = Random();
for i in range(500):
               h1.fill(rand.nextGaussian(),rand.nextGaussian())
c1.draw(h1);

# export to some image (png,eps,pdf,jpeg...)
# c1.export(Editor.DocMasterName()+".png")