7.1.3. tobac.plot.plotting

Provide methods for plotting analyzed data.

Plotting routines include both visualizations of the entire clod field and detailed visualizations for individual convective cells and their properties.

Notes

many short summaries are the same

References

Functions

animation_mask_field(track, features, field, …)
Parameters:
  • track
make_map(axes)
Parameters:axes (cartopy.mpl.geoaxes.GeoAxesSubplot)
map_tracks(track[, axis_extent, figsize, axes])
Parameters:
  • track
plot_histogram_cellwise(track, bin_edges, …)
Parameters:
  • track
plot_histogram_featurewise(Track, bin_edges, …)
Parameters:
  • Track
plot_lifetime_histogram(track[, axes, …])
Parameters:
  • track
plot_lifetime_histogram_bar(track[, axes, …])
Parameters:
  • track
plot_mask_cell_individual_3Dstatic(cell_i, …) Make plots for all cells with fixed frame.
plot_mask_cell_individual_follow(cell_i, …) Make individual plot for cell centered around cell.
plot_mask_cell_individual_static(cell_i, …) Make plots for cell in fixed frame
plot_mask_cell_track_2D3Dstatic(cell, track, …) Make plots for all cells with fixed frame.
plot_mask_cell_track_3Dstatic(cell, track, …) Make plots for all cells with fixed frame.
plot_mask_cell_track_follow(cell, track, …) Make plots for all cells centered around cell.
plot_mask_cell_track_static(cell, track, …) Make plots for all cells with fixed frame.
plot_mask_cell_track_static_timeseries(cell, …) Make plots for all cells with fixed frame.
plot_tracks_mask_field(track, field, mask, …)
Parameters:
  • track
plot_tracks_mask_field_loop(track, field, …)
Parameters:
  • track
tobac.plot.plotting.animation_mask_field(track, features, field, mask, interval=500, figsize=(10, 10), **kwargs)
Parameters:
  • track
  • field (iris.cube.Cube)
  • mask (iris.cube.Cube) – Cube containing mask (int id for tacked volumes 0 everywhere else).
  • interval (int, optional) – Default is 500.
  • figsize (tupel, optional) – Default is (10, 10).
  • **kwargs
Returns:

Return type:

none

Notes

needs more descriptions and a short summary line

tobac.plot.plotting.make_map(axes)
Parameters:axes (cartopy.mpl.geoaxes.GeoAxesSubplot)
Returns:axes
Return type:cartopy.mpl.geoaxes.GeoAxesSubplot

Notes

needs more descriptions and short summary

tobac.plot.plotting.map_tracks(track, axis_extent=None, figsize=(10, 10), axes=None)
Parameters:
  • track
  • axis_extent (matplotlib.axes, optional) – Default is None.
  • figsize (tupel, optional) – Default is (10, 10).
  • axes (cartopy.mpl.geoaxes.GeoAxesSubplot, optional) – Default is None.
Returns:

axes

Return type:

cartopy.mpl.geoaxes.GeoAxesSubplot

Notes

needs short summary needs more descriptions unsure about anything

tobac.plot.plotting.plot_histogram_cellwise(track, bin_edges, variable, quantity, axes=None, density=False, **kwargs)
Parameters:
  • track
  • bin_edges (numpy.arange, optional) – Default is np.arange(0, 200, 20).
  • variable
  • quantity
  • axes (cartopy.mpl.geoaxes.GeoAxesSubplot, optional) – Default is None.
  • density (bool, optional) – Defualt is False.
  • **kwargs
Returns:

Return type:

plot_hist

Notes

needs short summary and descriptions

tobac.plot.plotting.plot_histogram_featurewise(Track, bin_edges, variable, axes=None, density=False, **kwargs)
Parameters:
  • Track
  • bin_edges (numpy.arange, optional) – Default is np.arange(0, 200, 20).
  • variable
  • axes (cartopy.mpl.geoaxes.GeoAxesSubplot, optional) – Default is None.
  • density (bool, optional) – Defualt is False.
  • **kwargs
Returns:

Return type:

plot_hist

Notes

needs short summary and descriptions

tobac.plot.plotting.plot_lifetime_histogram(track, axes=None, bin_edges=array([ 0, 20, 40, 60, 80, 100, 120, 140, 160, 180]), density=False, **kwargs)
Parameters:
  • track
  • axes (cartopy.mpl.geoaxes.GeoAxesSubplot, optional) – Default is None.
  • bin_edges (numpy.arange, optional) – Default is np.arange(0, 200, 20).
  • density (bool, optional) – Defualt is False.
  • **kwargs
Returns:

Return type:

plot_hist

Notes

needs short summary and descriptions

tobac.plot.plotting.plot_lifetime_histogram_bar(track, axes=None, bin_edges=array([ 0, 20, 40, 60, 80, 100, 120, 140, 160, 180]), density=False, width_bar=1, shift=0.5, **kwargs)
Parameters:
  • track
  • axes (cartopy.mpl.geoaxes.GeoAxesSubplot, optional) – Default is None.
  • bin_edges (numpy.arange, optional) – Default is np.arange(0, 200, 20).
  • density (bool, optional) – Defualt is False.
  • width_bar (int, optional) – Default is 1.
  • shift (float, optional) – Default is 0.5.
  • **kwargs
Returns:

Return type:

plot_hist

Notes

needs short summary and descriptions

tobac.plot.plotting.plot_mask_cell_individual_3Dstatic(cell_i, track, cog, features, mask_total, field_contour, field_filled, axes=None, xlim=None, ylim=None, label_field_contour=None, cmap_field_contour='Blues', norm_field_contour=None, linewidths_contour=0.8, contour_labels=False, vmin_field_contour=0, vmax_field_contour=50, levels_field_contour=None, nlevels_field_contour=10, label_field_filled=None, cmap_field_filled='summer', norm_field_filled=None, vmin_field_filled=0, vmax_field_filled=100, levels_field_filled=None, nlevels_field_filled=10, title=None, feature_number=False, ele=10.0, azim=210.0)

Make plots for all cells with fixed frame.

With one background field as filling and one background field as contrours.

Parameters:
  • cell_i
  • track
  • cog
  • features (pandas.DataFrame) – Output from trackpy/maketrack.
  • mask_total (iris.cube.Cube)
  • field_contour
  • field_filled
  • axes (cartopy.mpl.geoaxes.GeoAxesSubplot, optional) – Default is None.
  • xlim (list of float, optional) – [x_min/1000, x_max/1000]. Default is None.
  • ylim (list of float, optional) – [y_min/1000, y_max/1000]. Default is None.
  • label_field_contour (optional) – Default is None.
  • cmap_field_contour ({‘Blues’, …}, optional) – matplotlib.colors. Default is ‘Blues’.
  • norm_field_contour (optional) – Default is None.
  • linewidths_contour (float, optional) – Default is 0.8.
  • contour_labels (bool, optional) – Default is False.
  • vmin_field_contour (int, optional) – Default is 0.
  • vmax_field_contour (int, optional) – Default is 50.
  • levels_field_contour (optional) – Default is None.
  • nlevels_field_contour (int, optional) – Default is 10.
  • label_field_filled (optional) – Default is None.
  • cmap_field_filled ({‘summer’, …}, optional) – matplotlib.pyplot colormap. Default is ‘summer’.
  • norm_field_filled (optional) – Default is None.
  • vmin_field_filled (int, optional) – Default is 0.
  • vmax_field_filled (int, optional) – Default is 100.
  • levels_field_filled (optional) – Default is None.
  • nlevels_field_filled (int, optional) – Default is 10.
  • title (optional) – Default is None.
  • feature_number (bool, optional) – Defaults is False.
  • ele (float, optional) – Default is 10.0.
  • azim (float, optional) – Default is 210.0.
Returns:

axes

Return type:

cartopy.mpl.geoaxes.GeoAxesSubplot

Notes

needs more descriptions

tobac.plot.plotting.plot_mask_cell_individual_follow(cell_i, track, cog, features, mask_total, field_contour, field_filled, axes=None, width=10000, label_field_contour=None, cmap_field_contour='Blues', norm_field_contour=None, linewidths_contour=0.8, contour_labels=False, vmin_field_contour=0, vmax_field_contour=50, levels_field_contour=None, nlevels_field_contour=10, label_field_filled=None, cmap_field_filled='summer', norm_field_filled=None, vmin_field_filled=0, vmax_field_filled=100, levels_field_filled=None, nlevels_field_filled=10, title=None)

Make individual plot for cell centered around cell.

With one background field as filling and one background field as contrours.

Parameters:
  • cell_i
  • track
  • cog
  • features (pandas.DataFrame) – Output from trackpy/maketrack.
  • mask_total (iris.cube.Cube)
  • field_contour
  • field_filled
  • axes (cartopy.mpl.geoaxes.GeoAxesSubplot, optional) – Default is None.
  • width (int, optional) – Default is 10000.
  • label_field_contour (optional) – Default is None.
  • cmap_field_contour ({‘Blues’, …}, optional) – matplotlib.colors. Default is ‘Blues’.
  • norm_field_contour (optional) – Default is None.
  • linewidths_contour (float, optional) – Default is 0.8.
  • contour_labels (bool, optional) – Default is False.
  • vmin_field_contour (int, optional) – Default is 0.
  • vmax_field_contour (int, optional) – Default is 50.
  • levels_field_contour (optional) – Default is None.
  • label_field_filled (optional) – Default is None.
  • cmap_field_filled ({‘summer’, …}, optional) – matplotlib.pyplot colormap, Default is ‘summer’.
  • norm_field_filled (optional) – Default is None.
  • vmin_field_filled (int, optional) – Default is 0.
  • vmax_field_filled (int, optional) – Default is 100.
  • levels_field_filled (optional) – Default is None.
  • nlevels_field_filled (int, optional) – Default is 10.
  • title (optional) – Default is None.
Returns:

axes

Return type:

cartopy.mpl.geoaxes.GeoAxesSubplot

tobac.plot.plotting.plot_mask_cell_individual_static(cell_i, track, cog, features, mask_total, field_contour, field_filled, axes=None, xlim=None, ylim=None, label_field_contour=None, cmap_field_contour='Blues', norm_field_contour=None, linewidths_contour=0.8, contour_labels=False, vmin_field_contour=0, vmax_field_contour=50, levels_field_contour=None, nlevels_field_contour=10, label_field_filled=None, cmap_field_filled='summer', norm_field_filled=None, vmin_field_filled=0, vmax_field_filled=100, levels_field_filled=None, nlevels_field_filled=10, title=None, feature_number=False)

Make plots for cell in fixed frame

With one background field as filling and one background field as contrours.

Parameters:
  • cell_i
  • track
  • cog
  • features (pandas.DataFrame) – Output from trackpy/maketrack.
  • mask_total (iris.cube.Cube)
  • field_contour
  • field_filled
  • axes (cartopy.mpl.geoaxes.GeoAxesSubplot, optional) – Default is None.
  • xlim (list of float, optional) – [x_min/1000, x_max/1000]. Default is None.
  • ylim (list of float, optional) – [y_min/1000, y_max/1000]. Default is None.
  • label_field_contour (optional) – Default is None.
  • cmap_field_contour ({‘Blues’, …}, optional) – matplotlib.colors. Default is ‘Blues’.
  • norm_field_contour (optional) – Default is None.
  • linewidths_contour (float, optional) – Default is 0.8.
  • contour_labels (bool, optional) – Default is False.
  • vmin_field_contour (int, optional) – Default is 0.
  • vmax_field_contour (int, optional) – Default is 50.
  • levels_field_contour (optional) – Default is None.
  • nlevels_field_contour (int, optional) – Default is 10.
  • label_field_filled (optional) – Default is None.
  • cmap_field_filled ({‘summer’, …}, optional) – matplotlib.pyplot colormap. Default is ‘summer’.
  • norm_field_filled (optional) – Default is None.
  • vmin_field_filled (int, optional) – Default is 0.
  • vmax_field_filled (int, optional) – Default is 100.
  • levels_field_filled (optional) – Default is None.
  • nlevels_field_filled (int, optional) – Default is 10.
  • title (optional) – Default is None.
  • feature_number (bool, optional) – Defaults is False.
Returns:

axes

Return type:

cartopy.mpl.geoaxes.GeoAxesSubplot

Notes

needs more descriptions

tobac.plot.plotting.plot_mask_cell_track_2D3Dstatic(cell, track, cog, features, mask_total, field_contour, field_filled, width=10000, n_extend=1, name='test', plotdir='./', file_format=['png'], figsize=(3.937007874015748, 3.937007874015748), dpi=300, ele=10, azim=30, **kwargs)

Make plots for all cells with fixed frame.

Including entire development of the cell and with one background field as filling and one background field as contrours.

Parameters:
  • cell
  • track
  • cog
  • features (pandas.DataFrame) – Output from trackpy/maketrack.
  • mask_total (iris.cube.Cube)
  • field_contour
  • field_filled
  • width (int, optional) – Default is 10000.
  • n_extend (int, optional) – Default is 1.
  • name (str, optional) – Default is ‘test’.
  • plotdir (str, optional) – Path where the plot will be saved. Default is ‘./’.
  • file_format ({[‘png’], [‘pdf’]}, optional) – Default is [‘png’].
  • figsize (tupel of float, optional) – Default is (10/2.54, 10/2.54).
  • dpi (int, optional) – Plot resolution. Default is 300.
  • **kwargs
Returns:

Return type:

none

Notes

needs more descriptions

tobac.plot.plotting.plot_mask_cell_track_3Dstatic(cell, track, cog, features, mask_total, field_contour, field_filled, width=10000, n_extend=1, name='test', plotdir='./', file_format=['png'], figsize=(3.937007874015748, 3.937007874015748), dpi=300, **kwargs)

Make plots for all cells with fixed frame.

Including entire development of the cell and with one background field as filling and one background field as contrours.

Parameters:
  • cell
  • track
  • cog
  • features (pandas.DataFrame) – Output from trackpy/maketrack.
  • mask_total (iris.cube.Cube)
  • field_contour
  • field_filled
  • width (int, optional) – Default is 10000.
  • n_extend (int, optional) – Default is 1.
  • name (str, optional) – Default is ‘test’.
  • plotdir (str, optional) – Path where the plot will be saved. Default is ‘./’.
  • file_format ({[‘png’], [‘pdf’]}, optional) – Default is [‘png’].
  • figsize (tupel of float, optional) – Default is (10/2.54, 10/2.54).
  • dpi (int, optional) – Plot resolution. Default is 300.
  • **kwargs
Returns:

Return type:

none

Notes

needs more descriptions

tobac.plot.plotting.plot_mask_cell_track_follow(cell, track, cog, features, mask_total, field_contour, field_filled, width=10000, name='test', plotdir='./', file_format=['png'], figsize=(3.937007874015748, 3.937007874015748), dpi=300, **kwargs)

Make plots for all cells centered around cell.

With one background field as filling and one background field as contrours.

Parameters:
  • cell (int) – Integer id of cell to create masked cube for.
  • track
  • cog
  • features (pandas.DataFrame) – Output from trackpy/maketrack.
  • mask_total (iris.cube.Cube)
  • field_contour
  • field_filled
  • width (int, optional) – Default is 10000.
  • name (str, optional) – Default is ‘test’.
  • plotdir (str, optional) – Path where the plot will be saved. Default is ‘./’.
  • file_format ({[‘png’], [‘pdf’]}, optional) – Default is [‘png’].
  • dpi (int, optional) – Plot resolution. Default is 300.
  • **kwargs
Returns:

Return type:

none

Notes

unsure about features, mask_total needs more descriptions

tobac.plot.plotting.plot_mask_cell_track_static(cell, track, cog, features, mask_total, field_contour, field_filled, width=10000, n_extend=1, name='test', plotdir='./', file_format=['png'], figsize=(3.937007874015748, 3.937007874015748), dpi=300, **kwargs)

Make plots for all cells with fixed frame.

Inculding entire development of the cell and with one background field as filling and one background field as contrours.

Parameters:
  • cell
  • track
  • cog
  • features (pandas.DataFrame) – Output from trackpy/maketrack.
  • mask_total (iris.cube.Cube)
  • field_contour
  • field_filled
  • width (int, optional) – Default is 10000.
  • n_extend (int, optional) – Default is 1.
  • name (str, optional) – Default is ‘test’.
  • plotdir (str, optional) – Path where the plot will be saved. Default is ‘./’.
  • file_format ({[‘png’], [‘pdf’]}, optional) – Default is [‘png’].
  • figsize (tupel of float, optional) – Default is (10/2.54, 10/2.54).
  • dpi (int, optional) – Plot resolution. Default is 300.
  • **kwargs
Returns:

Return type:

none

Notes

needs more descriptions

tobac.plot.plotting.plot_mask_cell_track_static_timeseries(cell, track, cog, features, mask_total, field_contour, field_filled, track_variable=None, variable=None, variable_ylabel=None, variable_label=[None], variable_legend=False, variable_color=None, width=10000, n_extend=1, name='test', plotdir='./', file_format=['png'], figsize=(7.874015748031496, 3.937007874015748), dpi=300, **kwargs)

Make plots for all cells with fixed frame.

Including entire development of the cell and with one background field as filling and one background field as contrours.

Parameters:
  • cell
  • track
  • cog
  • features (pandas.DataFrame) – Output from trackpy/maketrack.
  • mask_total (iris.cube.Cube)
  • field_contour
  • field_filled
  • track_variable (optional) – Default is None.
  • variable (optional) – Default is None.
  • variable_ylabel (optional) – Default is None.
  • variable_label (list, optional) – Default is [None].
  • variable_legend (bool, optional) – Default is False.
  • variable_color (optional) – Default is None.
  • width (int, optional) – Default is 10000.
  • n_extend (int, optional) – Default is 1.
  • name (str, optional) – Default is ‘test’.
  • plotdir (str, optional) – Path where the plot will be saved. Default is ‘./’.
  • file_format ({[‘png’], [‘pdf’]}, optional) – Default is [‘png’].
  • figsize (tupel of float, optional) – Default is (10/2.54, 10/2.54).
  • dpi (int, optional) – Plot resolution. Default is 300.
  • **kwargs
Returns:

axes

Return type:

cartopy.mpl.geoaxes.GeoAxesSubplot

Notes

needs more descriptions

tobac.plot.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)
Parameters:
  • track
  • field (iris.cube.Cube)
  • mask (iris.cube.Cube) – Cube containing mask (int id for tacked volumes 0 everywhere else).
  • features (pandas.DataFrame) – Output from trackpy/maketrack.
  • axes (cartopy.mpl.geoaxes.GeoAxesSubplot, optional) – Default is None.
  • axis_extent (matplotlib.axes, optional) – Default is None.
  • plot_outline (bool, optional) – Default is True.
  • plot_marker (bool, optional) – Default is True.
  • marker_track (str, optional) – Default is ‘x’.
  • markersize_track (int, optional) – Default is 4.
  • plot_number (bool, optional) – Default is True.
  • plot_features (bool, optional) – Default is False.
  • marker_feature (optional) – Default is None.
  • markersize_feature (optional) – Default is None.
  • title (optional) – Default is None.
  • title_str (str, optional) – Default is None.
  • vmin (optional) – Default is None.
  • vmax (optional) – Default is None.
  • n_levels (int, optional) – Default is 50.
  • cmap ({‘viridis’,…}, optional) – matplotlib.colors. Default is ‘viridis’.
  • extend (str, optional) – Default is ‘neither’.
  • orientation_colorbar (str, optional) – Default is ‘horizontal’.
  • pad_colorbar (float, optional) – Default is 0.05.
  • label_colorbar (optional) – Default is None.
  • fraction_colorbar (float, optional) – Default is 0.046.
  • rasterized (bool, optional) – Default is True.
  • linewidth_contour (int, optional) – Default is 1.
Returns:

axes

Return type:

cartopy.mpl.geoaxes.GeoAxesSubplot

Raises:

ValueError – If axes are not cartopy.mpl.geoaxes.GeoAxesSubplot.

If mask.ndim is neither 2 nor 3.

Notes

needs a short summary line and descriptions

tobac.plot.plotting.plot_tracks_mask_field_loop(track, field, mask, features, axes=None, name=None, plot_dir='./', figsize=(3.937007874015748, 3.937007874015748), dpi=300, margin_left=0.05, margin_right=0.05, margin_bottom=0.05, margin_top=0.05, **kwargs)
Parameters:
  • track
  • field (iris.cube.Cube)
  • mask (iris.cube.Cube) – Cube containing mask (int id for tacked volumes 0 everywhere else).
  • features (pandas.DataFrame) – Output from trackpy/maketrack.
  • axes (cartopy.mpl.geoaxes.GeoAxesSubplot, optional) – Default is None.
  • name (str)
  • plot_dir (str, optional) – Path where the plot will be saved. Default is ‘./’.
  • figsize (tupel of float, optional) – Default is (10/2.54, 10/2.54).
  • dpi (int, optional) – Plot resolution. Default is 300.
  • margin_left (float, optional) – Default is 0.05.
  • margin_right (float, optional) – Default is 0.05.
  • margin_bottom (float, optional) – Default is 0.05.
  • margin_top (float, optional) – Default is 0.05.
  • **kwargs
Returns:

Return type:

none

Notes

needs more descriptions and a short summary line