You are a guest. Restricted access. Read more

# 3D plots

Typically, you can build a canvas in 3D (X-Y-Z) as:

```from jhplot import HPlot3D
c1 = HPlot3D("Canvas",600,400,2,1) # canvas size 600x400, 2 plot regions
c1.visible(10,20)  # make it visible and position at 10-20 pixels
c1.setAutoRange()    # autorange for X
c1.draw(object1)     # draw object1 (H2D,F2D,P2D etc)
c1.draw(object2)     # draw a new object
c1.export("figure.pdf") # export to PDF file```

This code create a canvas with the size 600×400 (in pixels), it has 2 pads to show data. The method visible(100,200) make the canvas visible and sets its location on the screen at position 100 (in X from left conner) and 200 (from top) in pixels. If you want a default position, jut call “visible()”. Then you can draw any mathematical object or data. Then you can export the image to vector format. Now you are ready to plot functions, histograms and datasets. See the detail in HPlot3D

Let us build a canvas without any data:

```from jhplot import HPlot3D
c1 = HPlot3D("Canvas",600,400,2,1) # canvas size 600x400, 2 plot regions
c1.visible()  # make it visible screen```

Let us show a simple example by plotting a function of 2 variables in X and Y in this 3D canvas:

```from jhplot import HPlot3D,F2D
c1 = HPlot3D("Canvas")
c1.visible()
f=F2D('0.2*x*y*cos(x)*sin(y)',-10,10,-10,10)
c1.draw(f)```

One can comment and discuss this section after becoming a full member.

Sergei Chekanov 2010/03/07 16:37