elisa.plot.scale#

class LinLogTransform(base: float, lin_thresh: float, lin_scale: float)[source]#

Bases: Transform

Attributes

depth

Return the number of transforms which have been chained together to form this Transform instance.

Methods

contains_branch(other)

Return whether the given transform is a sub-tree of this transform.

contains_branch_seperately(other_transform)

Return whether the given branch is a sub-tree of this transform on each separate dimension.

frozen()

Return a frozen copy of this transform node.

get_affine()

Get the affine part of this transform.

get_matrix()

Get the matrix for the affine part of this transform.

invalidate()

Invalidate this TransformNode and triggers an invalidation of its ancestors.

inverted()

Return the corresponding inverse transformation.

set_children(*children)

Set the children of the transform, to let the invalidation system know which transforms can invalidate this transform.

transform(values)

Apply this transformation on the given array of values.

transform_affine(values)

Apply only the affine part of this transformation on the given array of values.

transform_angles(angles, pts[, radians, pushoff])

Transform a set of angles anchored at specific locations.

transform_bbox(bbox)

Transform the given bounding box.

transform_non_affine(values)

Apply only the non-affine part of this transformation.

transform_path(path)

Apply the transform to .Path path, returning a new .Path.

transform_path_affine(path)

Apply the affine part of this transform to .Path path, returning a new .Path.

transform_path_non_affine(path)

Apply the non-affine part of this transform to .Path path, returning a new .Path.

transform_point(point)

Return a transformed point.

input_dims = 1#

The number of input dimensions of this transform. Must be overridden (with integers) in the subclass.

output_dims = 1#

The number of output dimensions of this transform. Must be overridden (with integers) in the subclass.

transform_non_affine(values: ndarray)[source]#

Apply only the non-affine part of this transformation.

transform(values) is always equivalent to transform_affine(transform_non_affine(values)).

In non-affine transformations, this is generally equivalent to transform(values). In affine transformations, this is always a no-op.

Parameters:

values (ndarray) – The input values as an array of length input_dims or shape (N, input_dims).

Returns:

The output values as an array of length output_dims or shape (N, output_dims), depending on the input.

inverted()[source]#

Return the corresponding inverse transformation.

It holds x == self.inverted().transform(self.transform(x)).

The return value of this method should be treated as temporary. An update to self does not cause a corresponding update to its inverted copy.

has_inverse = True#

True if this transform has a corresponding inverse transform.

is_separable = True#

True if this transform is separable in the x- and y- dimensions.

class InvertedLinLogTransform(base: float, lin_thresh: float, lin_scale: float)[source]#

Bases: Transform

Attributes

depth

Return the number of transforms which have been chained together to form this Transform instance.

Methods

contains_branch(other)

Return whether the given transform is a sub-tree of this transform.

contains_branch_seperately(other_transform)

Return whether the given branch is a sub-tree of this transform on each separate dimension.

frozen()

Return a frozen copy of this transform node.

get_affine()

Get the affine part of this transform.

get_matrix()

Get the matrix for the affine part of this transform.

invalidate()

Invalidate this TransformNode and triggers an invalidation of its ancestors.

inverted()

Return the corresponding inverse transformation.

set_children(*children)

Set the children of the transform, to let the invalidation system know which transforms can invalidate this transform.

transform(values)

Apply this transformation on the given array of values.

transform_affine(values)

Apply only the affine part of this transformation on the given array of values.

transform_angles(angles, pts[, radians, pushoff])

Transform a set of angles anchored at specific locations.

transform_bbox(bbox)

Transform the given bounding box.

transform_non_affine(values)

Apply only the non-affine part of this transformation.

transform_path(path)

Apply the transform to .Path path, returning a new .Path.

transform_path_affine(path)

Apply the affine part of this transform to .Path path, returning a new .Path.

transform_path_non_affine(path)

Apply the non-affine part of this transform to .Path path, returning a new .Path.

transform_point(point)

Return a transformed point.

input_dims = 1#

The number of input dimensions of this transform. Must be overridden (with integers) in the subclass.

output_dims = 1#

The number of output dimensions of this transform. Must be overridden (with integers) in the subclass.

transform_non_affine(values: ndarray)[source]#

Apply only the non-affine part of this transformation.

transform(values) is always equivalent to transform_affine(transform_non_affine(values)).

In non-affine transformations, this is generally equivalent to transform(values). In affine transformations, this is always a no-op.

Parameters:

values (ndarray) – The input values as an array of length input_dims or shape (N, input_dims).

Returns:

The output values as an array of length output_dims or shape (N, output_dims), depending on the input.

inverted()[source]#

Return the corresponding inverse transformation.

It holds x == self.inverted().transform(self.transform(x)).

The return value of this method should be treated as temporary. An update to self does not cause a corresponding update to its inverted copy.

has_inverse = True#

True if this transform has a corresponding inverse transform.

is_separable = True#

True if this transform is separable in the x- and y- dimensions.

class LinLogLocator(lin_thresh: float, lin_scale: float, base: float = 10.0, subs=(1.0,), numticks=None, is_minor: bool = False)[source]#

Bases: Locator

Determine the tick locations for LinLogScale axes.

Attributes

axis

Methods

__call__()

Return the locations of the ticks.

nonsingular(v0, v1)

Adjust a range as needed to avoid singularities.

raise_if_exceeds(locs)

Log at WARNING level if locs is longer than Locator.MAXTICKS.

set_params([base, subs, numticks])

Set parameters for log locator.

tick_values(vmin, vmax)

Return the values of the located ticks given vmin and vmax.

view_limits(vmin, vmax)

Try to choose the view limits intelligently.

create_dummy_axis

set_axis

transform_non_affine

set_axis(axis: Axis)[source]#
create_dummy_axis(**kwargs)[source]#
set_params(base=None, subs=None, numticks=None)[source]#

Set parameters for log locator.

tick_values(vmin: float, vmax: float)[source]#

Return the values of the located ticks given vmin and vmax.

Note

To get tick locations with the vmin and vmax values defined automatically for the associated axis simply call the Locator instance:

>>> print(type(loc))
<type 'Locator'>
>>> print(loc())
[1, 2, 3, 4]
view_limits(vmin, vmax)[source]#

Try to choose the view limits intelligently.

transform_non_affine(values: ndarray) ndarray[source]#
class LinLogScale(axis, *, base: float = 10.0, lin_thresh: float = 1.0, lin_scale=None, subs=None)[source]#

Bases: ScaleBase

The linear-logarithmic scale is logarithmic above positive lin_thresh and linear otherwise.

Parameters:
  • base (float) – The base of the logarithm.

  • lin_thresh (float) – Defines the range (lin_thresh, +inf), within which the plot is logarithmic.

  • lin_scale (float, optional) – This allows the linear range (-inf, lin_thresh) to be stretched relative to the logarithmic range. Its value is the number of decades to use for the linear range. For example, when lin_scale == 1.0, the space used for [0, lin_thresh] range will be equal to one decade in the logarithmic range.

  • subs (sequence of int) – Where to place the subticks between each major tick. For example, in a log10 scale: [2, 3, 4, 5, 6, 7, 8, 9] will place 8 logarithmically spaced minor ticks between each major tick.

Attributes

base

lin_scale

lin_thresh

Methods

get_transform()

Return the .LinLogTransform associated with this scale.

limit_range_for_scale(vmin, vmax, minpos)

Return the range vmin, vmax, restricted to the domain supported by this scale (if any).

set_default_locators_and_formatters(axis)

Set the locators and formatters of axis to instances suitable for this scale.

name = 'linlog'#
property base#
property lin_thresh#
property lin_scale#
set_default_locators_and_formatters(axis)[source]#

Set the locators and formatters of axis to instances suitable for this scale.

get_transform()[source]#

Return the .LinLogTransform associated with this scale.

get_scale(base: float, thresh: float, vmin: float, vmax: float, f: float) float[source]#

Get scale of .LinLogScale so that linear part takes up f of axis.