Reverse axis for skymap plots

I’m using TH2F histograms for plotting sky maps in galactic coordinates. The AITOFF option works well.
Unfortunately, galactic coordinates are defined such that the X axis is reversed when sky maps are plotted: typical sky-map plots range from +180 to -180 for X (longitude), and from -90 to +90 for Y (latitude).

To workaround this under root, I am currently filling my TH2Fs after replacing the original X values into -X. After that, of course, I have to hide the resulting X-labels, and re-draw them by hand. It works, but it is a quite artificial procedure.

So… since the above “issue” is known in astronomy, is there any drawing option to automatically show a X-reverse plot??

This in on our to-do list but we have not yet found time and manpower to do it:

Thank you, Couet. I want note that some collaborations (such as Augers) make extensive use of sky-map plots under Root as reference software. It is likely that some tools are already developed and they only need to be properly incorporated in Root.

I would be happy to incorporate a such tool if it exists.
Can you point to one of them ?

[quote=“couet”]I would be happy to incorporate a such tool if it exists.
Can you point to one of them ?[/quote]

Unfortunately not, but a google search gave me this:
What I understand is that there are some algorithms to manually draw the axis grids according to a given projection (Hammer-Aitoff, Sanson-Flamsteed, Parabolic). Something similar is done for their data-points.

From above, I have now extracted some relevant stuff for this example macro: … roject.cpp

Hope it may be useful (not really sure; hmm…).

By the way… If I correctly understand, the AITOFF representation can be plotted only under the “CONT4” option. I confirm the need of other options (like COL) for plotting fine-binned astronomy data. I think this should be easier to implement under Root, and can be implemented independenly on the -X issue.

Yes it is implement that way only right now.

Still no easy way for drawing skymap with reverse axis?

Reverse axis have been recently implemented for TGraph.

Does TH1D or TH2D support reverse axis?
TCanvas::DrawFrame() return a histogram;
but it seems ‘reverse axis’ is not support?

No. there is thus example but it is a trick not a direct support: