matplotlib 3.5.1

ParametersReturnsBackRef
pts_to_prestep(x, *args)

Given a set of N points, convert to 2N - 1 points, which when connected linearly give a step function which changes values at the beginning of the intervals.

Parameters

x : array

The x location of the steps. May be empty.

y1, ..., yp : array

y arrays to be turned into steps; all must be the same length as x .

Returns

array

The x and y values converted to steps in the same order as the input; can be unpacked as x_out, y1_out, ..., yp_out . If the input is length N , each of these arrays will be length 2N + 1 . For N=0 , the length will be 0.

Convert continuous line to pre-steps.

Examples

This example is valid syntax, but raise an exception at execution
>>> x_s, y1_s, y2_s = pts_to_prestep(x, y1, y2)
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

matplotlib.cbook.pts_to_prestep

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /matplotlib/cbook/__init__.py#1507
type: <class 'function'>
Commit: