Plot 3D histogram, function with contour plot
Source code name: "canvas3D_fun_surface.py"
Programming language: Python
Topic: Plots/3D
DMelt Version 1.5. Last modified: 05/19/2016. License: Pro
https://datamelt.org/code/cache/canvas3D_fun_surface_3170.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.


# Script to create a logo for Dmelt 1.5
from jhplot import *
from java.awt import Color
from java.util import Random

c1=HPlotXYZ("DMelt logo",600,600)
c1.setGTitle("3D histogram and a function")
c1.visible(1)
c1.setScale(0.9)
hh=H2D("Histogram",20,-2,2,20,-2,2)
rand = Random()
for i in range(20000):
      hh.fill(rand.nextGaussian(),rand.nextGaussian())
f=F2D("-20*(x*x+y*y)+200",-2,2,-2,2)
c1.setColorSolid(0)
# c1.addAsBars(hh)
c1.setContourColor3D()
c1.setTickDecimalAll(1)
c1.addAsSurface(hh)
c1.add(f)
c1.setNameX("")
c1.setNameY("")
c1.setNameZ("")
c1.update()




You see the box below because you did not login.