holoviews.plotting.mpl.util module#

class holoviews.plotting.mpl.util.CFTimeConverter(*, interval_multiples=True)[source]#

Bases: DateConverter

Defines conversions for cftime types by extending nc_time_axis.

classmethod convert(value, unit, axis)[source]#

If value is not already a number or sequence of numbers, convert it with date2num.

The unit and axis arguments are not used.

class holoviews.plotting.mpl.util.EqHistNormalize(vmin=None, vmax=None, clip=False, rescale_discrete_levels=True, nbins=65536, ncolors=256)[source]#

Bases: Normalize

inverse(value)[source]#

Maps the normalized value (i.e., index in the colormap) back to image data value.

Parameters#

value

Normalized value.

process_value(data)[source]#

Homogenize the input value for easy and efficient normalization.

value can be a scalar or sequence.

Parameters#

value

Data to normalize.

Returns#

resultmasked array

Masked array with the same shape as value.

is_scalarbool

Whether value is a scalar.

Notes#

Float dtypes are preserved; integer types with two bytes or smaller are converted to np.float32, and larger types are converted to np.float64. Preserving float32 when possible, and using in-place operations, greatly improves speed for large arrays.

holoviews.plotting.mpl.util.axis_overlap(ax1, ax2)[source]#

Tests whether two axes overlap vertically

holoviews.plotting.mpl.util.filter_styles(style, group, other_groups, blacklist=None)[source]#

Filters styles which are specific to a particular artist, e.g. for a GraphPlot this will filter options specific to the nodes and edges.

Parameters#

styledict

Dictionary of styles and values

groupstr

Group within the styles to filter for

other_groupslist

Other groups to filter out

blacklistlist, optional

List of options to filter out

Returns#

filtereddict

Filtered dictionary of styles

holoviews.plotting.mpl.util.fix_aspect(fig, nrows, ncols, title=None, extra_artists=None, vspace=0.2, hspace=0.2)[source]#

Calculate heights and widths of axes and adjust the size of the figure to match the aspect.

holoviews.plotting.mpl.util.get_raster_array(image)[source]#

Return the array data from any Raster or Image type

holoviews.plotting.mpl.util.get_tight_bbox(fig, bbox_extra_artists=None, pad=None)[source]#

Compute a tight bounding box around all the artists in the figure.

holoviews.plotting.mpl.util.is_color(color)[source]#

Checks if supplied object is a valid color spec.

holoviews.plotting.mpl.util.polygons_to_path_patches(element)[source]#

Converts Polygons into list of lists of matplotlib.patches.PathPatch objects including any specified holes. Each list represents one (multi-)polygon.

holoviews.plotting.mpl.util.resolve_rows(rows)[source]#

Recursively iterate over lists of axes merging them by their vertical overlap leaving a list of rows.

holoviews.plotting.mpl.util.ring_coding(array)[source]#

Produces matplotlib Path codes for exterior and interior rings of a polygon geometry.

holoviews.plotting.mpl.util.validate(style, value, vectorized=True)[source]#

Validates a style and associated value.

Parameters#

stylestr

The style to validate (e.g. ‘color’, ‘size’ or ‘marker’)

value :

The style value to validate

vectorizedbool

Whether validator should allow vectorized setting

Returns#

validboolean or None

If validation is supported returns boolean, otherwise None

holoviews.plotting.mpl.util.wrap_formatter(formatter)[source]#

Wraps formatting function or string in appropriate matplotlib formatter type.