Dear ROOT experts,
I built an Histogram with contour map.
I need to show a label for each line of the contour map to identify the level.
What can I do?
I tried to use the TEXT option when I Draw the histogram, but it show the text of all signle item loaded in the histogram.
I need to show only the level label.
May you kindly help me?
Kind regards,
Daniele.
Hi Daniele,
not quite sure what you want to achieve,
I guess something like this:
C_Fhp2_2p_1.pdf (23.7 KB)
The labels are add “by hand” using TLatex:
TLatex * tex = new TLatex(-1.078915,-0.9282132,"90");
tex->SetTextAlign(22);
tex->SetTextColor(5);
tex->SetTextSize(0.02);
tex->SetLineWidth(2);
tex->Draw();
I dont know of a builtin method to get this automatically.
Cheers
Otto
Hi Otto,
many thanks.
You well understood my problem, but if possible I prefer an automatic way to show the label level.
I set the NumberOfContour to 30 and probably I can have about 20 different level.
If there is a way to show the label of the contour line, I’m sure of the correct value displayed, whereas if I have to put manually the label, I can do a mistake and set a wrong value.
I thank you o much for your answer,
Kind regards,
Daniele.
Hi Daniele,
as I said at least I dont know of a root builtin tool for this
and in general this is quite tedious as you can see from
the attached simple example:
gen_contours.C (2.1 KB)
If you run it as it is it looks quite nice.
But if you just make the simple 2d gaus a bit more complicated
(uncomment the alternative fills) it gets quite messy.
Anyway it may a start for something more sophisticated.
Cheers
Otto
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.