Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Periodic Axes class in matplotlib?

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?

like image 690
ChrisB Avatar asked Aug 24 '12 19:08

ChrisB


People also ask

What is mean by axes class in MatPlotLib?

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.

What is Add_axes MatPlotLib?

add_axes() function. The add_axes() method figure module of matplotlib library is used to add an axes to the figure.

What is axes and axis in MatPlotLib?

Axis is the axis of the plot, the thing that gets ticks and tick labels. The axes is the area your plot appears in.


1 Answers

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.

Spherical Plotenter image description here

like image 104
Steve Barnes Avatar answered Sep 18 '22 06:09

Steve Barnes