doc_content
stringlengths 1
386k
| doc_id
stringlengths 5
188
|
---|---|
recache_always()[source]
|
matplotlib._as_gen.matplotlib.lines.line2d#matplotlib.lines.Line2D.recache_always
|
set(*, agg_filter=<UNSET>, alpha=<UNSET>, animated=<UNSET>, antialiased=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, color=<UNSET>, dash_capstyle=<UNSET>, dash_joinstyle=<UNSET>, dashes=<UNSET>, data=<UNSET>, drawstyle=<UNSET>, fillstyle=<UNSET>, gid=<UNSET>, in_layout=<UNSET>, label=<UNSET>, linestyle=<UNSET>, linewidth=<UNSET>, marker=<UNSET>, markeredgecolor=<UNSET>, markeredgewidth=<UNSET>, markerfacecolor=<UNSET>, markerfacecoloralt=<UNSET>, markersize=<UNSET>, markevery=<UNSET>, path_effects=<UNSET>, picker=<UNSET>, pickradius=<UNSET>, rasterized=<UNSET>, sketch_params=<UNSET>, snap=<UNSET>, solid_capstyle=<UNSET>, solid_joinstyle=<UNSET>, transform=<UNSET>, url=<UNSET>, visible=<UNSET>, xdata=<UNSET>, ydata=<UNSET>, zorder=<UNSET>)[source]
Set multiple properties at once. Supported properties are
Property Description
agg_filter a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array
alpha scalar or None
animated bool
antialiased bool
clip_box Bbox
clip_on bool
clip_path Patch or (Path, Transform) or None
color color
dash_capstyle CapStyle or {'butt', 'projecting', 'round'}
dash_joinstyle JoinStyle or {'miter', 'round', 'bevel'}
dashes sequence of floats (on/off ink in points) or (None, None)
data (2, N) array or two 1D arrays
drawstyle {'default', 'steps', 'steps-pre', 'steps-mid', 'steps-post'}, default: 'default'
figure Figure
fillstyle {'full', 'left', 'right', 'bottom', 'top', 'none'}
gid str
in_layout bool
label object
linestyle {'-', '--', '-.', ':', '', (offset, on-off-seq), ...}
linewidth float
marker marker style string, Path or MarkerStyle
markeredgecolor color
markeredgewidth float
markerfacecolor color
markerfacecoloralt color
markersize float
markevery None or int or (int, int) or slice or list[int] or float or (float, float) or list[bool]
path_effects AbstractPathEffect
picker float or callable[[Artist, Event], tuple[bool, dict]]
pickradius float
rasterized bool
sketch_params (scale: float, length: float, randomness: float)
snap bool or None
solid_capstyle CapStyle or {'butt', 'projecting', 'round'}
solid_joinstyle JoinStyle or {'miter', 'round', 'bevel'}
transform unknown
url str
visible bool
xdata 1D array
ydata 1D array
zorder float
|
matplotlib._as_gen.matplotlib.lines.line2d#matplotlib.lines.Line2D.set
|
set_aa(b)[source]
Alias for set_antialiased.
|
matplotlib._as_gen.matplotlib.lines.line2d#matplotlib.lines.Line2D.set_aa
|
set_antialiased(b)[source]
Set whether to use antialiased rendering. Parameters
bbool
|
matplotlib._as_gen.matplotlib.lines.line2d#matplotlib.lines.Line2D.set_antialiased
|
set_c(color)[source]
Alias for set_color.
|
matplotlib._as_gen.matplotlib.lines.line2d#matplotlib.lines.Line2D.set_c
|
set_color(color)[source]
Set the color of the line. Parameters
colorcolor
|
matplotlib._as_gen.matplotlib.lines.line2d#matplotlib.lines.Line2D.set_color
|
set_dash_capstyle(s)[source]
How to draw the end caps if the line is is_dashed. Parameters
sCapStyle or {'butt', 'projecting', 'round'}
|
matplotlib._as_gen.matplotlib.lines.line2d#matplotlib.lines.Line2D.set_dash_capstyle
|
set_dash_joinstyle(s)[source]
How to join segments of the line if it is_dashed. Parameters
sJoinStyle or {'miter', 'round', 'bevel'}
|
matplotlib._as_gen.matplotlib.lines.line2d#matplotlib.lines.Line2D.set_dash_joinstyle
|
set_dashes(seq)[source]
Set the dash sequence. The dash sequence is a sequence of floats of even length describing the length of dashes and spaces in points. For example, (5, 2, 1, 2) describes a sequence of 5 point and 1 point dashes separated by 2 point spaces. Parameters
seqsequence of floats (on/off ink in points) or (None, None)
If seq is empty or (None, None), the linestyle will be set to solid.
|
matplotlib._as_gen.matplotlib.lines.line2d#matplotlib.lines.Line2D.set_dashes
|
set_data(*args)[source]
Set the x and y data. Parameters
*args(2, N) array or two 1D arrays
|
matplotlib._as_gen.matplotlib.lines.line2d#matplotlib.lines.Line2D.set_data
|
set_drawstyle(drawstyle)[source]
Set the drawstyle of the plot. The drawstyle determines how the points are connected. Parameters
drawstyle{'default', 'steps', 'steps-pre', 'steps-mid', 'steps-post'}, default: 'default'
For 'default', the points are connected with straight lines. The steps variants connect the points with step-like lines, i.e. horizontal lines with vertical steps. They differ in the location of the step: 'steps-pre': The step is at the beginning of the line segment, i.e. the line will be at the y-value of point to the right. 'steps-mid': The step is halfway between the points. 'steps-post: The step is at the end of the line segment, i.e. the line will be at the y-value of the point to the left. 'steps' is equal to 'steps-pre' and is maintained for backward-compatibility. For examples see Step Demo.
|
matplotlib._as_gen.matplotlib.lines.line2d#matplotlib.lines.Line2D.set_drawstyle
|
set_ds(drawstyle)[source]
Alias for set_drawstyle.
|
matplotlib._as_gen.matplotlib.lines.line2d#matplotlib.lines.Line2D.set_ds
|
set_fillstyle(fs)[source]
Set the marker fill style. Parameters
fs{'full', 'left', 'right', 'bottom', 'top', 'none'}
Possible values: 'full': Fill the whole marker with the markerfacecolor. 'left', 'right', 'bottom', 'top': Fill the marker half at the given side with the markerfacecolor. The other half of the marker is filled with markerfacecoloralt. 'none': No filling. For examples see Marker fill styles.
|
matplotlib._as_gen.matplotlib.lines.line2d#matplotlib.lines.Line2D.set_fillstyle
|
set_linestyle(ls)[source]
Set the linestyle of the line. Parameters
ls{'-', '--', '-.', ':', '', (offset, on-off-seq), ...}
Possible values:
A string:
linestyle description
'-' or 'solid' solid line
'--' or 'dashed' dashed line
'-.' or 'dashdot' dash-dotted line
':' or 'dotted' dotted line
'none', 'None', ' ', or '' draw nothing
Alternatively a dash tuple of the following form can be provided: (offset, onoffseq)
where onoffseq is an even length tuple of on and off ink in points. See also set_dashes(). For examples see Linestyles.
|
matplotlib._as_gen.matplotlib.lines.line2d#matplotlib.lines.Line2D.set_linestyle
|
set_linewidth(w)[source]
Set the line width in points. Parameters
wfloat
Line width, in points.
|
matplotlib._as_gen.matplotlib.lines.line2d#matplotlib.lines.Line2D.set_linewidth
|
set_ls(ls)[source]
Alias for set_linestyle.
|
matplotlib._as_gen.matplotlib.lines.line2d#matplotlib.lines.Line2D.set_ls
|
set_lw(w)[source]
Alias for set_linewidth.
|
matplotlib._as_gen.matplotlib.lines.line2d#matplotlib.lines.Line2D.set_lw
|
set_marker(marker)[source]
Set the line marker. Parameters
markermarker style string, Path or MarkerStyle
See markers for full description of possible arguments.
|
matplotlib._as_gen.matplotlib.lines.line2d#matplotlib.lines.Line2D.set_marker
|
set_markeredgecolor(ec)[source]
Set the marker edge color. Parameters
eccolor
|
matplotlib._as_gen.matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markeredgecolor
|
set_markeredgewidth(ew)[source]
Set the marker edge width in points. Parameters
ewfloat
Marker edge width, in points.
|
matplotlib._as_gen.matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markeredgewidth
|
set_markerfacecolor(fc)[source]
Set the marker face color. Parameters
fccolor
|
matplotlib._as_gen.matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markerfacecolor
|
set_markerfacecoloralt(fc)[source]
Set the alternate marker face color. Parameters
fccolor
|
matplotlib._as_gen.matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markerfacecoloralt
|
set_markersize(sz)[source]
Set the marker size in points. Parameters
szfloat
Marker size, in points.
|
matplotlib._as_gen.matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markersize
|
set_markevery(every)[source]
Set the markevery property to subsample the plot when using markers. e.g., if every=5, every 5-th marker will be plotted. Parameters
everyNone or int or (int, int) or slice or list[int] or float or (float, float) or list[bool]
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 Markevery Demo. Notes 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.
|
matplotlib._as_gen.matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markevery
|
set_mec(ec)[source]
Alias for set_markeredgecolor.
|
matplotlib._as_gen.matplotlib.lines.line2d#matplotlib.lines.Line2D.set_mec
|
set_mew(ew)[source]
Alias for set_markeredgewidth.
|
matplotlib._as_gen.matplotlib.lines.line2d#matplotlib.lines.Line2D.set_mew
|
set_mfc(fc)[source]
Alias for set_markerfacecolor.
|
matplotlib._as_gen.matplotlib.lines.line2d#matplotlib.lines.Line2D.set_mfc
|
set_mfcalt(fc)[source]
Alias for set_markerfacecoloralt.
|
matplotlib._as_gen.matplotlib.lines.line2d#matplotlib.lines.Line2D.set_mfcalt
|
set_ms(sz)[source]
Alias for set_markersize.
|
matplotlib._as_gen.matplotlib.lines.line2d#matplotlib.lines.Line2D.set_ms
|
set_picker(p)[source]
Set the event picker details for the line. Parameters
pfloat or callable[[Artist, Event], tuple[bool, dict]]
If a float, it is used as the pick radius in points.
|
matplotlib._as_gen.matplotlib.lines.line2d#matplotlib.lines.Line2D.set_picker
|
set_pickradius(d)[source]
Set the pick radius used for containment tests. See contains for more details. Parameters
dfloat
Pick radius, in points.
|
matplotlib._as_gen.matplotlib.lines.line2d#matplotlib.lines.Line2D.set_pickradius
|
set_solid_capstyle(s)[source]
How to draw the end caps if the line is solid (not is_dashed) Parameters
sCapStyle or {'butt', 'projecting', 'round'}
|
matplotlib._as_gen.matplotlib.lines.line2d#matplotlib.lines.Line2D.set_solid_capstyle
|
set_solid_joinstyle(s)[source]
How to join segments if the line is solid (not is_dashed). Parameters
sJoinStyle or {'miter', 'round', 'bevel'}
|
matplotlib._as_gen.matplotlib.lines.line2d#matplotlib.lines.Line2D.set_solid_joinstyle
|
set_transform(t)[source]
Set the artist transform. Parameters
tTransform
|
matplotlib._as_gen.matplotlib.lines.line2d#matplotlib.lines.Line2D.set_transform
|
set_xdata(x)[source]
Set the data array for x. Parameters
x1D array
|
matplotlib._as_gen.matplotlib.lines.line2d#matplotlib.lines.Line2D.set_xdata
|
set_ydata(y)[source]
Set the data array for y. Parameters
y1D array
|
matplotlib._as_gen.matplotlib.lines.line2d#matplotlib.lines.Line2D.set_ydata
|
update_from(other)[source]
Copy properties from other to self.
|
matplotlib._as_gen.matplotlib.lines.line2d#matplotlib.lines.Line2D.update_from
|
validCap=('butt', 'projecting', 'round')
|
matplotlib._as_gen.matplotlib.lines.line2d#matplotlib.lines.Line2D.validCap
|
validJoin=('miter', 'round', 'bevel')
|
matplotlib._as_gen.matplotlib.lines.line2d#matplotlib.lines.Line2D.validJoin
|
zorder=2
|
matplotlib._as_gen.matplotlib.lines.line2d#matplotlib.lines.Line2D.zorder
|
matplotlib.lines.segment_hits matplotlib.lines.segment_hits(cx, cy, x, y, radius)[source]
Return the indices of the segments in the polyline with coordinates (cx, cy) that are within a distance radius of the point (x, y).
|
matplotlib._as_gen.matplotlib.lines.segment_hits
|
matplotlib.lines.VertexSelector classmatplotlib.lines.VertexSelector(line)[source]
Bases: object Manage the callbacks to maintain a list of selected vertices for Line2D. Derived classes should override the process_selected method to do something with the picks. Here is an example which highlights the selected verts with red circles: import numpy as np
import matplotlib.pyplot as plt
import matplotlib.lines as lines
class HighlightSelected(lines.VertexSelector):
def __init__(self, line, fmt='ro', **kwargs):
lines.VertexSelector.__init__(self, line)
self.markers, = self.axes.plot([], [], fmt, **kwargs)
def process_selected(self, ind, xs, ys):
self.markers.set_data(xs, ys)
self.canvas.draw()
fig, ax = plt.subplots()
x, y = np.random.rand(2, 30)
line, = ax.plot(x, y, 'bs-', picker=5)
selector = HighlightSelected(line)
plt.show()
Initialize the class with a Line2D. The line should already be added to an Axes and should have the picker property set. onpick(event)[source]
When the line is picked, update the set of selected indices.
process_selected(ind, xs, ys)[source]
Default "do nothing" implementation of the process_selected method. Parameters
indlist of int
The indices of the selected vertices.
xs, ysarray-like
The coordinates of the selected vertices.
|
matplotlib._as_gen.matplotlib.lines.vertexselector
|
onpick(event)[source]
When the line is picked, update the set of selected indices.
|
matplotlib._as_gen.matplotlib.lines.vertexselector#matplotlib.lines.VertexSelector.onpick
|
process_selected(ind, xs, ys)[source]
Default "do nothing" implementation of the process_selected method. Parameters
indlist of int
The indices of the selected vertices.
xs, ysarray-like
The coordinates of the selected vertices.
|
matplotlib._as_gen.matplotlib.lines.vertexselector#matplotlib.lines.VertexSelector.process_selected
|
matplotlib.markers Functions to handle markers; used by the marker functionality of plot, scatter, and errorbar. All possible markers are defined here:
marker symbol description
"." point
"," pixel
"o" circle
"v" triangle_down
"^" triangle_up
"<" triangle_left
">" triangle_right
"1" tri_down
"2" tri_up
"3" tri_left
"4" tri_right
"8" octagon
"s" square
"p" pentagon
"P" plus (filled)
"*" star
"h" hexagon1
"H" hexagon2
"+" plus
"x" x
"X" x (filled)
"D" diamond
"d" thin_diamond
"|" vline
"_" hline
0 (TICKLEFT) tickleft
1 (TICKRIGHT) tickright
2 (TICKUP) tickup
3 (TICKDOWN) tickdown
4 (CARETLEFT) caretleft
5 (CARETRIGHT) caretright
6 (CARETUP) caretup
7 (CARETDOWN) caretdown
8 (CARETLEFTBASE) caretleft (centered at base)
9 (CARETRIGHTBASE) caretright (centered at base)
10 (CARETUPBASE) caretup (centered at base)
11 (CARETDOWNBASE) caretdown (centered at base)
"None", " " or "" nothing
'$...$' Render the string using mathtext. E.g "$f$" for marker showing the letter f.
verts A list of (x, y) pairs used for Path vertices. The center of the marker is located at (0, 0) and the size is normalized, such that the created path is encapsulated inside the unit cell.
path A Path instance.
(numsides, 0, angle) A regular polygon with numsides sides, rotated by angle.
(numsides, 1, angle) A star-like symbol with numsides sides, rotated by angle.
(numsides, 2, angle) An asterisk with numsides sides, rotated by angle. None is the default which means 'nothing', however this table is referred to from other docs for the valid inputs from marker inputs and in those cases None still means 'default'. Note that special symbols can be defined via the STIX math font, e.g. "$\u266B$". For an overview over the STIX font symbols refer to the STIX font table. Also see the STIX Fonts. Integer numbers from 0 to 11 create lines and triangles. Those are equally accessible via capitalized variables, like CARETDOWNBASE. Hence the following are equivalent: plt.plot([1, 2, 3], marker=11)
plt.plot([1, 2, 3], marker=matplotlib.markers.CARETDOWNBASE)
Examples showing the use of markers: Marker reference Marker examples Classes
MarkerStyle([marker, fillstyle]) A class representing marker types.
|
matplotlib.markers_api
|
matplotlib.markers.MarkerStyle classmatplotlib.markers.MarkerStyle(marker=None, fillstyle=None)[source]
Bases: object A class representing marker types. Instances are immutable. If you need to change anything, create a new instance. Attributes
markerslist
All known markers.
filled_markerslist
All known filled markers. This is a subset of markers.
fillstyleslist
The supported fillstyles. Parameters
markerstr, array-like, Path, MarkerStyle, or None, default: None
Another instance of MarkerStyle copies the details of that marker.
None means no marker. For other possible marker values see the module docstring matplotlib.markers.
fillstylestr, default: rcParams["markers.fillstyle"] (default: 'full')
One of 'full', 'left', 'right', 'bottom', 'top', 'none'. filled_markers=('o', 'v', '^', '<', '>', '8', 's', 'p', '*', 'h', 'H', 'D', 'd', 'P', 'X')
fillstyles=('full', 'left', 'right', 'bottom', 'top', 'none')
get_alt_path()[source]
Return a Path for the alternate part of the marker. For unfilled markers, this is None; for filled markers, this is the area to be drawn with markerfacecoloralt.
get_alt_transform()[source]
Return the transform to be applied to the Path from MarkerStyle.get_alt_path().
get_capstyle()[source]
get_fillstyle()[source]
get_joinstyle()[source]
get_marker()[source]
get_path()[source]
Return a Path for the primary part of the marker. For unfilled markers this is the whole marker, for filled markers, this is the area to be drawn with markerfacecolor.
get_snap_threshold()[source]
get_transform()[source]
Return the transform to be applied to the Path from MarkerStyle.get_path().
is_filled()[source]
markers={'.': 'point', ',': 'pixel', 'o': 'circle', 'v': 'triangle_down', '^': 'triangle_up', '<': 'triangle_left', '>': 'triangle_right', '1': 'tri_down', '2': 'tri_up', '3': 'tri_left', '4': 'tri_right', '8': 'octagon', 's': 'square', 'p': 'pentagon', '*': 'star', 'h': 'hexagon1', 'H': 'hexagon2', '+': 'plus', 'x': 'x', 'D': 'diamond', 'd': 'thin_diamond', '|': 'vline', '_': 'hline', 'P': 'plus_filled', 'X': 'x_filled', 0: 'tickleft', 1: 'tickright', 2: 'tickup', 3: 'tickdown', 4: 'caretleft', 5: 'caretright', 6: 'caretup', 7: 'caretdown', 8: 'caretleftbase', 9: 'caretrightbase', 10: 'caretupbase', 11: 'caretdownbase', 'None': 'nothing', None: 'nothing', ' ': 'nothing', '': 'nothing'}
set_fillstyle(fillstyle)[source]
[Deprecated] Notes Deprecated since version 3.4:
set_marker(marker)[source]
[Deprecated] Notes Deprecated since version 3.4:
|
matplotlib._as_gen.matplotlib.markers.markerstyle
|
filled_markers=('o', 'v', '^', '<', '>', '8', 's', 'p', '*', 'h', 'H', 'D', 'd', 'P', 'X')
|
matplotlib._as_gen.matplotlib.markers.markerstyle#matplotlib.markers.MarkerStyle.filled_markers
|
fillstyles=('full', 'left', 'right', 'bottom', 'top', 'none')
|
matplotlib._as_gen.matplotlib.markers.markerstyle#matplotlib.markers.MarkerStyle.fillstyles
|
get_alt_path()[source]
Return a Path for the alternate part of the marker. For unfilled markers, this is None; for filled markers, this is the area to be drawn with markerfacecoloralt.
|
matplotlib._as_gen.matplotlib.markers.markerstyle#matplotlib.markers.MarkerStyle.get_alt_path
|
get_alt_transform()[source]
Return the transform to be applied to the Path from MarkerStyle.get_alt_path().
|
matplotlib._as_gen.matplotlib.markers.markerstyle#matplotlib.markers.MarkerStyle.get_alt_transform
|
get_capstyle()[source]
|
matplotlib._as_gen.matplotlib.markers.markerstyle#matplotlib.markers.MarkerStyle.get_capstyle
|
get_fillstyle()[source]
|
matplotlib._as_gen.matplotlib.markers.markerstyle#matplotlib.markers.MarkerStyle.get_fillstyle
|
get_joinstyle()[source]
|
matplotlib._as_gen.matplotlib.markers.markerstyle#matplotlib.markers.MarkerStyle.get_joinstyle
|
get_marker()[source]
|
matplotlib._as_gen.matplotlib.markers.markerstyle#matplotlib.markers.MarkerStyle.get_marker
|
get_path()[source]
Return a Path for the primary part of the marker. For unfilled markers this is the whole marker, for filled markers, this is the area to be drawn with markerfacecolor.
|
matplotlib._as_gen.matplotlib.markers.markerstyle#matplotlib.markers.MarkerStyle.get_path
|
get_snap_threshold()[source]
|
matplotlib._as_gen.matplotlib.markers.markerstyle#matplotlib.markers.MarkerStyle.get_snap_threshold
|
get_transform()[source]
Return the transform to be applied to the Path from MarkerStyle.get_path().
|
matplotlib._as_gen.matplotlib.markers.markerstyle#matplotlib.markers.MarkerStyle.get_transform
|
is_filled()[source]
|
matplotlib._as_gen.matplotlib.markers.markerstyle#matplotlib.markers.MarkerStyle.is_filled
|
markers={'.': 'point', ',': 'pixel', 'o': 'circle', 'v': 'triangle_down', '^': 'triangle_up', '<': 'triangle_left', '>': 'triangle_right', '1': 'tri_down', '2': 'tri_up', '3': 'tri_left', '4': 'tri_right', '8': 'octagon', 's': 'square', 'p': 'pentagon', '*': 'star', 'h': 'hexagon1', 'H': 'hexagon2', '+': 'plus', 'x': 'x', 'D': 'diamond', 'd': 'thin_diamond', '|': 'vline', '_': 'hline', 'P': 'plus_filled', 'X': 'x_filled', 0: 'tickleft', 1: 'tickright', 2: 'tickup', 3: 'tickdown', 4: 'caretleft', 5: 'caretright', 6: 'caretup', 7: 'caretdown', 8: 'caretleftbase', 9: 'caretrightbase', 10: 'caretupbase', 11: 'caretdownbase', 'None': 'nothing', None: 'nothing', ' ': 'nothing', '': 'nothing'}
|
matplotlib._as_gen.matplotlib.markers.markerstyle#matplotlib.markers.MarkerStyle.markers
|
set_fillstyle(fillstyle)[source]
[Deprecated] Notes Deprecated since version 3.4:
|
matplotlib._as_gen.matplotlib.markers.markerstyle#matplotlib.markers.MarkerStyle.set_fillstyle
|
set_marker(marker)[source]
[Deprecated] Notes Deprecated since version 3.4:
|
matplotlib._as_gen.matplotlib.markers.markerstyle#matplotlib.markers.MarkerStyle.set_marker
|
matplotlib.mathtext A module for parsing a subset of the TeX math syntax and rendering it to a Matplotlib backend. For a tutorial of its usage, see Writing mathematical expressions. This document is primarily concerned with implementation details. The module uses pyparsing to parse the TeX expression. The Bakoma distribution of the TeX Computer Modern fonts, and STIX fonts are supported. There is experimental support for using arbitrary fonts, but results may vary without proper tweaking and metrics for those fonts. classmatplotlib.mathtext.MathTextParser(output)[source]
Bases: object Create a MathTextParser for the given backend output. get_depth(texstr, dpi=120, fontsize=14)[source]
[Deprecated] Get the depth of a mathtext string. Parameters
texstrstr
A valid mathtext string, e.g., r'IQ: $sigma_i=15$'.
dpifloat
The dots-per-inch setting used to render the text. Returns
int
Offset of the baseline from the bottom of the image, in pixels. Notes Deprecated since version 3.4.
parse(s, dpi=72, prop=None, *, _force_standard_ps_fonts=False)[source]
Parse the given math expression s at the given dpi. If prop is provided, it is a FontProperties object specifying the "default" font to use in the math expression, used for all non-math text. The results are cached, so multiple calls to parse with the same expression should be fast.
to_mask(texstr, dpi=120, fontsize=14)[source]
[Deprecated] Convert a mathtext string to a grayscale array and depth. Parameters
texstrstr
A valid mathtext string, e.g., r'IQ: $sigma_i=15$'.
dpifloat
The dots-per-inch setting used to render the text.
fontsizeint
The font size in points Returns
array2D uint8 alpha
Mask array of rasterized tex.
depthint
Offset of the baseline from the bottom of the image, in pixels. Notes Deprecated since version 3.4.
to_png(filename, texstr, color='black', dpi=120, fontsize=14)[source]
[Deprecated] Render a tex expression to a PNG file. Parameters
filename
A writable filename or fileobject.
texstrstr
A valid mathtext string, e.g., r'IQ: $sigma_i=15$'.
colorcolor
The text color.
dpifloat
The dots-per-inch setting used to render the text.
fontsizeint
The font size in points. Returns
int
Offset of the baseline from the bottom of the image, in pixels. Notes Deprecated since version 3.4.
to_rgba(texstr, color='black', dpi=120, fontsize=14)[source]
[Deprecated] Convert a mathtext string to an RGBA array and depth. Parameters
texstrstr
A valid mathtext string, e.g., r'IQ: $sigma_i=15$'.
colorcolor
The text color.
dpifloat
The dots-per-inch setting used to render the text.
fontsizeint
The font size in points. Returns
array(M, N, 4) array
RGBA color values of rasterized tex, colorized with color.
depthint
Offset of the baseline from the bottom of the image, in pixels. Notes Deprecated since version 3.4.
exceptionmatplotlib.mathtext.MathTextWarning[source]
Bases: Warning
classmatplotlib.mathtext.MathtextBackend[source]
Bases: object The base class for the mathtext backend-specific code. MathtextBackend subclasses interface between mathtext and specific Matplotlib graphics backends. Subclasses need to override the following: render_glyph() render_rect_filled() get_results() And optionally, if you need to use a FreeType hinting style: get_hinting_type() get_hinting_type()[source]
Get the FreeType hinting type to use with this particular backend.
get_results(box)[source]
Return a backend-specific tuple to return to the backend after all processing is done.
render_glyph(ox, oy, info)[source]
Draw a glyph described by info to the reference point (ox, oy).
render_rect_filled(x1, y1, x2, y2)[source]
Draw a filled black rectangle from (x1, y1) to (x2, y2).
set_canvas_size(w, h, d)[source]
Set the dimension of the drawing canvas.
classmatplotlib.mathtext.MathtextBackendAgg[source]
Bases: matplotlib.mathtext.MathtextBackend Render glyphs and rectangles to an FTImage buffer, which is later transferred to the Agg image by the Agg backend. get_hinting_type()[source]
Get the FreeType hinting type to use with this particular backend.
get_results(box, used_characters)[source]
Return a backend-specific tuple to return to the backend after all processing is done.
render_glyph(ox, oy, info)[source]
Draw a glyph described by info to the reference point (ox, oy).
render_rect_filled(x1, y1, x2, y2)[source]
Draw a filled black rectangle from (x1, y1) to (x2, y2).
set_canvas_size(w, h, d)[source]
Set the dimension of the drawing canvas.
classmatplotlib.mathtext.MathtextBackendBitmap[source]
Bases: matplotlib.mathtext.MathtextBackendAgg [Deprecated] Notes Deprecated since version 3.4: get_results(box, used_characters)[source]
Return a backend-specific tuple to return to the backend after all processing is done.
classmatplotlib.mathtext.MathtextBackendCairo[source]
Bases: matplotlib.mathtext.MathtextBackend [Deprecated] Store information to write a mathtext rendering to the Cairo backend. Notes Deprecated since version 3.4. get_results(box, used_characters)[source]
Return a backend-specific tuple to return to the backend after all processing is done.
render_glyph(ox, oy, info)[source]
Draw a glyph described by info to the reference point (ox, oy).
render_rect_filled(x1, y1, x2, y2)[source]
Draw a filled black rectangle from (x1, y1) to (x2, y2).
classmatplotlib.mathtext.MathtextBackendPath[source]
Bases: matplotlib.mathtext.MathtextBackend Store information to write a mathtext rendering to the text path machinery. get_results(box, used_characters)[source]
Return a backend-specific tuple to return to the backend after all processing is done.
render_glyph(ox, oy, info)[source]
Draw a glyph described by info to the reference point (ox, oy).
render_rect_filled(x1, y1, x2, y2)[source]
Draw a filled black rectangle from (x1, y1) to (x2, y2).
classmatplotlib.mathtext.MathtextBackendPdf[source]
Bases: matplotlib.mathtext.MathtextBackend [Deprecated] Store information to write a mathtext rendering to the PDF backend. Notes Deprecated since version 3.4. get_results(box, used_characters)[source]
Return a backend-specific tuple to return to the backend after all processing is done.
render_glyph(ox, oy, info)[source]
Draw a glyph described by info to the reference point (ox, oy).
render_rect_filled(x1, y1, x2, y2)[source]
Draw a filled black rectangle from (x1, y1) to (x2, y2).
classmatplotlib.mathtext.MathtextBackendPs[source]
Bases: matplotlib.mathtext.MathtextBackend [Deprecated] Store information to write a mathtext rendering to the PostScript backend. Notes Deprecated since version 3.4. get_results(box, used_characters)[source]
Return a backend-specific tuple to return to the backend after all processing is done.
render_glyph(ox, oy, info)[source]
Draw a glyph described by info to the reference point (ox, oy).
render_rect_filled(x1, y1, x2, y2)[source]
Draw a filled black rectangle from (x1, y1) to (x2, y2).
classmatplotlib.mathtext.MathtextBackendSvg[source]
Bases: matplotlib.mathtext.MathtextBackend [Deprecated] Store information to write a mathtext rendering to the SVG backend. Notes Deprecated since version 3.4. get_results(box, used_characters)[source]
Return a backend-specific tuple to return to the backend after all processing is done.
render_glyph(ox, oy, info)[source]
Draw a glyph described by info to the reference point (ox, oy).
render_rect_filled(x1, y1, x2, y2)[source]
Draw a filled black rectangle from (x1, y1) to (x2, y2).
matplotlib.mathtext.get_unicode_index(symbol, math=True)[source]
Return the integer index (from the Unicode table) of symbol. Parameters
symbolstr
A single unicode character, a TeX command (e.g. r'pi') or a Type1 symbol name (e.g. 'phi').
mathbool, default: True
If False, always treat as a single unicode character.
matplotlib.mathtext.math_to_image(s, filename_or_obj, prop=None, dpi=None, format=None)[source]
Given a math expression, renders it in a closely-clipped bounding box to an image file. Parameters
sstr
A math expression. The math portion must be enclosed in dollar signs.
filename_or_objstr or path-like or file-like
Where to write the image data.
propFontProperties, optional
The size and style of the text.
dpifloat, optional
The output dpi. If not set, the dpi is determined as for Figure.savefig.
formatstr, optional
The output format, e.g., 'svg', 'pdf', 'ps' or 'png'. If not set, the format is determined as for Figure.savefig.
matplotlib.mathtext.ship(ox, oy, box)[source]
[Deprecated] Notes Deprecated since version 3.4:
|
matplotlib.mathtext_api
|
matplotlib.mathtext.get_unicode_index(symbol, math=True)[source]
Return the integer index (from the Unicode table) of symbol. Parameters
symbolstr
A single unicode character, a TeX command (e.g. r'pi') or a Type1 symbol name (e.g. 'phi').
mathbool, default: True
If False, always treat as a single unicode character.
|
matplotlib.mathtext_api#matplotlib.mathtext.get_unicode_index
|
matplotlib.mathtext.math_to_image(s, filename_or_obj, prop=None, dpi=None, format=None)[source]
Given a math expression, renders it in a closely-clipped bounding box to an image file. Parameters
sstr
A math expression. The math portion must be enclosed in dollar signs.
filename_or_objstr or path-like or file-like
Where to write the image data.
propFontProperties, optional
The size and style of the text.
dpifloat, optional
The output dpi. If not set, the dpi is determined as for Figure.savefig.
formatstr, optional
The output format, e.g., 'svg', 'pdf', 'ps' or 'png'. If not set, the format is determined as for Figure.savefig.
|
matplotlib.mathtext_api#matplotlib.mathtext.math_to_image
|
classmatplotlib.mathtext.MathtextBackend[source]
Bases: object The base class for the mathtext backend-specific code. MathtextBackend subclasses interface between mathtext and specific Matplotlib graphics backends. Subclasses need to override the following: render_glyph() render_rect_filled() get_results() And optionally, if you need to use a FreeType hinting style: get_hinting_type() get_hinting_type()[source]
Get the FreeType hinting type to use with this particular backend.
get_results(box)[source]
Return a backend-specific tuple to return to the backend after all processing is done.
render_glyph(ox, oy, info)[source]
Draw a glyph described by info to the reference point (ox, oy).
render_rect_filled(x1, y1, x2, y2)[source]
Draw a filled black rectangle from (x1, y1) to (x2, y2).
set_canvas_size(w, h, d)[source]
Set the dimension of the drawing canvas.
|
matplotlib.mathtext_api#matplotlib.mathtext.MathtextBackend
|
get_hinting_type()[source]
Get the FreeType hinting type to use with this particular backend.
|
matplotlib.mathtext_api#matplotlib.mathtext.MathtextBackend.get_hinting_type
|
get_results(box)[source]
Return a backend-specific tuple to return to the backend after all processing is done.
|
matplotlib.mathtext_api#matplotlib.mathtext.MathtextBackend.get_results
|
render_glyph(ox, oy, info)[source]
Draw a glyph described by info to the reference point (ox, oy).
|
matplotlib.mathtext_api#matplotlib.mathtext.MathtextBackend.render_glyph
|
render_rect_filled(x1, y1, x2, y2)[source]
Draw a filled black rectangle from (x1, y1) to (x2, y2).
|
matplotlib.mathtext_api#matplotlib.mathtext.MathtextBackend.render_rect_filled
|
set_canvas_size(w, h, d)[source]
Set the dimension of the drawing canvas.
|
matplotlib.mathtext_api#matplotlib.mathtext.MathtextBackend.set_canvas_size
|
classmatplotlib.mathtext.MathtextBackendAgg[source]
Bases: matplotlib.mathtext.MathtextBackend Render glyphs and rectangles to an FTImage buffer, which is later transferred to the Agg image by the Agg backend. get_hinting_type()[source]
Get the FreeType hinting type to use with this particular backend.
get_results(box, used_characters)[source]
Return a backend-specific tuple to return to the backend after all processing is done.
render_glyph(ox, oy, info)[source]
Draw a glyph described by info to the reference point (ox, oy).
render_rect_filled(x1, y1, x2, y2)[source]
Draw a filled black rectangle from (x1, y1) to (x2, y2).
set_canvas_size(w, h, d)[source]
Set the dimension of the drawing canvas.
|
matplotlib.mathtext_api#matplotlib.mathtext.MathtextBackendAgg
|
get_hinting_type()[source]
Get the FreeType hinting type to use with this particular backend.
|
matplotlib.mathtext_api#matplotlib.mathtext.MathtextBackendAgg.get_hinting_type
|
get_results(box, used_characters)[source]
Return a backend-specific tuple to return to the backend after all processing is done.
|
matplotlib.mathtext_api#matplotlib.mathtext.MathtextBackendAgg.get_results
|
render_glyph(ox, oy, info)[source]
Draw a glyph described by info to the reference point (ox, oy).
|
matplotlib.mathtext_api#matplotlib.mathtext.MathtextBackendAgg.render_glyph
|
render_rect_filled(x1, y1, x2, y2)[source]
Draw a filled black rectangle from (x1, y1) to (x2, y2).
|
matplotlib.mathtext_api#matplotlib.mathtext.MathtextBackendAgg.render_rect_filled
|
set_canvas_size(w, h, d)[source]
Set the dimension of the drawing canvas.
|
matplotlib.mathtext_api#matplotlib.mathtext.MathtextBackendAgg.set_canvas_size
|
classmatplotlib.mathtext.MathtextBackendBitmap[source]
Bases: matplotlib.mathtext.MathtextBackendAgg [Deprecated] Notes Deprecated since version 3.4: get_results(box, used_characters)[source]
Return a backend-specific tuple to return to the backend after all processing is done.
|
matplotlib.mathtext_api#matplotlib.mathtext.MathtextBackendBitmap
|
get_results(box, used_characters)[source]
Return a backend-specific tuple to return to the backend after all processing is done.
|
matplotlib.mathtext_api#matplotlib.mathtext.MathtextBackendBitmap.get_results
|
classmatplotlib.mathtext.MathtextBackendCairo[source]
Bases: matplotlib.mathtext.MathtextBackend [Deprecated] Store information to write a mathtext rendering to the Cairo backend. Notes Deprecated since version 3.4. get_results(box, used_characters)[source]
Return a backend-specific tuple to return to the backend after all processing is done.
render_glyph(ox, oy, info)[source]
Draw a glyph described by info to the reference point (ox, oy).
render_rect_filled(x1, y1, x2, y2)[source]
Draw a filled black rectangle from (x1, y1) to (x2, y2).
|
matplotlib.mathtext_api#matplotlib.mathtext.MathtextBackendCairo
|
get_results(box, used_characters)[source]
Return a backend-specific tuple to return to the backend after all processing is done.
|
matplotlib.mathtext_api#matplotlib.mathtext.MathtextBackendCairo.get_results
|
render_glyph(ox, oy, info)[source]
Draw a glyph described by info to the reference point (ox, oy).
|
matplotlib.mathtext_api#matplotlib.mathtext.MathtextBackendCairo.render_glyph
|
render_rect_filled(x1, y1, x2, y2)[source]
Draw a filled black rectangle from (x1, y1) to (x2, y2).
|
matplotlib.mathtext_api#matplotlib.mathtext.MathtextBackendCairo.render_rect_filled
|
classmatplotlib.mathtext.MathtextBackendPath[source]
Bases: matplotlib.mathtext.MathtextBackend Store information to write a mathtext rendering to the text path machinery. get_results(box, used_characters)[source]
Return a backend-specific tuple to return to the backend after all processing is done.
render_glyph(ox, oy, info)[source]
Draw a glyph described by info to the reference point (ox, oy).
render_rect_filled(x1, y1, x2, y2)[source]
Draw a filled black rectangle from (x1, y1) to (x2, y2).
|
matplotlib.mathtext_api#matplotlib.mathtext.MathtextBackendPath
|
get_results(box, used_characters)[source]
Return a backend-specific tuple to return to the backend after all processing is done.
|
matplotlib.mathtext_api#matplotlib.mathtext.MathtextBackendPath.get_results
|
render_glyph(ox, oy, info)[source]
Draw a glyph described by info to the reference point (ox, oy).
|
matplotlib.mathtext_api#matplotlib.mathtext.MathtextBackendPath.render_glyph
|
render_rect_filled(x1, y1, x2, y2)[source]
Draw a filled black rectangle from (x1, y1) to (x2, y2).
|
matplotlib.mathtext_api#matplotlib.mathtext.MathtextBackendPath.render_rect_filled
|
classmatplotlib.mathtext.MathtextBackendPdf[source]
Bases: matplotlib.mathtext.MathtextBackend [Deprecated] Store information to write a mathtext rendering to the PDF backend. Notes Deprecated since version 3.4. get_results(box, used_characters)[source]
Return a backend-specific tuple to return to the backend after all processing is done.
render_glyph(ox, oy, info)[source]
Draw a glyph described by info to the reference point (ox, oy).
render_rect_filled(x1, y1, x2, y2)[source]
Draw a filled black rectangle from (x1, y1) to (x2, y2).
|
matplotlib.mathtext_api#matplotlib.mathtext.MathtextBackendPdf
|
get_results(box, used_characters)[source]
Return a backend-specific tuple to return to the backend after all processing is done.
|
matplotlib.mathtext_api#matplotlib.mathtext.MathtextBackendPdf.get_results
|
render_glyph(ox, oy, info)[source]
Draw a glyph described by info to the reference point (ox, oy).
|
matplotlib.mathtext_api#matplotlib.mathtext.MathtextBackendPdf.render_glyph
|
render_rect_filled(x1, y1, x2, y2)[source]
Draw a filled black rectangle from (x1, y1) to (x2, y2).
|
matplotlib.mathtext_api#matplotlib.mathtext.MathtextBackendPdf.render_rect_filled
|
classmatplotlib.mathtext.MathtextBackendPs[source]
Bases: matplotlib.mathtext.MathtextBackend [Deprecated] Store information to write a mathtext rendering to the PostScript backend. Notes Deprecated since version 3.4. get_results(box, used_characters)[source]
Return a backend-specific tuple to return to the backend after all processing is done.
render_glyph(ox, oy, info)[source]
Draw a glyph described by info to the reference point (ox, oy).
render_rect_filled(x1, y1, x2, y2)[source]
Draw a filled black rectangle from (x1, y1) to (x2, y2).
|
matplotlib.mathtext_api#matplotlib.mathtext.MathtextBackendPs
|
get_results(box, used_characters)[source]
Return a backend-specific tuple to return to the backend after all processing is done.
|
matplotlib.mathtext_api#matplotlib.mathtext.MathtextBackendPs.get_results
|
render_glyph(ox, oy, info)[source]
Draw a glyph described by info to the reference point (ox, oy).
|
matplotlib.mathtext_api#matplotlib.mathtext.MathtextBackendPs.render_glyph
|
render_rect_filled(x1, y1, x2, y2)[source]
Draw a filled black rectangle from (x1, y1) to (x2, y2).
|
matplotlib.mathtext_api#matplotlib.mathtext.MathtextBackendPs.render_rect_filled
|
classmatplotlib.mathtext.MathtextBackendSvg[source]
Bases: matplotlib.mathtext.MathtextBackend [Deprecated] Store information to write a mathtext rendering to the SVG backend. Notes Deprecated since version 3.4. get_results(box, used_characters)[source]
Return a backend-specific tuple to return to the backend after all processing is done.
render_glyph(ox, oy, info)[source]
Draw a glyph described by info to the reference point (ox, oy).
render_rect_filled(x1, y1, x2, y2)[source]
Draw a filled black rectangle from (x1, y1) to (x2, y2).
|
matplotlib.mathtext_api#matplotlib.mathtext.MathtextBackendSvg
|
get_results(box, used_characters)[source]
Return a backend-specific tuple to return to the backend after all processing is done.
|
matplotlib.mathtext_api#matplotlib.mathtext.MathtextBackendSvg.get_results
|
render_glyph(ox, oy, info)[source]
Draw a glyph described by info to the reference point (ox, oy).
|
matplotlib.mathtext_api#matplotlib.mathtext.MathtextBackendSvg.render_glyph
|
render_rect_filled(x1, y1, x2, y2)[source]
Draw a filled black rectangle from (x1, y1) to (x2, y2).
|
matplotlib.mathtext_api#matplotlib.mathtext.MathtextBackendSvg.render_rect_filled
|
classmatplotlib.mathtext.MathTextParser(output)[source]
Bases: object Create a MathTextParser for the given backend output. get_depth(texstr, dpi=120, fontsize=14)[source]
[Deprecated] Get the depth of a mathtext string. Parameters
texstrstr
A valid mathtext string, e.g., r'IQ: $sigma_i=15$'.
dpifloat
The dots-per-inch setting used to render the text. Returns
int
Offset of the baseline from the bottom of the image, in pixels. Notes Deprecated since version 3.4.
parse(s, dpi=72, prop=None, *, _force_standard_ps_fonts=False)[source]
Parse the given math expression s at the given dpi. If prop is provided, it is a FontProperties object specifying the "default" font to use in the math expression, used for all non-math text. The results are cached, so multiple calls to parse with the same expression should be fast.
to_mask(texstr, dpi=120, fontsize=14)[source]
[Deprecated] Convert a mathtext string to a grayscale array and depth. Parameters
texstrstr
A valid mathtext string, e.g., r'IQ: $sigma_i=15$'.
dpifloat
The dots-per-inch setting used to render the text.
fontsizeint
The font size in points Returns
array2D uint8 alpha
Mask array of rasterized tex.
depthint
Offset of the baseline from the bottom of the image, in pixels. Notes Deprecated since version 3.4.
to_png(filename, texstr, color='black', dpi=120, fontsize=14)[source]
[Deprecated] Render a tex expression to a PNG file. Parameters
filename
A writable filename or fileobject.
texstrstr
A valid mathtext string, e.g., r'IQ: $sigma_i=15$'.
colorcolor
The text color.
dpifloat
The dots-per-inch setting used to render the text.
fontsizeint
The font size in points. Returns
int
Offset of the baseline from the bottom of the image, in pixels. Notes Deprecated since version 3.4.
to_rgba(texstr, color='black', dpi=120, fontsize=14)[source]
[Deprecated] Convert a mathtext string to an RGBA array and depth. Parameters
texstrstr
A valid mathtext string, e.g., r'IQ: $sigma_i=15$'.
colorcolor
The text color.
dpifloat
The dots-per-inch setting used to render the text.
fontsizeint
The font size in points. Returns
array(M, N, 4) array
RGBA color values of rasterized tex, colorized with color.
depthint
Offset of the baseline from the bottom of the image, in pixels. Notes Deprecated since version 3.4.
|
matplotlib.mathtext_api#matplotlib.mathtext.MathTextParser
|
get_depth(texstr, dpi=120, fontsize=14)[source]
[Deprecated] Get the depth of a mathtext string. Parameters
texstrstr
A valid mathtext string, e.g., r'IQ: $sigma_i=15$'.
dpifloat
The dots-per-inch setting used to render the text. Returns
int
Offset of the baseline from the bottom of the image, in pixels. Notes Deprecated since version 3.4.
|
matplotlib.mathtext_api#matplotlib.mathtext.MathTextParser.get_depth
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.