Closed fkuehlein closed 5 months ago
Looking into this a bit I found that CartopyPlots does not feature a couple of things that MapPlots did. However, I find this legitimate for the sake of simplicity, only that I would then find it consequent to make it even simpler. Here's an idea:
MapPlots features plotting multiple datasets to a single pdf file or to multiple pdf files, or just displaying them in a window.
CartopyPlots simply plots every dataset to a separate png
-file. I feel like this basic plotting feature is totally sufficient, but then why even bother storing datasets in self.map_data
? (note that self.map_mult_data
is unused there) Why not just shortcut add_dataset()
and generate_plots()
and have something like:
class MapPlot:
def __init__(self, grid, title):
# initialise cartopy plot based on given Grid object
def plot(self, title, data, file_name, title_on=True, labels_on=True):
# plot given dataset on the Grid, then show and/or save to specified file
This would also resolve the question of intermediately storing datasets in lists or, for large datasets, npy-files, which was another extra feature of MapPlots. Beyond that, it might be nice to add the option to display the plot that is saved (sth like if keyword: plt.show()
), and specify the file type (keeping png
as default). Could also have separate plot()
and savefig()
methods, as in matplotlib ..
@ntfrgl, @jdonges, what do you think? @zugnachpankow, would you be up to implement such a thing?? Then we could finally substitute the apparently stale MapPlots class!
update: @zugnachpankow and I plan to meet up in January to look into this together!
Look into deprecation/dropping of
climate.MapPlots
, as discussed in #196:climate.MapPlots
's functionality is fully covered byclimate.CartopyPlots
(at least basic features are covered according to @zugnachpankow)climate/map_plots.py
CartopyPlots
toMapPlot
?MapPlots
README.rst
accordingly by removing PyNGL and Matplotlib Basemap from 'optional dependencies'