Closed lpsinger closed 8 years ago
@lpsinger - great idea, and this could be useful even for more normal plots. Would you be interested in working on this? :)
There are currently two ways to plot grid lines - one is by plotting lines directly, and the other is to use contours. In either case, there may be ways built-in to Matplotlib to add text along a path.
I'm not sure how to get started. Is there an example that shows how to plot axis labels along arbitrary paths?
@lpsinger - I'm not sure either, but in WCSAxes we use the Path
class to plot the grid lines by default, so it would be worth checking in the Matplotlib gallery for example if there is a way to plot text that follows paths. I can try and investigate this too, but won't be able to do for the next week or so.
Matplotlib's axes base class defines several methods to be defined by subclasses: get_xaxis_transform
, get_xaxis_text1_transform
, get_xaxis_text2_transform
, and the corresponding methods for the y axis. The built-in Matplotlib polar and geographic projections illustrate how these methods control axis label positioning and placement.
However, overriding these methods will probably not work for wcsaxes because the ticks and tick labels are rendered by hand in the Ticks
and TickLabels
classes. None of the examples in the docs have ticks and tick labels that are inside the frame. Do you have any suggestions for what the API for this should look like?
On all-sky axes such as
MOL
, the RA axis labels are crowded together at the poles. For these sorts of axes, a better option would be to be able draw the labels on a particular line of constant declination.