3D histogram (H2D) and a 3D (F2D) function overlyed on HPlot3D
Source code name: "canvas3D_histo2D_2hf.py"
Programming language: Python
Topic: Plots/3D
DMelt Version 1. Last modified: 05/09/2015. License: Pro
https://datamelt.org/code/cache/canvas3D_histo2D_2hf_6220.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,F2D
from java.util import Random

c1 = HPlot3D("Canvas",600,400)
c1.setGTitle("F2D and H2D objects")
c1.setTextBottom("Global X")
c1.setTextLeft("Global Y")


c1.setNameX("X")
c1.setNameY("Y")

c1.setColorMode(4)
c1.visible(1)

h1 = H2D("My 2D Test 1",30,-3.0, 3.0, 30, -3.0, 3.0)
f1 = F2D("8*(x*x+y*y)", -3.0, 3.0, -3.0, 5.0)
rand = Random()
for i in range(1000):
               h1.fill(0.4*rand.nextGaussian(),rand.nextGaussian())
c1.draw(h1,f1)

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


You see the box below because you did not login.