I have a collection of latitude/longitude points that straddle the longitude=0 line. I'd like to plot these using a matplotlib Axes class that "wraps" the horizontal dimension such that, when looking towards l=360, points at l=1 are plotted at the equivalent of l=361. Ideally, I'd also like something that defines the pan/zoom actions so I can use the plot interactively.
I know that it is possible to define custom projections in matplotlib, but I haven't found the equivalent of a Cylindrical projection that implements all of this functionality. I'd rather not use basemap
. Does anyone know if something like this exists somewhere?
Advertisements. Axes object is the region of the image with the data space. A given figure can contain many Axes, but a given Axes object can only be in one Figure. The Axes contains two (or three in the case of 3D) Axis objects.
add_axes() function. The add_axes() method figure module of matplotlib library is used to add an axes to the figure.
Axis is the axis of the plot, the thing that gets ticks and tick labels. The axes is the area your plot appears in.
You can get exactly what you are asking for by modifying the mathplotlib exapmle - api example code: custom_projection_example.py you just need to decide if you would like a spherical representation or cylindrical - if the latter then you may find more useful code in the custom_scale_example.py which also includes panning and zooming but in the example deliberatly limits the data to +-90 degrees - you will need to wrap instead.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With