Description
I have another suggestion of enhancement regarding what Cartopy does. By default, ProPlot uses the long_name
attribute of a DataArray as a title
of the figure, but not the units
attribute. Here is the default behavior of Cartopy when doing a plot (data: ens_avg_snow_cyclic.zip):
import xarray as xr
import proplot as plot
ens_avg_snow_cyclic = xr.open_dataarray('ens_avg_snow_cyclic.nc')
ens_avg_snow_cyclic.plot()
It automatically puts the long_name
and units
attribute of the DataArray beside the color bar. In addition, it writes as a title the coordinates left (I didn't do any projection, the goal is only to show the labels here).
It would be nice to at least have the units
after the title in ProPlot too, in addition to the actual default behavior shown here:
f, axs = plot.subplots(proj='cyl', width=8)
m = axs[0].contourf(ens_avg_snow_cyclic, cmap='BuRd')
f.colorbar(m)
axs.format(
geogridlinewidth=0.5, geogridcolor='gray8', geogridalpha=0.5, labels=True,
coast=True, ocean=True, oceancolor='gray3', latlim=(20,90),
suptitle=str(ens_avg_snow_cyclic.season.values) + ' climatology'
)
Like for example (here are 3 different possibilies I am thinking):
Or having the same behavior as Cartopy like the 2nd example and putting as a title the left coordinates as coord_name = values
. Here it is the season, but usually, if we select a date, it shows time = ...
. After it doesn't have to be like Cartopy, in my opinion adding at least the units would be already nice :)