As already pointed out at http://root.cern.ch/phpBB2/viewtopic.php?t=6380&highlight=cont4
and http://root.cern.ch/phpBB2/viewtopic.php?t=5546&highlight=cont4, “cont” option of TH2::Draw() draws a wrong plot.
“cont4” does the correct job, but the plot cannot be superimposed on another histogram with wider ranges.
I have long regreted that I cannot utilize the abundant functionality of ROOT for practical applications only for this small, but serious flaw.
I am wondering if this problem would be fixed in the near future or there is any clue to get around the problem.
In the two posts you mention the user requests were answered.
So you request in to draw a cont4 on a wider range. It is true that (because of the technique use to draw cont4) the superposition is not straight forward. I will try to make a macro providing a work around.
By the way, as you certainly know, CONT4 draws filled contours, so if you draw it on top of an other histogram it will hide completely what is behind… is that really what you want ? Which option are you using to draw the 'background" histogram ?
Typically I want to superimpose a contour plot on a blank histogram drawn by TPad::DrawFrame(xmin, xmax, ymin, ymax) for comparing two or more plots with the same range.
Of course I do not need to use the superposition if the drawing ranges of the cont4 plot can be expanded without any artifact.
I did not notice there is this simple solution.
Thank you very much!
But I still have a little problem …
Whenever I draw lines or markers etc. over the cont4 plot, I need to convert the histogram coordinate to NDC, which is quite troublesome.
So I tried to define the user coordinate equivalent to the histogram coordinate by the following script:
But this does not work. The methods such as TLine::Draw() still seem to be using NDC.
Is there any way to draw an graphic object on the cont4 plot using user coordinate?