solarwindpy.plotting.spiral.SpiralPlot2D

class SpiralPlot2D(x, y, z=None, logx=False, logy=False, initial_bins=5, clip_data=False)[source]

Bases: PlotWithZdata, CbarMaker

2D spiral plotting with adaptive mesh refinement.

Examples

splot = SpiralPlot2D(…) splot.initialize_mesh()

__init__(x, y, z=None, logx=False, logy=False, initial_bins=5, clip_data=False)[source]
property clim
property initial_bins
property grouped
property mesh
agg(fcn=None)[source]

Aggregate the z-values into their bins.

build_grouped()[source]
calc_initial_bins(nbins)[source]
initialize_mesh(**kwargs)[source]
set_clim(lower=None, upper=None)[source]

Set the min (lower) and max (upper) counts per bin.

This limit is applied after the groupby.agg() is run.

set_data(x, y, z, clip)[source]
make_plot(ax=None, cbar=True, limit_color_norm=False, cbar_kwargs=None, fcn=None, alpha_fcn=None, **kwargs)[source]
plot_contours(ax=None, label_levels=True, cbar=True, limit_color_norm=False, cbar_kwargs=None, fcn=None, plot_edges=False, edges_kwargs=None, clabel_kwargs=None, skip_max_clbl=True, use_contourf=False, **kwargs)[source]

Make a contour plot on ax using ax.contour.

Parameters:
  • ax (mpl.axes.Axes, None) – If None, create an Axes instance from plt.subplots.

  • label_levels (bool) – If True, add labels to contours with ax.clabel.

  • cbar (bool) – If True, create color bar with labels.z.

  • limit_color_norm (bool) – If True, limit the color range to 0.001 and 0.999 percentile range of the z-value, count or otherwise.

  • cbar_kwargs (dict, None) – If not None, kwargs passed to self._make_cbar.

  • fcn (FunctionType, None) – Aggregation function. If None, automatically select in agg().

  • plot_edges (bool) – If True, plot the smoothed, extreme edges of the 2D histogram.

  • clabel_kwargs (None, dict) – If not None, dictionary of kwargs passed to ax.clabel.

  • skip_max_clbl (bool) – If True, don’t label the maximum contour. Primarily used when the maximum contour is, effectively, a point.

  • maximum_color – The color for the maximum of the PDF.

  • use_contourf (bool) – If True, use ax.contourf. Else use ax.contour.

  • gaussian_filter_std (int) – If > 0, apply scipy.ndimage.gaussian_filter to the z-values using the standard deviation specified by gaussian_filter_std.

  • gaussian_filter_kwargs (None, dict) – If not None and gaussian_filter_std > 0, passed to scipy.ndimage.gaussian_filter()

  • kwargs – Passed to ax.pcolormesh(). If row or column normalized data, norm defaults to mpl.colors.Normalize(0, 1).

property clip
property data
property labels
property log
property logger
property path

Path for saving figure.

set_labels(**kwargs)

Set or update x, y, or z labels. Any label not specified in kwargs.

is propagated from self.labels.<x, y, or z>.

set_log(x=None, y=None)
set_path(new, add_scale=True)

Build the plot save path.

Parameters:
  • new (str or Path) – If str and == β€œauto”, then build path from self.labels. Otherwise, assume parameter specifies the desired path and use Path(new).

  • add_scale (bool) – If True, add information about the axis scales to the end of the path.