ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
surfaces.py
Go to the documentation of this file.
1 #
2 # To see the output of this macro, click begin_html <a href="gif/surfaces.gif">here</a> end_html
3 #
4 
5 from ROOT import TCanvas, TPaveText, TPad, TF2
6 from ROOT import gROOT, gStyle
7 
8 
9 
10 c1 = TCanvas( 'c1', 'Surfaces Drawing Options', 200, 10, 700, 900 )
11 c1.SetFillColor( 42 )
12 gStyle.SetFrameFillColor( 42 )
13 title = TPaveText( .2, 0.96, .8, .995 )
14 title.SetFillColor( 33 )
15 title.AddText( 'Examples of Surface options' )
16 title.Draw()
17 
18 pad1 = TPad( 'pad1', 'Gouraud shading', 0.03, 0.50, 0.98, 0.95, 21 )
19 pad2 = TPad( 'pad2', 'Color mesh', 0.03, 0.02, 0.98, 0.48, 21 )
20 pad1.Draw()
21 pad2.Draw()
22 
23 # We generate a 2-D function
24 f2 = TF2( 'f2', 'x**2 + y**2 - x**3 -8*x*y**4', -1, 1.2, -1.5, 1.5 )
25 f2.SetContour( 48 )
26 f2.SetFillColor( 45 )
27 
28 # Draw this function in pad1 with Gouraud shading option
29 pad1.cd()
30 pad1.SetPhi( -80 )
31 pad1.SetLogz()
32 f2.Draw( 'surf4' )
33 
34 # Draw this function in pad2 with color mesh option
35 pad2.cd()
36 pad2.SetTheta( 25 )
37 pad2.SetPhi( -110 )
38 pad2.SetLogz()
39 f2.Draw( 'surf1' )
40 
41 c1.Update()