mark1
May 23, 2019, 5:56pm
1
Dear ROOT experts,
I am trying to produce a simple histogram without any vertical lines, i.e. only horizontal lines covering the full bin width and including error bars. My current plotting macro has the following structure:
void PlotTest(){
SetAtlasStyle();
#ifdef __CINT__
gROOT->LoadMacro("AtlasLabels.C");
gROOT->LoadMacro("AtlasUtils.C");
gROOT->LoadMacro("AtlasStyle.C")
#endif
gStyle->SetPalette(kVisibleSpectrum);
gStyle->SetHatchesLineWidth(2);
gStyle->SetHatchesSpacing(1);
hist->SetMarkerSize(0.0);
hist->SetLineColor(1);
hist->SetLineStyle(1);
hist->Draw("E HIST");
c.Print();
return;
}
When I use the E HIST it produces the following https://ibb.co/XzY22gM and if use E HIST ][ it just prints points instead of lines: https://ibb.co/cvN0SgP . How can I fix it in order for it to have only horizontal lines like shown here: https://ibb.co/bPw4Dfj
Thanks in advance!
mark1
May 23, 2019, 8:36pm
3
Thank you for your answer, but this also produced the same plots with just the points…
OK, so let’s wait for @couet , he’s our graphics expert
1 Like
couet
May 24, 2019, 6:21am
5
can we have access to your histogram “hist” ?
mark1
May 24, 2019, 8:25am
6
Hi @couet ,
I just set up a minimal example here https://cernbox.cern.ch/index.php/s/SvyvslQ8hdhAxXk which you can just launch with root PlotTest.C
couet
May 24, 2019, 9:01am
7
The atlas style set this horizontal error to 0.
SetErrorX(0.0001); // get rid of X error bars (as recommended in ATLAS figure guidelines)
try:
[...]
gROOT->SetStyle("ATLAS");
atlasStyle->SetErrorX(0.5); // <<< change the X error
But if you do that you will not follow the recommended in ATLAS figure guidelines.
1 Like
mark1
May 24, 2019, 9:39am
8
Thanks! That solved my problem
couet
May 24, 2019, 10:17am
10
But, as I said, you do not follow the Atlas guidelines if you do that …
system
Closed
June 7, 2019, 10:17am
11
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.