I have these two plots that I would like to overlay on top of each other. But, some how I am unable to. Here is a pdf of the plots: overlayingPlots.pdf (154.8 KB)
What I want is for the ProfileY plot to be superimposed onto the TH2D plot. Here is my attempt:
But that doesn’t seem to work, and from the searching around I have done, it seems like it is a problem related to the fact that I am using TProfileY and not TProfileX.
I also don’t really get the solution provided on the following thread from 2011, but there might be a more robust solution by now for this problem:
Can someone please help me with this? Thank you very much!
One point is that, as couet said, in your TProfile the scales of x-y don’t match the 2D plot, so even if you could do “same”, the second plot wouldn’t show --in fact, x and y are swapped, so you may want to swap them back if you want them to represent the same.
Anyway maybe you can try sometihng like this (create a second Pad on top of the first one and draw the second plot there):