You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks in advance for taking the time to reply to
this request.
I am using the Basemap package of matplotlib to
generate plots upon request from a website. The
website interface generates a datafile to be loaded
and ploted on top a global coastline map. Typically,
the following line of code takes about 4.5 seconds:
This not only resulted in map being diassociated with
the figure axis (since the Basemap could not be
pickled after calling it with the ax=ax parameter)
but the pickle.load command took over 7 seconds
(worse than simply generating the plot from scratch
every time).
Is there a way to store the map object into a file
and plot the data on top of the loaded map object
each time the python script executes rather than
regenerating the Basemap each time and wasting 4.5
seconds?
Alternatively, perhaps there is a method I am not
aware of for writing a png or svg file and then
reloading the image and ploting on top of it to avoid
pickling?
Thanks again for the help.
Rupert Minnett
UCSD - SIO
IGPP - Scripps Institute of Oceanography
One to be aware of #1020, which implements pickling of matplotlib figures (and their associated artists). This work could then potentially lead on to pickling of Basemap's, but I am not sure.
Activity
pelson commentedon Jul 18, 2012
One to be aware of #1020, which implements pickling of matplotlib figures (and their associated artists). This work could then potentially lead on to pickling of Basemap's, but I am not sure.
pelson commentedon Jul 18, 2012
For the record, basemaps are already picklable: https://github.com/matplotlib/basemap/blob/master/examples/hires.py