pydisdrometer.plot

This module contains plotting functions for the DropSizeDistribution object.

Module contents

dsd_plots

Plotting routines for different aspects of the drop size distribution class.

pydsd.plot.plot.get_masked_hist2d(xvar, yvar, bins=(25, 25), ranges=None, norm=False)[source]

Calculate a 2D histogram.

Remove missing values and calculate a numpy histogram.

Parameters
xvararray
yvararray
bins2-tuple
rangesarray [Xmin, Xmax, Ymin, Ymax]
normbool Whether to normalize the output
pydsd.plot.plot.parse_ax(ax)[source]

Parse and return ax instance.

pydsd.plot.plot.parse_fig(fig)[source]

Parse and return fig instance.

pydsd.plot.plot.plot_NwD0(dsd, col='k', msize=20, edgecolors='none', title=None, ax=None, fig=None, **kwargs)[source]

Create Normalized Intercept Parameter- median volume diameter scatterplot.

Convenience function calls scatter plot.

Parameters
dsddict

PyDSD dictionary.

colstr
msizeint
titlestr
axMatplotlib Axis instance
figMatplotlib Figure instance
**kwargsDictionary to pass to matplotlib
pydsd.plot.plot.plot_ZR(dsd, log_scale=False, col='k', msize=20, edgecolors='none', title=None, ax=None, fig=None, **kwargs)[source]

Create reflectivity - rainfall rate scatterplot.

Convenience function calls scatter plot.

Parameters
dsddict

PyDSD dictionary.

log_scalestr

True for log, Fale for ‘linear’ variables.

colstr
msizeint
titlestr
axMatplotlib Axis instance
figMatplotlib Figure instance
**kwargsDictionary to pass to matplotlib
pydsd.plot.plot.plot_ZR_hist2d(dsd, log_scale=False, bins=(80, 60), ranges=None, norm=None, xlims=None, ylims=None, title=None, colorbar=True, clabel='Normalized Counts', ax=None, fig=None, **kwargs)[source]

Create reflectivity - rainfall rate scatterplot.

Convenience function calls scatter plot.

Parameters
dsddict

PyDSD dictionary.

log_scalestr

True for log, Fale for ‘linear’ variables.

binstuple, (x,y) bin size
normbool Normalize output
xlims2-tuple (Xmin, Xmax)
ylims2-tuple (Ymin, Ymax)
titlestr
colorbarbool
clabel: colorbar label
axMatplotlib Axis instance
figMatplotlib Figure instance
kwargsKeyword arguments to pass to pcolormesh
pydsd.plot.plot.plot_dsd(dsd, xlims=None, ylims=None, log_scale=True, tighten=True, vmin=None, vmax=None, cmap=None, ax=None, fig=None)[source]

Plotting function for drop size distribution Nd

plot_dsd creates a pcolormesh based plot for a drop size distribution object’s Nd field.

Parameters
dsd: DropSizeDistribution

Drop Size Distribution instance containing a Nd.

xlims: 2-tuple

Range of x axis (x_begin, x_end).

ylims: 2-tuple

Range of y axis (y_begin, y_end).

log_scale: boolean

Whether to plot on a log scale, or a linear scale.

tighten: True

Whether to restrict plot to areas with data.

Returns
fig: Figure instance
pydsd.plot.plot.plot_hist2d(xvar, yvar, bins=(80, 60), ranges=None, norm=None, xlims=None, ylims=None, title=None, colorbar=True, clabel='Normalized Counts', ax=None, fig=None, **kwargs)[source]

2-D histogram plot.

Parameters
xvararray
yvararray
binstuple, (x,y) bin size
normbool Normalize output
xlims2-tuple (Xmin, Xmax)
ylims2-tuple (Ymin, Ymax)
titlestr
colorbarbool
clabel: colorbar label
axMatplotlib Axis instance
figMatplotlib Figure instance
kwargsKeyword arguments to pass to pcolormesh
pydsd.plot.plot.plot_ts(dsd, varname, date_format='%H:%M', tz=datetime.timezone.utc, x_min_tick_format='hour', title=None, ax=None, fig=None, **kwargs)[source]

Time series plot of variable.

Parameters
dsddict

PyDSD dictionary.

varnamestr or list

Variable name(s) to plot.

date_formatstr

Timestring format characters.

tzstr

Time zone to uses, see datetime module.

x_min_tick_formatstr

Minor tick formatting, ‘second’,’minute’,’hour’,’day’ supported

titlestr
axMatplotlib Axis instance
figMatplotlib Figure instance
kwkargsKeyword arguments to pass to pcolormesh
pydsd.plot.plot.scatter(xvar, yvar, col='k', msize=20, edgecolors='none', title=None, ax=None, fig=None, **kwargs)[source]

Create a scatterplot two variables.

Parameters
xvararray
yvararray
colstr
msizeint
titlestr
axMatplotlib Axis instance
figMatplotlib Figure instance
**kwargsDictionary to pass to matplotlib
pydsd.plot.plot.set_ax_limits(xlim=None, ylim=None, ax=None)[source]

Convenience function to set x, y limits.

pydsd.plot.plot.set_major_ticks(x=None, y=None, ax=None)[source]

Convenience function to adjust major tick spacing.

pydsd.plot.plot.set_minor_ticks(x=None, y=None, ax=None)[source]

Convenience function to adjust minor tick spacing.

pydsd.plot.plot.set_xlabel(label, pad=None, fontsize=None, ax=None)[source]

Convenience function to adjust x-axis label.

pydsd.plot.plot.set_ylabel(label, pad=None, fontsize=None, ax=None)[source]

Convenience function to adjust x-axis label.

pydsd.plot.plot.turn_ticks_out(ax=None)[source]

Convenience function to turn ticks outward.