ROOT Version: 6.08.06-c8fb4
Platform: lxplus machines
Dear ROOT experts,
I would like to simply draw 2 histograms as following :
BUT in the Y-axis. 1 histogram is red filled and the other is only a dashed-line appearance to be visible on top of the other as shown by the plot1 here :
summaryDisco_onlyHELHC_15_X.pdf (14.6 KB)
After some googling, I have found the “hbar” option and it is not keeping the dashed line… see the plot2:
summaryDisco_onlyHELHC_15_Y.pdf (14.5 KB)
How can I do plot1 in Y-axis?
Bets regards, David.
I’m not sure if this is what you want:
All plotting options can always be found in THistPainter
No it is not doing what I want. I don’t want ot have hbar style in the x axis.
What I want is to keep the style of plot1 and the histograms to be horizontal and not vertical.
So in summary plot1 with a flip of X-Y axis.
The line style has nothing to do with the bar or bar option. In your first plot you every likely have somewhere (in your macro) something like h->SetLineStyle(…).
Yes you are right. I have asked explicitely the style with SetLineStye(2).
What I have seen is that bar or hbar option are making hisotgrams filled by default and destroys the dash-line/not-filled style of my histogram.
My initial question is : how can I have my plot1 with horizontal histograms with this exact same style?
Ah yes… you are right the HBAR is always drawn as filled area never as lines. So you cannot make dashed line with hbar option.
any idea how to simply switch x and y axis ?
If you want a plot like the bar one you showed tI do not see any other way. May be you can try to show it without dotted line. using transparency for instance ?
TGraph would allow to switch axis more easily than TH1. You can try to put your dotted line in a TGraph.
Can you explain me how to do the TGraph with x-y axis switched please?
Or give link to examples?
OK it is very simple
The possibility to change the line style with options Bar and HBAR is now implemented.
TCanvas *c1 = new TCanvas("c1", "c1",10,45,700,502);
TH1F *hpx = new TH1F("hpx","This is the px distribution",10,-4,4);
many thanks. I just got a try and I am not able to have what you are showing.
Do I have to use a specific ROOT version?
Oh, it is in the root master … the latest head version of root. i just did the commit.
Last question how to setup the latest head version of ROOT from lxplus?
I guess you will need to install ROOT yourself… As explained here https://github.com/root-project/root
(scroll down the page).
It works. Many thanks.
Do you know when the new ROOT tag containing this update will be available? And which tag number will it be?
It is now in master only. So it will be in the next release. 6.18. we just release 6.16.
OK thanks a lot for your help.