aerosandbox.tools.pretty_plots.plots.contour#

Module Contents#

Functions#

contour(*args[, levels, colorbar, linelabels, cmap, ...])

An analogue for plt.contour and plt.tricontour and friends that produces a much prettier default graph.

Attributes#

x

aerosandbox.tools.pretty_plots.plots.contour.contour(*args, levels=31, colorbar=True, linelabels=True, cmap=None, alpha=0.7, extend='neither', linecolor='k', linewidths=0.5, extendrect=True, linelabels_format=eng_string, linelabels_fontsize=8, max_side_length_nondim=np.inf, colorbar_label=None, x_log_scale=False, y_log_scale=False, z_log_scale=False, mask=None, drop_nans=None, contour_kwargs=None, contourf_kwargs=None, colorbar_kwargs=None, linelabels_kwargs=None, **kwargs)[source]#

An analogue for plt.contour and plt.tricontour and friends that produces a much prettier default graph.

Can take inputs with either contour or tricontour syntax.

See syntax here:

https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.contour.html https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.contourf.html https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.tricontour.html https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.tricontourf.html

Parameters:
  • X – If dataset is gridded, follow contour syntax. Otherwise, follow tricontour syntax.

  • Y – If dataset is gridded, follow contour syntax. Otherwise, follow tricontour syntax.

  • Z – If dataset is gridded, follow contour syntax. Otherwise, follow tricontour syntax.

  • levels (Union[int, List, numpy.ndarray]) – See contour docs.

  • colorbar (bool) – Should we draw a colorbar?

  • linelabels (bool) – Should we add line labels?

  • cmap – What colormap should we use?

  • alpha (float) – What transparency should all plot elements be?

  • extend (str) – See contour docs.

  • linecolor – What color should the line labels be?

  • linewidths (float) – See contour docs.

  • extendrect (bool) – See colorbar docs.

  • linelabels_format (Union[str, Callable[[float], str]]) – See ax.clabel docs.

  • linelabels_fontsize (float) – See ax.clabel docs.

  • contour_kwargs (Dict) – Additional keyword arguments for contour.

  • contourf_kwargs (Dict) – Additional keyword arguments for contourf.

  • colorbar_kwargs (Dict) – Additional keyword arguments for colorbar.

  • linelabels_kwargs (Dict) – Additional keyword arguments for the line labels (ax.clabel).

  • **kwargs – Additional keywords, which are passed to both contour and contourf.

  • max_side_length_nondim (float) –

  • colorbar_label (str) –

  • x_log_scale (bool) –

  • y_log_scale (bool) –

  • z_log_scale (bool) –

  • mask (numpy.ndarray) –

  • drop_nans (bool) –

Returns: A tuple of (contour, contourf, colorbar) objects.

aerosandbox.tools.pretty_plots.plots.contour.x[source]#