2D histogram using a density plot in 2D
Source code name: "histo2D_density.py"
Programming language: Python
Topic: Histograms/2D
DMelt Version 1. Last modified: 12/11/2015. License: Pro
https://datamelt.org/code/cache/histo2D_density_5743.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,H2D
from java.util import Random

c1 = HPlot3D("Canvas",600,600)
c1.visible()
c1.setNameX("X")
c1.setNameY("Y")
c1.setRangeZ(0,20)
c1.setDensity()

h1 = H2D("Contour",30,-2.0,2.0,30,-2.0,2.0)
h1.fillGauss(1000, 0, 1.0, 0, 0.2)      # X=0,Y=0 (sX=1,sY=0.2) 
h1.fillGauss(800, 1.0, 0.5, -1.0, 0.2)  # X=1,Y=1 (sX=0.5, sY=0.2) 
c1.draw(h1)


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


You see the box below because you did not login.