trajan.animation.Animation.color_by#
- animation.Animation.color_by(variable, cmap=None, vmin=None, vmax=None, label=None, colorbar=True)#
Color particles by a variable or a fixed matplotlib colour.
- Parameters:
variable (
strorxarray.DataArray) – A DataArray with dims(trajectory, time), a dataset variable name (e.g.'speed'), or a fixed matplotlib colour string (e.g.'red').cmap (
strorColormap, optional) – Colormap (default:'jet').vmin, vmax (
float, optional) – Colour scale limits.label (
str, optional) – Colorbar label.colorbar (
bool, optional) – Whether to draw a colorbar (default:True).
- Returns:
self