Function, histogram and 3D points using jzy3/jogl
Source code name: "canvas3D_3D_objects.py"
Programming language: Python
Topic: Plots/3D
DMelt Version 1.5. Last modified: 05/18/2016. License: Pro
https://datamelt.org/code/cache/canvas3D_3D_objects_5755.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 *
from java.awt import Color
from java.util import Random

c1=HPlotXYZ("3D",600,600)
c1.setGTitle("3D histogram, points and function")
c1.setNameX("X")
c1.setNameX("Y")
c1.visible(1);
c1.setTickDecimalAll(1)
c1.setScale(0.9)

h1 = P2D("Simple1")
hh=H2D("Histogram",7,-2,2,7,-2,2)

rand = Random()
# fill histogram
for i in range(1000):
      h1.add(rand.nextGaussian(),rand.nextGaussian(),5*rand.nextGaussian())

for i in range(2000):
      hh.fill(rand.nextGaussian(),rand.nextGaussian())

f=F2D("40*x*sin(y)",-2,2,-2,2)
f=F2D("-20*(x*x+y*y)+200",-2,2,-2,2)
c1.add(h1,10,Color.red)
c1.setColorSolid(0)
c1.addAsBars(hh)
c1.add(f)
c1.update()




You see the box below because you did not login.