[ROOT] Changing the color of a SURF4 plot

From: Colley, Tony (Tony.Colley@itt.com)
Date: Thu Aug 02 2001 - 00:05:41 MEST


I'm running ROOT on a Linux (Red Hat 7.1) machine [not that it necessarily
matters]. I have created a TH2F from a TMatrix, and have successfully gotten
it to Draw( "SURF4" ). I can even successfully set the base color for the
Gouraud shading using SetFillColor. I decide I don't like the color I chose,
so I try using SetFillColor with a different color and redraw the surface
plot. It comes out in the original color I used, not the new one.

So, I closed all the canvases being displayed and did a gROOT->Reset(). When
the surface is plotted, it is in the original color and not the one I have
told SetFillColor to use since the gROOT->Reset() call. I also tried
gROOT->Reset("a").

The only way I can get the new color is to quit out of ROOT and start it up
again.

You can try this yourself with the surfaces.C script from the ROOT
tutorials.


root[1] .x surfaces.C
[in another window, edit the surfaces.C file to change the SetFillColor for
f2 (on line 22)]
root[2] .x surfaces.C
[the top plot remains in the color it was before]
[close the canvas window]
root[3] gROOT->Reset("a");
root[4] .x surfaces.C
[the top plot stubbornly remains the same color as originally]
root[5] .q

> root
root[1] .x surfaces.C
[the plot comes up in the new color you chose]


You can also try just doing

root[2] f2->SetFillColor(4); 
root[3] f2->Draw("SURF4");

and it won't show up in the new color (even if you do a Reset).

Am I missing some step here?

I have searched the Root site (including the RootTalk archives) and not
found anything that addresses this feature. I also scanned through the Users
Guide and the HTML Reference Document; but I apparently missed the page
where this was discussed. So now I resort to exposing my ignorance to the
world. If this is a stupid question, then please forgive me; but as this is
my first post to RootTalk I believe it's ok because everyone's allowed two
stupid questions in their lifetime, aren't they?

----------------------------------------------------------------------
Tony Colley
ITT Industries A/CD
Fort Wayne, IN, USA
----------------------------------------------------------------------



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:54 MET