plot.points¶
The lines of a curve over the points of the dimensions of a scan.
A curve names the dimensions of its data it draws one line per point of
(over); after broadcasting by name its data must leave at most one more
dimension, the axis a line is drawn along: the time of a timecourse, the
points of a ragged result, the rows of a dataset or the dimension of the
values a scan sets (a value per simulation over a dimension). The lines are in
the order of the labels of the over dimensions, the last one fastest. Their
colours follow the first over dimension, their line styles the second; a
legend entry names its point by the value and unit of the target its
dimension changes, else by its label. Everything of a point is found by its
label in the dimension, so a curve of selected points (Data(sel=...)) names
and colours the points it draws. The colour of a point is the colour map at its
value, through the norm of the colour bar (logarithmic for positive values
spanning more than a factor of LOG_RATIO); a dimension which does not change
one target is coloured by position, with the labels on a discrete colour bar. A
band reduces a dimension of draws to two quantiles and the median, computed
when the figure is drawn; it needs a common grid of times, and its legend
entry is its area, <name> (<low>-<high> %).
Line
dataclass
¶
One line of a curve, see curve_lines.
Attributes:
| Name | Type | Description |
|---|---|---|
point |
tuple[Any, ...]
|
the label of every |
index |
tuple[int, ...]
|
the position of the point along every |
x |
Any
|
the x values along the axis, without the padding. |
y |
Any
|
the y values. |
xerr |
Any
|
the x errors, |
yerr |
Any
|
the y errors, |
BandLine
dataclass
¶
One band, see band_lines.
Attributes:
| Name | Type | Description |
|---|---|---|
point |
tuple[Any, ...]
|
the label of every |
index |
tuple[int, ...]
|
the position of the point along every |
x |
Any
|
the x values along the axis. |
low |
Any
|
the lower quantile. |
median |
Any
|
the median. |
high |
Any
|
the upper quantile. |
PointStyle
dataclass
¶
How the lines of a curve over scan points look, see point_styles.
Attributes:
| Name | Type | Description |
|---|---|---|
colors |
list[str]
|
the colour of every point of the first dimension. |
linestyles |
list[str] | None
|
the line style of every point of the second, |
labels |
list[list[str]]
|
the legend label of every point of every dimension. |
colorbar |
bool
|
whether the first dimension gets a colour bar. |
values |
ndarray
|
the values of the points of the first dimension, their positions without a single target. |
title |
str
|
the label of the colour bar, |
norm |
Normalize
|
the norm of the colours and the colour bar: linear or logarithmic over the values, a boundary per point over the positions. |
colormap |
Colormap
|
the colour map the norm maps onto. |
ticks |
list[str] | None
|
the tick labels of a discrete colour bar (the labels of the
points), |
middle
property
¶
Get the colour of the middle of the colour map, of the legend entry of a curve.
curve_lines
¶
Split the data of a curve into one line per point of its over dimensions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sid
|
str
|
the id of the curve, for the errors. |
required |
over
|
Sequence[str]
|
the dimensions with a line per point, in the order of the lines. |
required |
x
|
DataArray
|
the x data. |
required |
y
|
DataArray
|
the y data. |
required |
xerr
|
DataArray | None
|
the x errors, |
None
|
yerr
|
DataArray | None
|
the y errors, |
None
|
Returns:
| Type | Description |
|---|---|
list[Line]
|
The lines, without the padding of a ragged result. |
Raises:
| Type | Description |
|---|---|
ValueError
|
if two arrays have different coordinates of a dimension, an
|
band_label
¶
Get the legend label of a band, its name and its quantiles in percent.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str | None
|
the name of the band, of a point of it with |
required |
quantiles
|
tuple[float, float]
|
the lower and the upper quantile. |
required |
Returns:
| Type | Description |
|---|---|
str
|
|
str
|
without a name. |
band_lines
¶
Reduce the dimension across of the data of a band to quantiles and the median.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sid
|
str
|
the id of the band, for the errors. |
required |
over
|
Sequence[str]
|
the dimensions with a band per point. |
required |
across
|
str
|
the dimension of the draws, which is reduced. |
required |
quantiles
|
tuple[float, float]
|
the lower and the upper quantile, in |
required |
x
|
DataArray
|
the x data. |
required |
y
|
DataArray
|
the y data. |
required |
Returns:
| Type | Description |
|---|---|
list[BandLine]
|
One band per point of |
Raises:
| Type | Description |
|---|---|
ValueError
|
if the data is ragged, has not the dimension |
point_colors
¶
Get the colours of the points of a dimension.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n
|
int
|
the number of points. |
required |
color
|
str | None
|
the colour of the style of the curve, |
required |
Returns:
| Type | Description |
|---|---|
list[str]
|
Shades of the colour from light to the colour itself, or colours of the |
list[str]
|
colour map |
point_colormap
¶
Get the colour map of the colour bar of a dimension, see point_colors.
cycle_color
¶
Get the colour of the colour cycle of matplotlib at a position, as a hex string.
It is the colour of a band without a colour, by its position among the bands of its plot, in both backends.
point_linestyles
¶
Get the line styles of the points of a second over dimension.
Raises:
| Type | Description |
|---|---|
ValueError
|
for more than |
point_values
¶
Get the target, the values and the unit of a dimension which changes one target.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dimension
|
Dimension | None
|
the dimension of the scan, |
required |
units
|
Mapping[str, str]
|
the units of the symbols of the model, for values without a unit. |
required |
labels
|
Sequence[Any] | None
|
the labels of the points, in their order, every point of the dimension by default; a point is found by its label. |
None
|
Returns:
| Type | Description |
|---|---|
tuple[str, ndarray, str] | None
|
The target, the values of the points and their unit, |
tuple[str, ndarray, str] | None
|
dimension which changes no or several targets or has not every label. |
point_labels
¶
Get the legend label of every point of a dimension.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dim
|
str
|
the id of the dimension. |
required |
labels
|
Sequence[Any]
|
the labels of the points, in their order. |
required |
dimension
|
Dimension | None
|
the dimension of the scan, |
required |
units
|
Mapping[str, str]
|
the units of the symbols of the model, see |
required |
Returns:
| Type | Description |
|---|---|
list[str]
|
|
list[str]
|
else |
point_norm
¶
Get the norm which maps the values of the points of a dimension onto a colour map.
Returns:
| Type | Description |
|---|---|
Normalize | None
|
A logarithmic norm when all values are positive and the largest is |
Normalize | None
|
more than |
Normalize | None
|
smallest to the largest value; |
Normalize | None
|
range (a single value, equal values or a value which is not finite). |
format_value
¶
Format a value of a dimension: six significant digits, a short exponent.
label_text
¶
Get the text of a label of a dimension, a float formatted as a value.
tick_positions
¶
Get the positions of the points of a discrete colour bar which get a tick.
Every point up to MAX_TICKS points, else every k-th from the first.
point_styles
¶
Get the colours, line styles, labels and colour bar of the lines of a curve.
The points are the ones the lines draw, i.e. the labels left after the
sel of the data, each found by its label in its dimension.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
lines
|
Sequence[Line | BandLine]
|
the lines of the curve or band. |
required |
over
|
Sequence[str]
|
the ids of the dimensions it is drawn over. |
required |
color
|
str | None
|
the colour of the style of the curve, |
required |
dimensions
|
Sequence[Dimension | None]
|
the dimension of the scan of every one of |
required |
units
|
Mapping[str, str]
|
the units of the symbols of the model, see |
required |
Returns:
| Type | Description |
|---|---|
PointStyle
|
The style shared by the serializers. |
Raises:
| Type | Description |
|---|---|
ValueError
|
for more points of a second dimension than line styles. |