Logo ROOT   6.07/09
Reference Guide
Namespaces
surfaces.py File Reference

Namespaces

 surfaces
 

Detailed Description

View in nbviewer Open in SWAN Surfaces example

pict1_surfaces.py.png
1 
2 from ROOT import TCanvas, TPaveText, TPad, TF2
3 from ROOT import gROOT, gStyle
4 
5 
6 
7 c1 = TCanvas( 'c1', 'Surfaces Drawing Options', 200, 10, 700, 900 )
8 c1.SetFillColor( 42 )
9 gStyle.SetFrameFillColor( 42 )
10 title = TPaveText( .2, 0.96, .8, .995 )
11 title.SetFillColor( 33 )
12 title.AddText( 'Examples of Surface options' )
13 title.Draw()
14 
15 pad1 = TPad( 'pad1', 'Gouraud shading', 0.03, 0.50, 0.98, 0.95, 21 )
16 pad2 = TPad( 'pad2', 'Color mesh', 0.03, 0.02, 0.98, 0.48, 21 )
17 pad1.Draw()
18 pad2.Draw()
19 
20 # We generate a 2-D function
21 f2 = TF2( 'f2', 'x**2 + y**2 - x**3 -8*x*y**4', -1, 1.2, -1.5, 1.5 )
22 f2.SetContour( 48 )
23 f2.SetFillColor( 45 )
24 
25 # Draw this function in pad1 with Gouraud shading option
26 pad1.cd()
27 pad1.SetPhi( -80 )
28 pad1.SetLogz()
29 f2.Draw( 'surf4' )
30 
31 # Draw this function in pad2 with color mesh option
32 pad2.cd()
33 pad2.SetTheta( 25 )
34 pad2.SetPhi( -110 )
35 pad2.SetLogz()
36 f2.Draw( 'surf1' )
37 
38 c1.Update()
Author
Wim Lavrijsen

Definition in file surfaces.py.