argopy.plot.discrete_coloring#
- discrete_coloring = <function discrete_coloring>[source]#
Handy class to manage discrete coloring and the associated colorbar
Warning
This plotting utility is deprecated since 0.1.13. It’s been replaced by
argopy.plot.ArgoColors
. Calling it will raise an error after argopy 0.1.14.Examples
This class can be used like this:
year_range = np.arange(2002,2010) dc = discrete_coloring(name='Spectral', N=len(year_range) ) plt.scatter(this['LONGITUDE'], this['LATITUDE'], c=this['TIME.year'], cmap=dc.cmap, vmin=year_range[0], vmax=year_range[-1]) dc.cbar(ticklabels=yr_range, fraction=0.03, label='Years')