scanpy.pl.dot_area

Contents

scanpy.pl.dot_area#

scanpy.pl.dot_area(vec, *, dot_min=0, dot_max=1, smallest_dot=0, largest_dot=200, size_exponent=1.5)[source]#

Dot area transform, e.g. for dotplot().

Normalizes vec by its maximum, clips/rescales it between dot_min/dot_max, raises it to size_exponent, and finally scales it into [smallest_dot, largest_dot].

smallest_dot/largest_dot are marker areas, matching Matplotlib’s s (as used by the legacy, Matplotlib-only dotplot()). HoloViews’ size style option means a diameter on Bokeh/Plotly, unlike Matplotlib’s area-based s, so callers targeting those backends need to take the square root of the result.

Parameters:
vec TypeVar(V, bound= ndarray[tuple[Any, ...], dtype[floating]] | dim)

Vector or dimension to transform.

dot_min float (default: 0)

Normalized values below this are clipped to it.

dot_max float (default: 1)

Normalized values above this are clipped to it.

smallest_dot float (default: 0)

The dot area mapped to dot_min.

largest_dot float (default: 200)

The dot area mapped to dot_max.

size_exponent float (default: 1.5)

Exponent applied before rescaling to [smallest_dot, largest_dot].

Return type:

TypeVar(V, bound= ndarray[tuple[Any, ...], dtype[floating]] | dim)

Returns:

Transformed vector or dim expression to pass as .opts(s=...).