holoviews.plotting.bokeh.hex_tiles module#

class holoviews.plotting.bokeh.hex_tiles.HexTilesPlot(element, plot=None, **params)[source]#

Bases: ColorbarPlot

Parameter Definitions


Parameters inherited from:

holoviews.plotting.plot.DimensionedPlot: fontscale, show_title, normalize, projection

holoviews.plotting.plot.GenericElementPlot: apply_ranges, apply_extents, bgcolor, default_span, hooks, invert_axes, invert_xaxis, invert_yaxis, logx, logy, padding, show_legend, show_grid, xaxis, yaxis, xlabel, ylabel, xlim, ylim, zlim, xrotation, yrotation

holoviews.plotting.bokeh.plot.BokehPlot: title, shared_datasource, title_format

holoviews.plotting.bokeh.element.ElementPlot: fontsize, xticks, yticks, toolbar, width, height, active_tools, align, apply_hard_bounds, autorange, border, aspect, backend_opts, data_aspect, frame_width, frame_height, min_width, min_height, max_width, max_height, margin, multi_y, scalebar, scalebar_range, scalebar_unit, scalebar_location, scalebar_label, scalebar_tool, scalebar_opts, subcoordinate_y, subcoordinate_scale, responsive, gridstyle, labelled, lod, show_frame, shared_axes, default_tools, tools, hover_tooltips, hover_formatters, hover_mode, xformatter, yformatter

holoviews.plotting.bokeh.element.ColorbarPlot: color_levels, cformatter, clabel, clim, clim_percentile, cnorm, colorbar, colorbar_position, colorbar_opts, clipping_colors, cticks, logz, rescale_discrete_levels, symmetric

aggregator = ClassSelector(class_=(<class 'collections.abc.Callable'>, <class 'tuple'>), default=<function size at 0x108819df0>, label='Aggregator')

Aggregation function or dimension transform used to compute bin values. Defaults to np.size to count the number of values in each bin.

gridsize = ClassSelector(class_=(<class 'int'>, <class 'tuple'>), default=50, label='Gridsize')

Number of hexagonal bins along x- and y-axes. Defaults to uniform sampling along both axes when setting and integer but independent bin sampling can be specified a tuple of integers corresponding to the number of bins along each axis.

min_count = Number(allow_None=True, inclusive_bounds=(True, True), label='Min count')

The display threshold before a bin is shown, by default bins with a count of less than 1 are hidden.

orientation = Selector(default='pointy', label='Orientation', names={}, objects=['flat', 'pointy'])

The orientation of hexagon bins. By default the pointy side is on top.

color_index = ClassSelector(allow_None=True, class_=(<class 'str'>, <class 'int'>), default=2, label='Color index')

Deprecated in favor of color style mapping, e.g. color=dim(‘color’)

max_scale = Number(bounds=(0, None), default=0.9, inclusive_bounds=(True, True), label='Max scale')

When size_index is enabled this defines the maximum size of each bin relative to uniform tile size, i.e. for a value of 1, the largest bin will match the size of bins when scaling is disabled. Setting value larger than 1 will result in overlapping bins.

min_scale = Number(bounds=(0, None), default=0, inclusive_bounds=(True, True), label='Min scale')

When size_index is enabled this defines the minimum size of each bin relative to uniform tile size, i.e. for a value of 1, the smallest bin will match the size of bins when scaling is disabled. Setting value larger than 1 will result in overlapping bins.

size_index = ClassSelector(allow_None=True, class_=(<class 'str'>, <class 'int'>), label='Size index')

Index of the dimension from which the sizes will the drawn.

aggregator(axis=None)[source]#

Return the number of elements along a given axis.

Parameters#

aarray_like

Input data.

axisint, optional

Axis along which the elements are counted. By default, give the total number of elements.

Returns#

element_countint

Number of elements along the specified axis.

See Also#

shape : dimensions of array ndarray.shape : dimensions of array ndarray.size : number of elements in array

Examples#

>>> import numpy as np
>>> a = np.array([[1,2,3],[4,5,6]])
>>> np.size(a)
6
>>> np.size(a,1)
3
>>> np.size(a,0)
2
get_data(element, ranges, style)[source]#

Returns the data from an element in the appropriate format for initializing or updating a ColumnDataSource and a dictionary which maps the expected keywords arguments of a glyph to the column in the datasource.

get_extents(element, ranges, range_type='combined', **kwargs)[source]#

Gets the extents for the axes from the current Element. The globally computed ranges can optionally override the extents.

The extents are computed by combining the data ranges, extents and dimension ranges. Each of these can be obtained individually by setting the range_type to one of:

  • ‘data’: Just the data ranges

  • ‘extents’: Element.extents

  • ‘soft’: Dimension.soft_range values

  • ‘hard’: Dimension.range values

To obtain the combined range, which includes range padding the default may be used:

  • ‘combined’: All the range types combined and padding applied

This allows Overlay plots to obtain each range and combine them appropriately for all the objects in the overlay.

If lims_as_soft_ranges is set to True, the xlim and ylim will be treated as soft ranges instead of the default case as hard ranges while computing the extents. This is used e.g. when apply_hard_bounds is True and xlim/ylim is set, in which case we limit the initial viewable range to xlim/ylim, but allow navigation up to the abs max between the data range and xlim/ylim.

class holoviews.plotting.bokeh.hex_tiles.hex_binning(*, aggregator, gridsize, invert_axes, min_count, orientation, dynamic, group, input_ranges, link_inputs, streams, name)[source]#

Bases: Operation

Applies hex binning by computing aggregates on a hexagonal grid.

Should not be user facing as the returned element is not directly usable.

Parameter Definitions


Parameters inherited from:

holoviews.core.operation.Operation: group, dynamic, input_ranges, link_inputs, streams

aggregator = ClassSelector(class_=(<class 'collections.abc.Callable'>, <class 'tuple'>), default=<function size at 0x108819df0>, label='Aggregator')

Aggregation function or dimension transform used to compute bin values. Defaults to np.size to count the number of values in each bin.

gridsize = ClassSelector(class_=(<class 'int'>, <class 'tuple'>), default=50, label='Gridsize')

invert_axes = Boolean(default=False, label='Invert axes')

min_count = Number(allow_None=True, inclusive_bounds=(True, True), label='Min count')

orientation = Selector(default='pointy', label='Orientation', names={}, objects=['flat', 'pointy'])

aggregator(axis=None)[source]#

Return the number of elements along a given axis.

Parameters#

aarray_like

Input data.

axisint, optional

Axis along which the elements are counted. By default, give the total number of elements.

Returns#

element_countint

Number of elements along the specified axis.

See Also#

shape : dimensions of array ndarray.shape : dimensions of array ndarray.size : number of elements in array

Examples#

>>> import numpy as np
>>> a = np.array([[1,2,3],[4,5,6]])
>>> np.size(a)
6
>>> np.size(a,1)
3
>>> np.size(a,0)
2