I am trying to make a print out of 4 histograms in an orientation that mimics the geometry of a detector we’re using. The detector is a box with one CCD on each of four sides, so I’d like to arrange a canvas where one histogram is at the top in standard orientation, one is on the right rotated 90 degrees clockwise, a third is at the bottom rotated 180 degrees, and the final histogram on the left rotated 270 degrees.
I’ve looked at other posts that recommended using the hbar option to obtain a horizontal orientation, but that approach doesn’t go quite far enough to allow me the flexibility of rotating that I need. I also tried making a lego plot and using SetTheta and SetPhi, which made it possible to achieve the bottom plot, but of course can’t give me the horizontal orientations.
I’ve never run into Qt before, so it’s going to take me awhile to get myself situated with that. So there’s no way to rotate a pad or histogram using root classes?
Hi Jeff,
do you want to rotate an “object” or an image of histogram?,
because these are different cases.
In the later case you can convert/save what is drawn in a canvas as an image and
then rotate it, and display it.
For creation of rotated image you can use TImage class.
What you’re talking about would be perfectly sufficient I think, and it’s one of the approaches I’ve tried. Looking through the TImage documentation, though, I haven’t been able to figure out the best way to effect a rotation once the image object is created. Could you give me more specifics or an example of how to do that?
[quote=“jklukas”]I’ve never run into Qt before, [/quote]Please find the source, Qt project and screenshot attached. (This can be done with no compilation from the CINT too providing you installed “qtcint” dictionary root.bnl.gov/QtRoot/htmldoc/src/qtclasses.h.html RotatePad.cxx (1.83 KB) RotatePad.pro.txt (1.25 KB)
[quote=“fine”][quote=“Valeriy Onuchin”]TImage::Mirror root.cern.ch/root/htmldoc/TASIma … age:Mirror
methods.[/quote] I think the “mirrored” image of the histrogram would look quite funny [/quote]