set_markevery(self, every)
e.g., if every=5
, every 5-th marker will be plotted.
Setting markevery will still only draw markers at actual data points. While the float argument form aims for uniform visual spacing, it has to coerce from the ideal spacing to the nearest available data point. Depending on the number and distribution of data points, the result may still not look evenly spaced.
When using a start offset to specify the first marker, the offset will be from the first data point which may be different from the first the visible data point if the plot is zoomed in.
If zooming in on a plot when using float arguments then the actual data points that have markers will change because the distance between markers is always determined from the display-coordinates axes-bounding-box-diagonal regardless of the actual axes data limits.
Which markers to plot.
every=None
: every point will be plotted.
every=N
: every N-th marker will be plotted starting with marker 0.
every=(start, N)
: every N-th marker, starting at index start, will be plotted.
every=slice(start, end, N)
: every N-th marker, starting at index start, up to but not including index end, will be plotted.
every=[i, j, m, ...]
: only markers at the given indices will be plotted.
every=[True, False, True, ...]
: only positions that are True will be plotted. The list must have the same length as the data points.
every=0.1
, (i.e. a float): markers will be spaced at approximately equal visual distances along the line; the distance along the line between markers is determined by multiplying the display-coordinate distance of the axes bounding-box diagonal by the value of every.
every=(0.5, 0.1)
(i.e. a length-2 tuple of float): similar to every=0.1
but the first marker will be offset along the line by 0.5 multiplied by the display-coordinate-diagonal-distance along the line.
For examples see /gallery/lines_bars_and_markers/markevery_demo
.
Set the markevery property to subsample the plot when using markers.
The following pages refer to to this document either explicitly or contain code examples using this.
matplotlib.lines.Line2D.get_markevery
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