Hi,
I am struggling with what I suspect should be a simple problem. But I haven’t found a solution so far.
Here is a simple macro I am working with:
[code]void Newcanvas2()
{
TCanvas *C = new TCanvas(“C”,“canvas”,600,600);
C->SetFillColor(17);
C->SetBorderMode(0);
TH2F *h2 = new TH2F(“h”,“Axes”,20,-10,10,20,-10,10);
h2->Draw(“AXIS”);
TF1 *f1 = new TF1(“f1”,“sin(x)/x”,0,10);
f1->Draw();
}
[/code]
If I run this with [color=#4040FF].X Newcanvas2.C[/color], I get the graph I expect, but if I make a change (such as changing sin to cos or changing the FillColor, the change is not taken into account. I have to log out of ROOT and log in again and then it works as expected.
ps: This seems similar to me to the problem described in some other threads (for example: Macro loading in root6) . But I thought that a solution had been found to those problems…
Yes that was a fairly fundamental bug in ROOT 6.06. As Olivier points out it’s fixed in the master; I’ll check next week whether I can backport the fix - I remember that it was non trivial / fairly intrusive. Still, this one is really annoying. I’ll let you know, please ping me should I forget!
I have ended up installing the master (6.09/01) and indeed the problem has disappeared with it. Up until this point, I hadn’t realised that the master was a separate version. Since it is a development version is it recommended to use it? Is it stable enough to be used with students?
In case it helps anyone else.
I ended up removing the previous version completely and obtained the master source from:
And I built it using the instructions in this thread: viewtopic.php?f=3&t=22150&p=97060#p97010