tobac.plotting.plot_tracks_mask_field#
- tobac.plotting.plot_tracks_mask_field(track, field, mask, features, axes=None, axis_extent=None, plot_outline=True, plot_marker=True, marker_track='x', markersize_track=4, plot_number=True, plot_features=False, marker_feature=None, markersize_feature=None, title=None, title_str=None, vmin=None, vmax=None, n_levels=50, cmap='viridis', extend='neither', orientation_colorbar='horizontal', pad_colorbar=0.05, label_colorbar=None, fraction_colorbar=0.046, rasterized=True, linewidth_contour=1)#
Plot field, features and segments of a timeframe and on a map projection. It is required to pass vmin, vmax, axes and axis_extent as keyword arguments.
- Parameters:
track (pandas.DataFrame) – One or more timeframes of a dataframe generated by linking_trackpy.
field (iris.cube.Cube) – One frame/time step of the original input data.
mask (iris.cube.Cube) – One frame/time step of the Cube containing mask (int id for tracked volumes 0 everywhere else), output of the segmentation step.
features (pandas.DataFrame) – Output of the feature detection, one or more frames/time steps.
axes (cartopy.mpl.geoaxes.GeoAxesSubplot) – GeoAxesSubplot to use for plotting. Default is None.
axis_extent (ndarray) – Array containing the bounds of the longitude and latitude values. The structure is [long_min, long_max, lat_min, lat_max]. Default is None.
plot_outline (bool, optional) – Boolean defining whether the outlines of the segments are plotted. Default is True.
plot_marker (bool, optional) – Boolean defining whether the positions of the features from the track dataframe are plotted. Default is True.
marker_track (str, optional) – String defining the shape of the marker for the feature positions from the track dataframe. Default is ‘x’.
markersize_track (int, optional) – Int defining the size of the marker for the feature positions from the track dataframe. Default is 4.
plot_number (bool, optional) – Boolean defining wether the index of the cells is plotted next to the individual feature position. Default is True.
plot_features (bool, optional) – Boolean defining wether the positions of the features from the features dataframe are plotted. Default is True.
marker_feature (optional) – String defining the shape of the marker for the feature positions from the features dataframe. Default is None.
markersize_feature (optional) – Int defining the size of the marker for the feature positions from the features dataframe. Default is None.
title (str, optional) – Flag determining the title of the plot. ‘datestr’ uses date and time of the field. None sets not title. Default is None.
title_str (str, optional) – Additional string added to the beginning of the title. Default is None.
vmin (float) – Lower bound of the colorbar. Default is None.
vmax (float) – Upper bound of the colorbar. Default is None.
n_levels (int, optional) – Number of levels of the contour plot of the field. Default is 50.
cmap ({'viridis',...}, optional) – Colormap of the countour plot of the field. matplotlib.colors. Default is ‘viridis’.
extend (str, optional) – Determines the coloring of values that are outside the levels range. If ‘neither’, values outside the levels range are not colored. If ‘min’, ‘max’ or ‘both’, color the values below, above or below and above the levels range. Values below min(levels) and above max(levels) are mapped to the under/over values of the Colormap. Default is ‘neither’.
orientation_colorbar (str, optional) – Orientation of the colorbar, ‘horizontal’ or ‘vertical’ Default is ‘horizontal’.
pad_colorbar (float, optional) – Fraction of original axes between colorbar and new image axes. Default is 0.05.
label_colorbar (str, optional) – Label of the colorbar. If none, name and unit of the field are used. Default is None.
fraction_colorbar (float, optional) – Fraction of original axes to use for colorbar. Default is 0.046.
rasterized (bool, optional) – True enables, False disables rasterization. Default is True.
linewidth_contour (int, optional) – Linewidth of the contour plot of the segments. Default is 1.
- Returns:
axes – Axes with the plot.
- Return type:
cartopy.mpl.geoaxes.GeoAxesSubplot
- Raises:
ValueError – If axes are not cartopy.mpl.geoaxes.GeoAxesSubplot. If mask.ndim is neither 2 nor 3.