TGraph and Exclusion

Dear all,

I am trying to use TGraph in order to make exclusion plot…
But the behaviour is completely different than the one shown in the example of the TGraphPainter
root.cern.ch/root/html/TGraphPainter.html

There is a line drawn all over the Filled area…, I obviously want the line only on the exclusion line and not on the complete area circonference. What can I do to have things drawn as in the example?
See my attachement…

Here is the code snippet I use:
TCanvas* c1;
c1 = new TCanvas(“c1”, “c1”,800,600);
TGraph* GluinoExclusion = new TGraph(6,Mass,XSec);
GluinoExclusion->SetLineColor(4);
GluinoExclusion->SetFillColor(4);
GluinoExclusion->SetLineWidth(2002);
GluinoExclusion->SetFillStyle(3004);
GluinoExclusion->Draw(“AL* same”);
SaveCanvas(c1, “”, “GluinoExclusion”);
delete c1;

Thanks for help,
Loic


Could you provide the shortest possible running script reproducing your problem?
You seem to define a TGraph with at least 12 points and not 6 as you show in your code snippet!

Rene

Salut Rene,

No, there is only 6 points, see the markers on the graph…
But trying to minimalize the macro that reproduce the bug, I unerstood that the problem is only present when “-b” argument is used.

#include "TCanvas.h"
#include "TGraph.h"

void TGraphDebug(){
   double Mass[] = {200,300,400,500,600,900};
   double XSec[] = {6800, 3000, 2800, 2700, 2750, 4000};

   TCanvas* c1 = new TCanvas("c1", "c1",800,600);
   TGraph* GluinoExclusion = new TGraph(6,Mass,XSec);
   GluinoExclusion->SetLineColor(4);
   GluinoExclusion->SetFillColor(4);
   GluinoExclusion->SetLineWidth(2002);
   GluinoExclusion->SetFillStyle(3004);
   GluinoExclusion->Draw("AL*");
   c1->SaveAs("_GluinoExclusion.png");
   c1->SaveAs("_GluinoExclusion.eps");
   c1->SaveAs("_GluinoExclusion.C");
}

Try the following:
root TGraphDebug.C++ -l -b -q
and check the produced picture ( _GluinoExclusion.png )
it will look similar to the one I posted yesterday…
Now do the same, but without “-b” argument:
root TGraphDebug.C++ -l -q
the picture looks as expected…

I think it is a bug,
I would appreciate if you can give me an easy fix, because I need to produce hundreds of plots and “-b” argument is really necessary in that case.

Thanks for help,
Loic,

for me (using 5.26 or 5.27) the png file is always correct. Are you using an older version?

Rene

This problem was visible only with binary images generated in batch mode. It was visible in stressGraphics for instance. I have fixed it recently. So it is working properly in the last ROOT version.

It was fixed in 5.26. See the release notes:
root.cern.ch/root/v526/Version52 … tml#graf2d

  • In TImageDump the hollow filled areas were not correct:
    they used the line attributes,
    a line was drawn around the polygons filled with patterns.
    This fixes the problem mentionned here: savannah.cern.ch/bugs/index.php?59263 as well as the test #22 in stressGraphics (no need to change the reference file).

Ok… thanks for the answer,
I am using the root version shipped with CMSSW357, which is 5.22/00d
I will see if I can use a more recent one…

thanks again,
Loic