doc_content stringlengths 1 386k | doc_id stringlengths 5 188 |
|---|---|
matplotlib.docstring classmatplotlib.docstring.Substitution(*args, **kwargs)[source]
Bases: object A decorator that performs %-substitution on an object's docstring. This decorator should be robust even if obj.__doc__ is None (for example, if -OO was passed to the interpreter). Usage: construct a docstring.Substitu... | matplotlib.docstring_api |
matplotlib.docstring.copy(source)[source]
Copy a docstring from another source function (if present). | matplotlib.docstring_api#matplotlib.docstring.copy |
classmatplotlib.docstring.Substitution(*args, **kwargs)[source]
Bases: object A decorator that performs %-substitution on an object's docstring. This decorator should be robust even if obj.__doc__ is None (for example, if -OO was passed to the interpreter). Usage: construct a docstring.Substitution with a sequence or... | matplotlib.docstring_api#matplotlib.docstring.Substitution |
update(*args, **kwargs)[source]
Update self.params (which must be a dict) with the supplied args. | matplotlib.docstring_api#matplotlib.docstring.Substitution.update |
matplotlib.dviread A module for reading dvi files output by TeX. Several limitations make this not (currently) useful as a general-purpose dvi preprocessor, but it is currently used by the pdf backend for processing usetex text. Interface: with Dvi(filename, 72) as dvi:
# iterate over pages:
for page in dvi:
... | matplotlib.dviread |
classmatplotlib.dviread.Dvi(filename, dpi)[source]
Bases: object A reader for a dvi ("device-independent") file, as produced by TeX. The current implementation can only iterate through pages in order, and does not even attempt to verify the postamble. This class can be used as a context manager to close the underlyin... | matplotlib.dviread#matplotlib.dviread.Dvi |
close()[source]
Close the underlying file if it is open. | matplotlib.dviread#matplotlib.dviread.Dvi.close |
classmatplotlib.dviread.DviFont(scale, tfm, texname, vf)[source]
Bases: object Encapsulation of a font that a DVI file can refer to. This class holds a font's texname and size, supports comparison, and knows the widths of glyphs in the same units as the AFM file. There are also internal attributes (for use by dviread... | matplotlib.dviread#matplotlib.dviread.DviFont |
size | matplotlib.dviread#matplotlib.dviread.DviFont.size |
texname | matplotlib.dviread#matplotlib.dviread.DviFont.texname |
widths | matplotlib.dviread#matplotlib.dviread.DviFont.widths |
matplotlib.dviread.find_tex_file(filename, format=<deprecated parameter>)[source]
Find a file in the texmf tree. Calls kpsewhich which is an interface to the kpathsea library [1]. Most existing TeX distributions on Unix-like systems use kpathsea. It is also available as part of MikTeX, a popular distribution on Windo... | matplotlib.dviread#matplotlib.dviread.find_tex_file |
classmatplotlib.dviread.PsFont(texname, psname, effects, encoding, filename)[source]
Bases: tuple Create new instance of PsFont(texname, psname, effects, encoding, filename) effects
Alias for field number 2
encoding
Alias for field number 3
filename
Alias for field number 4
psname
Alias for fiel... | matplotlib.dviread#matplotlib.dviread.PsFont |
effects
Alias for field number 2 | matplotlib.dviread#matplotlib.dviread.PsFont.effects |
encoding
Alias for field number 3 | matplotlib.dviread#matplotlib.dviread.PsFont.encoding |
filename
Alias for field number 4 | matplotlib.dviread#matplotlib.dviread.PsFont.filename |
psname
Alias for field number 1 | matplotlib.dviread#matplotlib.dviread.PsFont.psname |
texname
Alias for field number 0 | matplotlib.dviread#matplotlib.dviread.PsFont.texname |
classmatplotlib.dviread.PsfontsMap(filename)[source]
Bases: object A psfonts.map formatted file, mapping TeX fonts to PS fonts. Parameters
filenamestr or path-like
Notes For historical reasons, TeX knows many Type-1 fonts by different names than the outside world. (For one thing, the names have to fit in eigh... | matplotlib.dviread#matplotlib.dviread.PsfontsMap |
classmatplotlib.dviread.Tfm(filename)[source]
Bases: object A TeX Font Metric file. This implementation covers only the bare minimum needed by the Dvi class. Parameters
filenamestr or path-like
Attributes
checksumint
Used for verifying against the dvi file.
design_sizeint
Design size of the font (unkn... | matplotlib.dviread#matplotlib.dviread.Tfm |
checksum | matplotlib.dviread#matplotlib.dviread.Tfm.checksum |
depth | matplotlib.dviread#matplotlib.dviread.Tfm.depth |
design_size | matplotlib.dviread#matplotlib.dviread.Tfm.design_size |
height | matplotlib.dviread#matplotlib.dviread.Tfm.height |
width | matplotlib.dviread#matplotlib.dviread.Tfm.width |
classmatplotlib.dviread.Vf(filename)[source]
Bases: matplotlib.dviread.Dvi A virtual font (*.vf file) containing subroutines for dvi files. Parameters
filenamestr or path-like
Notes The virtual font format is a derivative of dvi: http://mirrors.ctan.org/info/knuth/virtual-fonts This class reuses some of the m... | matplotlib.dviread#matplotlib.dviread.Vf |
matplotlib.figure matplotlib.figure implements the following classes: Figure
Top level Artist, which holds all plot elements. Many methods are implemented in FigureBase. SubFigure
A logical figure inside a figure, usually added to a figure (or parent SubFigure) with Figure.add_subfigure or Figure.subfigures methods... | matplotlib.figure_api |
matplotlib.figure.figaspect(arg)[source]
Calculate the width and height for a figure with a specified aspect ratio. While the height is taken from rcParams["figure.figsize"] (default: [6.4, 4.8]), the width is adjusted to match the desired aspect ratio. Additionally, it is ensured that the width is in the range [4., ... | matplotlib.figure_api#matplotlib.figure.figaspect |
classmatplotlib.figure.Figure(figsize=None, dpi=None, facecolor=None, edgecolor=None, linewidth=0.0, frameon=None, subplotpars=None, tight_layout=None, constrained_layout=None, *, layout=None, **kwargs)[source]
The top level container for all the plot elements. The Figure instance supports callbacks through a callbac... | matplotlib.figure_api#matplotlib.figure.Figure |
add_artist(artist, clip=False)[source]
Add an Artist to the figure. Usually artists are added to Axes objects using Axes.add_artist; this method can be used in the rare cases where one needs to add artists directly to the figure instead. Parameters
artistArtist
The artist to add to the figure. If the added arti... | matplotlib.figure_api#matplotlib.figure.Figure.add_artist |
add_axes(*args, **kwargs)[source]
Add an Axes to the figure. Call signatures: add_axes(rect, projection=None, polar=False, **kwargs)
add_axes(ax)
Parameters
rectsequence of float
The dimensions [left, bottom, width, height] of the new Axes. All quantities are in fractions of figure width and height.
projecti... | matplotlib.figure_api#matplotlib.figure.Figure.add_axes |
add_axobserver(func)[source]
Whenever the Axes state change, func(self) will be called. | matplotlib.figure_api#matplotlib.figure.Figure.add_axobserver |
add_callback(func)[source]
Add a callback function that will be called whenever one of the Artist's properties changes. Parameters
funccallable
The callback function. It must have the signature: def func(artist: Artist) -> Any
where artist is the calling Artist. Return values may exist but are ignored. Retu... | matplotlib.figure_api#matplotlib.figure.Figure.add_callback |
add_gridspec(nrows=1, ncols=1, **kwargs)[source]
Return a GridSpec that has this figure as a parent. This allows complex layout of Axes in the figure. Parameters
nrowsint, default: 1
Number of rows in grid.
ncolsint, default: 1
Number or columns in grid. Returns
GridSpec
Other Parameters
**kwargs
... | matplotlib.figure_api#matplotlib.figure.Figure.add_gridspec |
add_subfigure(subplotspec, **kwargs)[source]
Add a SubFigure to the figure as part of a subplot arrangement. Parameters
subplotspecgridspec.SubplotSpec
Defines the region in a parent gridspec where the subfigure will be placed. Returns
figure.SubFigure
Other Parameters
**kwargs
Are passed to the SubFi... | matplotlib.figure_api#matplotlib.figure.Figure.add_subfigure |
add_subplot(*args, **kwargs)[source]
Add an Axes to the figure as part of a subplot arrangement. Call signatures: add_subplot(nrows, ncols, index, **kwargs)
add_subplot(pos, **kwargs)
add_subplot(ax)
add_subplot()
Parameters
*argsint, (int, int, index), or SubplotSpec, default: (1, 1, 1)
The position of the su... | matplotlib.figure_api#matplotlib.figure.Figure.add_subplot |
align_labels(axs=None)[source]
Align the xlabels and ylabels of subplots with the same subplots row or column (respectively) if label alignment is being done automatically (i.e. the label position is not manually set). Alignment persists for draw events after this is called. Parameters
axslist of Axes
Optional ... | matplotlib.figure_api#matplotlib.figure.Figure.align_labels |
align_xlabels(axs=None)[source]
Align the xlabels of subplots in the same subplot column if label alignment is being done automatically (i.e. the label position is not manually set). Alignment persists for draw events after this is called. If a label is on the bottom, it is aligned with labels on Axes that also have ... | matplotlib.figure_api#matplotlib.figure.Figure.align_xlabels |
align_ylabels(axs=None)[source]
Align the ylabels of subplots in the same subplot column if label alignment is being done automatically (i.e. the label position is not manually set). Alignment persists for draw events after this is called. If a label is on the left, it is aligned with labels on Axes that also have th... | matplotlib.figure_api#matplotlib.figure.Figure.align_ylabels |
autofmt_xdate(bottom=0.2, rotation=30, ha='right', which='major')[source]
Date ticklabels often overlap, so it is useful to rotate them and right align them. Also, a common use case is a number of subplots with shared x-axis where the x-axis is date data. The ticklabels are often long, and it helps to rotate them on ... | matplotlib.figure_api#matplotlib.figure.Figure.autofmt_xdate |
clear(keep_observers=False)[source]
Clear the figure -- synonym for clf. | matplotlib.figure_api#matplotlib.figure.Figure.clear |
clf(keep_observers=False)[source]
Clear the figure. Set keep_observers to True if, for example, a gui widget is tracking the Axes in the figure. | matplotlib.figure_api#matplotlib.figure.Figure.clf |
colorbar(mappable, cax=None, ax=None, use_gridspec=True, **kw)[source]
Add a colorbar to a plot. Parameters
mappable
The matplotlib.cm.ScalarMappable (i.e., AxesImage, ContourSet, etc.) described by this colorbar. This argument is mandatory for the Figure.colorbar method but optional for the pyplot.colorbar funct... | matplotlib.figure_api#matplotlib.figure.Figure.colorbar |
contains(mouseevent)[source]
Test whether the mouse event occurred on the figure. Returns
bool, {} | matplotlib.figure_api#matplotlib.figure.Figure.contains |
convert_xunits(x)[source]
Convert x using the unit type of the xaxis. If the artist is not in contained in an Axes or if the xaxis does not have units, x itself is returned. | matplotlib.figure_api#matplotlib.figure.Figure.convert_xunits |
convert_yunits(y)[source]
Convert y using the unit type of the yaxis. If the artist is not in contained in an Axes or if the yaxis does not have units, y itself is returned. | matplotlib.figure_api#matplotlib.figure.Figure.convert_yunits |
delaxes(ax)[source]
Remove the Axes ax from the figure; update the current Axes. | matplotlib.figure_api#matplotlib.figure.Figure.delaxes |
draw(renderer)[source]
Draw the Artist (and its children) using the given renderer. This has no effect if the artist is not visible (Artist.get_visible returns False). Parameters
rendererRendererBase subclass.
Notes This method is overridden in the Artist subclasses. | matplotlib.figure_api#matplotlib.figure.Figure.draw |
draw_artist(a)[source]
Draw Artist a only. This method can only be used after an initial draw of the figure, because that creates and caches the renderer needed here. | matplotlib.figure_api#matplotlib.figure.Figure.draw_artist |
draw_without_rendering()[source]
Draw the figure with no output. Useful to get the final size of artists that require a draw before their size is known (e.g. text). | matplotlib.figure_api#matplotlib.figure.Figure.draw_without_rendering |
execute_constrained_layout(renderer=None)[source]
Use layoutgrid to determine pos positions within Axes. See also set_constrained_layout_pads. Returns
layoutgridprivate debugging object | matplotlib.figure_api#matplotlib.figure.Figure.execute_constrained_layout |
figimage(X, xo=0, yo=0, alpha=None, norm=None, cmap=None, vmin=None, vmax=None, origin=None, resize=False, **kwargs)[source]
Add a non-resampled image to the figure. The image is attached to the lower or upper left corner depending on origin. Parameters
X
The image data. This is an array of one of the following s... | matplotlib.figure_api#matplotlib.figure.Figure.figimage |
findobj(match=None, include_self=True)[source]
Find artist objects. Recursively find all Artist instances contained in the artist. Parameters
match
A filter criterion for the matches. This can be
None: Return all objects contained in artist. A function with signature def match(artist: Artist) -> bool. The resul... | matplotlib.figure_api#matplotlib.figure.Figure.findobj |
format_cursor_data(data)[source]
Return a string representation of data. Note This method is intended to be overridden by artist subclasses. As an end-user of Matplotlib you will most likely not call this method yourself. The default implementation converts ints and floats and arrays of ints and floats into a comma... | matplotlib.figure_api#matplotlib.figure.Figure.format_cursor_data |
gca(**kwargs)[source]
Get the current Axes. If there is currently no Axes on this Figure, a new one is created using Figure.add_subplot. (To test whether there is currently an Axes on a Figure, check whether figure.axes is empty. To test whether there is currently a Figure on the pyplot figure stack, check whether py... | matplotlib.figure_api#matplotlib.figure.Figure.gca |
get_agg_filter()[source]
Return filter function to be used for agg filter. | matplotlib.figure_api#matplotlib.figure.Figure.get_agg_filter |
get_alpha()[source]
Return the alpha value used for blending - not supported on all backends. | matplotlib.figure_api#matplotlib.figure.Figure.get_alpha |
get_animated()[source]
Return whether the artist is animated. | matplotlib.figure_api#matplotlib.figure.Figure.get_animated |
get_axes()[source]
List of Axes in the Figure. You can access and modify the Axes in the Figure through this list. Do not modify the list itself. Instead, use add_axes, add_subplot or delaxes to add or remove an Axes. Note: The Figure.axes property and get_axes method are equivalent. | matplotlib.figure_api#matplotlib.figure.Figure.get_axes |
get_children()[source]
Get a list of artists contained in the figure. | matplotlib.figure_api#matplotlib.figure.Figure.get_children |
get_clip_box()[source]
Return the clipbox. | matplotlib.figure_api#matplotlib.figure.Figure.get_clip_box |
get_clip_on()[source]
Return whether the artist uses clipping. | matplotlib.figure_api#matplotlib.figure.Figure.get_clip_on |
get_clip_path()[source]
Return the clip path. | matplotlib.figure_api#matplotlib.figure.Figure.get_clip_path |
get_constrained_layout()[source]
Return whether constrained layout is being used. See Constrained Layout Guide. | matplotlib.figure_api#matplotlib.figure.Figure.get_constrained_layout |
get_constrained_layout_pads(relative=False)[source]
Get padding for constrained_layout. Returns a list of w_pad, h_pad in inches and wspace and hspace as fractions of the subplot. See Constrained Layout Guide. Parameters
relativebool
If True, then convert from inches to figure relative. | matplotlib.figure_api#matplotlib.figure.Figure.get_constrained_layout_pads |
get_cursor_data(event)[source]
Return the cursor data for a given event. Note This method is intended to be overridden by artist subclasses. As an end-user of Matplotlib you will most likely not call this method yourself. Cursor data can be used by Artists to provide additional context information for a given event... | matplotlib.figure_api#matplotlib.figure.Figure.get_cursor_data |
get_default_bbox_extra_artists()[source] | matplotlib.figure_api#matplotlib.figure.Figure.get_default_bbox_extra_artists |
get_dpi()[source]
Return the resolution in dots per inch as a float. | matplotlib.figure_api#matplotlib.figure.Figure.get_dpi |
get_edgecolor()[source]
Get the edge color of the Figure rectangle. | matplotlib.figure_api#matplotlib.figure.Figure.get_edgecolor |
get_facecolor()[source]
Get the face color of the Figure rectangle. | matplotlib.figure_api#matplotlib.figure.Figure.get_facecolor |
get_figheight()[source]
Return the figure height in inches. | matplotlib.figure_api#matplotlib.figure.Figure.get_figheight |
get_figure()[source]
Return the Figure instance the artist belongs to. | matplotlib.figure_api#matplotlib.figure.Figure.get_figure |
get_figwidth()[source]
Return the figure width in inches. | matplotlib.figure_api#matplotlib.figure.Figure.get_figwidth |
get_frameon()[source]
Return the figure's background patch visibility, i.e. whether the figure background will be drawn. Equivalent to Figure.patch.get_visible(). | matplotlib.figure_api#matplotlib.figure.Figure.get_frameon |
get_gid()[source]
Return the group id. | matplotlib.figure_api#matplotlib.figure.Figure.get_gid |
get_in_layout()[source]
Return boolean flag, True if artist is included in layout calculations. E.g. Constrained Layout Guide, Figure.tight_layout(), and fig.savefig(fname, bbox_inches='tight'). | matplotlib.figure_api#matplotlib.figure.Figure.get_in_layout |
get_label()[source]
Return the label used for this artist in the legend. | matplotlib.figure_api#matplotlib.figure.Figure.get_label |
get_linewidth()[source]
Get the line width of the Figure rectangle. | matplotlib.figure_api#matplotlib.figure.Figure.get_linewidth |
get_path_effects()[source] | matplotlib.figure_api#matplotlib.figure.Figure.get_path_effects |
get_picker()[source]
Return the picking behavior of the artist. The possible values are described in set_picker. See also
set_picker, pickable, pick | matplotlib.figure_api#matplotlib.figure.Figure.get_picker |
get_rasterized()[source]
Return whether the artist is to be rasterized. | matplotlib.figure_api#matplotlib.figure.Figure.get_rasterized |
get_size_inches()[source]
Return the current size of the figure in inches. Returns
ndarray
The size (width, height) of the figure in inches. See also matplotlib.figure.Figure.set_size_inches
matplotlib.figure.Figure.get_figwidth
matplotlib.figure.Figure.get_figheight
Notes The size in pixels can be obtain... | matplotlib.figure_api#matplotlib.figure.Figure.get_size_inches |
get_sketch_params()[source]
Return the sketch parameters for the artist. Returns
tuple or None
A 3-tuple with the following elements:
scale: The amplitude of the wiggle perpendicular to the source line.
length: The length of the wiggle along the line.
randomness: The scale factor by which the length is shrunk... | matplotlib.figure_api#matplotlib.figure.Figure.get_sketch_params |
get_snap()[source]
Return the snap setting. See set_snap for details. | matplotlib.figure_api#matplotlib.figure.Figure.get_snap |
get_tight_layout()[source]
Return whether tight_layout is called when drawing. | matplotlib.figure_api#matplotlib.figure.Figure.get_tight_layout |
get_tightbbox(renderer, bbox_extra_artists=None)[source]
Return a (tight) bounding box of the figure in inches. Note that FigureBase differs from all other artists, which return their Bbox in pixels. Artists that have artist.set_in_layout(False) are not included in the bbox. Parameters
rendererRendererBase subcla... | matplotlib.figure_api#matplotlib.figure.Figure.get_tightbbox |
get_transform()[source]
Return the Transform instance used by this artist. | matplotlib.figure_api#matplotlib.figure.Figure.get_transform |
get_transformed_clip_path_and_affine()[source]
Return the clip path with the non-affine part of its transformation applied, and the remaining affine part of its transformation. | matplotlib.figure_api#matplotlib.figure.Figure.get_transformed_clip_path_and_affine |
get_url()[source]
Return the url. | matplotlib.figure_api#matplotlib.figure.Figure.get_url |
get_visible()[source]
Return the visibility. | matplotlib.figure_api#matplotlib.figure.Figure.get_visible |
get_window_extent(*args, **kwargs)[source]
Get the artist's bounding box in display space. The bounding box' width and height are nonnegative. Subclasses should override for inclusion in the bounding box "tight" calculation. Default is to return an empty bounding box at 0, 0. Be careful when using this function, the ... | matplotlib.figure_api#matplotlib.figure.Figure.get_window_extent |
get_zorder()[source]
Return the artist's zorder. | matplotlib.figure_api#matplotlib.figure.Figure.get_zorder |
ginput(n=1, timeout=30, show_clicks=True, mouse_add=MouseButton.LEFT, mouse_pop=MouseButton.RIGHT, mouse_stop=MouseButton.MIDDLE)[source]
Blocking call to interact with a figure. Wait until the user clicks n times on the figure, and return the coordinates of each click in a list. There are three possible interactions... | matplotlib.figure_api#matplotlib.figure.Figure.ginput |
have_units()[source]
Return whether units are set on any axis. | matplotlib.figure_api#matplotlib.figure.Figure.have_units |
is_transform_set()[source]
Return whether the Artist has an explicitly set transform. This is True after set_transform has been called. | matplotlib.figure_api#matplotlib.figure.Figure.is_transform_set |
legend(*args, **kwargs)[source]
Place a legend on the figure. Call signatures: legend()
legend(handles, labels)
legend(handles=handles)
legend(labels)
The call signatures correspond to the following different ways to use this method: 1. Automatic detection of elements to be shown in the legend The elements to be add... | matplotlib.figure_api#matplotlib.figure.Figure.legend |
pchanged()[source]
Call all of the registered callbacks. This function is triggered internally when a property is changed. See also add_callback
remove_callback | matplotlib.figure_api#matplotlib.figure.Figure.pchanged |
pick(mouseevent)[source]
Process a pick event. Each child artist will fire a pick event if mouseevent is over the artist and the artist has picker set. See also
set_picker, get_picker, pickable | matplotlib.figure_api#matplotlib.figure.Figure.pick |
pickable()[source]
Return whether the artist is pickable. See also
set_picker, get_picker, pick | matplotlib.figure_api#matplotlib.figure.Figure.pickable |
properties()[source]
Return a dictionary of all the properties of the artist. | matplotlib.figure_api#matplotlib.figure.Figure.properties |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.