doc_content
stringlengths
1
386k
doc_id
stringlengths
5
188
set_position(position)[source] Set the position of the spine. Spine position is specified by a 2 tuple of (position type, amount). The position types are: 'outward': place the spine out from the data area by the specified number of points. (Negative values place the spine inwards.) 'axes': place the spine at the spe...
matplotlib.spines_api#matplotlib.spines.Spine.set_position
classmatplotlib.spines.Spines(**kwargs)[source] Bases: collections.abc.MutableMapping The container of all Spines in an Axes. The interface is dict-like mapping names (e.g. 'left') to Spine objects. Additionally it implements some pandas.Series-like features like accessing elements by attribute: spines['top'].set_vis...
matplotlib.spines_api#matplotlib.spines.Spines
classmethodfrom_dict(d)[source]
matplotlib.spines_api#matplotlib.spines.Spines.from_dict
classmatplotlib.spines.SpinesProxy(spine_dict)[source] Bases: object A proxy to broadcast set_* method calls to all contained Spines. The proxy cannot be used for any other operations on its members. The supported methods are determined dynamically based on the contained spines. If not all spines support a given meth...
matplotlib.spines_api#matplotlib.spines.SpinesProxy
matplotlib.style Styles are predefined sets of rcParams that define the visual appearance of a plot. Customizing Matplotlib with style sheets and rcParams describes the mechanism and usage of styles. The Style sheets reference gives an overview of the builtin styles. matplotlib.style.context(style, after_reset=False)...
matplotlib.style_api
matplotlib.style.context(style, after_reset=False) Context manager for using style settings temporarily. Parameters stylestr, dict, Path or list A style specification. Valid options are: str The name of a style or a path/URL to a style file. For a list of available style names, see style.available. dict Dic...
matplotlib.style_api#matplotlib.style.context
matplotlib.style.reload_library()[source] Reload the style library.
matplotlib.style_api#matplotlib.style.reload_library
matplotlib.style.available List of the names of the available styles. This is meant to be read-only. Use reload_library to update.
matplotlib.style_api#matplotlib.style.matplotlib.style.available
matplotlib.style.library A dict mapping from style name to RcParams defining that style. This is meant to be read-only. Use reload_library to update.
matplotlib.style_api#matplotlib.style.matplotlib.style.library
matplotlib.style.use(style)[source] Use Matplotlib style settings from a style specification. The style name of 'default' is reserved for reverting back to the default style settings. Note This updates the rcParams with the settings from the style. rcParams not defined in the style are kept. Parameters stylestr...
matplotlib.style_api#matplotlib.style.use
matplotlib.table Tables drawing. Note The table implementation in Matplotlib is lightly maintained. For a more featureful table implementation, you may wish to try blume. Use the factory function table to create a ready-made table from texts. If you need more control, use the Table class and its methods. The table co...
matplotlib.table_api
classmatplotlib.table.Cell(xy, width, height, edgecolor='k', facecolor='w', fill=True, text='', loc=None, fontproperties=None, *, visible_edges='closed')[source] Bases: matplotlib.patches.Rectangle A cell is a Rectangle with some associated Text. As a user, you'll most likely not creates cells yourself. Instead, you ...
matplotlib.table_api#matplotlib.table.Cell
auto_set_font_size(renderer)[source] Shrink font size until the text fits into the cell width.
matplotlib.table_api#matplotlib.table.Cell.auto_set_font_size
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.table_api#matplotlib.table.Cell.draw
get_fontsize()[source] Return the cell fontsize.
matplotlib.table_api#matplotlib.table.Cell.get_fontsize
get_path()[source] Return a Path for the visible_edges.
matplotlib.table_api#matplotlib.table.Cell.get_path
get_required_width(renderer)[source] Return the minimal required width for the cell.
matplotlib.table_api#matplotlib.table.Cell.get_required_width
get_text()[source] Return the cell Text instance.
matplotlib.table_api#matplotlib.table.Cell.get_text
get_text_bounds(renderer)[source] Return the text bounds as (x, y, width, height) in table coordinates.
matplotlib.table_api#matplotlib.table.Cell.get_text_bounds
PAD=0.1 Padding between text and rectangle.
matplotlib.table_api#matplotlib.table.Cell.PAD
set(*, agg_filter=<UNSET>, alpha=<UNSET>, angle=<UNSET>, animated=<UNSET>, antialiased=<UNSET>, bounds=<UNSET>, capstyle=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, color=<UNSET>, edgecolor=<UNSET>, facecolor=<UNSET>, fill=<UNSET>, fontsize=<UNSET>, gid=<UNSET>, hatch=<UNSET>, height=<UNSET>, in_layo...
matplotlib.table_api#matplotlib.table.Cell.set
set_figure(fig)[source] Set the Figure instance the artist belongs to. Parameters figFigure
matplotlib.table_api#matplotlib.table.Cell.set_figure
set_fontsize(size)[source] Set the text fontsize.
matplotlib.table_api#matplotlib.table.Cell.set_fontsize
set_text_props(**kwargs)[source] Update the text properties. Valid keyword arguments 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 backgroundcolor color bbox dict with properti...
matplotlib.table_api#matplotlib.table.Cell.set_text_props
set_transform(trans)[source] Set the artist transform. Parameters tTransform
matplotlib.table_api#matplotlib.table.Cell.set_transform
matplotlib.table.CustomCell[source] alias of matplotlib.table.Cell
matplotlib.table_api#matplotlib.table.CustomCell
classmatplotlib.table.Table(ax, loc=None, bbox=None, **kwargs)[source] Bases: matplotlib.artist.Artist A table of cells. The table consists of a grid of cells, which are indexed by (row, column). For a simple table, you'll have a full grid of cells with indices from (0, 0) to (num_rows-1, num_cols-1), in which the ce...
matplotlib.table_api#matplotlib.table.Table
matplotlib.table.table(ax, cellText=None, cellColours=None, cellLoc='right', colWidths=None, rowLabels=None, rowColours=None, rowLoc='left', colLabels=None, colColours=None, colLoc='center', loc='bottom', bbox=None, edges='closed', **kwargs)[source] Add a table to an Axes. At least one of cellText or cellColours must...
matplotlib.table_api#matplotlib.table.table
add_cell(row, col, *args, **kwargs)[source] Create a cell and add it to the table. Parameters rowint Row index. colint Column index. *args, **kwargs All other parameters are passed on to Cell. Returns Cell The created cell.
matplotlib.table_api#matplotlib.table.Table.add_cell
auto_set_column_width(col)[source] Automatically set the widths of given columns to optimal sizes. Parameters colint or sequence of ints The indices of the columns to auto-scale.
matplotlib.table_api#matplotlib.table.Table.auto_set_column_width
auto_set_font_size(value=True)[source] Automatically set font size.
matplotlib.table_api#matplotlib.table.Table.auto_set_font_size
AXESPAD=0.02 The border between the Axes and the table edge in Axes units.
matplotlib.table_api#matplotlib.table.Table.AXESPAD
codes={'best': 0, 'bottom': 17, 'bottom left': 12, 'bottom right': 13, 'center': 9, 'center left': 5, 'center right': 6, 'left': 15, 'lower center': 7, 'lower left': 3, 'lower right': 4, 'right': 14, 'top': 16, 'top left': 11, 'top right': 10, 'upper center': 8, 'upper left': 2, 'upper right': 1} Possible values wher...
matplotlib.table_api#matplotlib.table.Table.codes
contains(mouseevent)[source] Test whether the artist contains the mouse event. Parameters mouseeventmatplotlib.backend_bases.MouseEvent Returns containsbool Whether any values are within the radius. detailsdict An artist-specific dictionary of details of the event context, such as which points are con...
matplotlib.table_api#matplotlib.table.Table.contains
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.table_api#matplotlib.table.Table.draw
FONTSIZE=10
matplotlib.table_api#matplotlib.table.Table.FONTSIZE
get_celld()[source] Return a dict of cells in the table mapping (row, column) to Cells. Notes You can also directly index into the Table object to access individual cells: cell = table[row, col]
matplotlib.table_api#matplotlib.table.Table.get_celld
get_children()[source] Return the Artists contained by the table.
matplotlib.table_api#matplotlib.table.Table.get_children
get_window_extent(renderer)[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 results...
matplotlib.table_api#matplotlib.table.Table.get_window_extent
scale(xscale, yscale)[source] Scale column widths by xscale and row heights by yscale.
matplotlib.table_api#matplotlib.table.Table.scale
set(*, agg_filter=<UNSET>, alpha=<UNSET>, animated=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, fontsize=<UNSET>, gid=<UNSET>, in_layout=<UNSET>, label=<UNSET>, path_effects=<UNSET>, picker=<UNSET>, rasterized=<UNSET>, sketch_params=<UNSET>, snap=<UNSET>, transform=<UNSET>, url=<UNSET>, visible=<UNSET...
matplotlib.table_api#matplotlib.table.Table.set
set_fontsize(size)[source] Set the font size, in points, of the cell text. Parameters sizefloat Notes As long as auto font size has not been disabled, the value will be clipped such that the text fits horizontally into the cell. You can disable this behavior using auto_set_font_size. >>> the_table.auto_set_fo...
matplotlib.table_api#matplotlib.table.Table.set_fontsize
matplotlib.test(verbosity=None, coverage=False, **kwargs)[source] [Deprecated] Run the matplotlib test suite. Notes Deprecated since version 3.5.
matplotlib.testing_api#matplotlib.test
matplotlib.testing matplotlib.test() matplotlib.test(verbosity=None, coverage=False, **kwargs)[source] [Deprecated] Run the matplotlib test suite. Notes Deprecated since version 3.5. matplotlib.testing Helper functions for testing. matplotlib.testing.set_font_settings_for_testing()[source] matplotlib.t...
matplotlib.testing_api
matplotlib.testing.compare.calculate_rms(expected_image, actual_image)[source] Calculate the per-pixel errors, then compute the root mean square error.
matplotlib.testing_api#matplotlib.testing.compare.calculate_rms
matplotlib.testing.compare.comparable_formats()[source] Return the list of file formats that compare_images can compare on this system. Returns list of str E.g. ['png', 'pdf', 'svg', 'eps'].
matplotlib.testing_api#matplotlib.testing.compare.comparable_formats
matplotlib.testing.compare.compare_images(expected, actual, tol, in_decorator=False)[source] Compare two "image" files checking differences within a tolerance. The two given filenames may point to files which are convertible to PNG via the converter dictionary. The underlying RMS is calculated with the calculate_rms ...
matplotlib.testing_api#matplotlib.testing.compare.compare_images
matplotlib.testing.decorators.check_figures_equal(*, extensions=('png', 'pdf', 'svg'), tol=0)[source] Decorator for test cases that generate and compare two figures. The decorated function must take two keyword arguments, fig_test and fig_ref, and draw the test and reference images on them. After the function returns...
matplotlib.testing_api#matplotlib.testing.decorators.check_figures_equal
matplotlib.testing.decorators.check_freetype_version(ver)[source]
matplotlib.testing_api#matplotlib.testing.decorators.check_freetype_version
matplotlib.testing.decorators.cleanup(style=None)[source] A decorator to ensure that any global state is reset before running a test. Parameters stylestr, dict, or list, optional The style(s) to apply. Defaults to ["classic", "_classic_test_patch"].
matplotlib.testing_api#matplotlib.testing.decorators.cleanup
classmatplotlib.testing.decorators.CleanupTestCase(methodName='runTest')[source] Bases: unittest.case.TestCase A wrapper for unittest.TestCase that includes cleanup operations. Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method...
matplotlib.testing_api#matplotlib.testing.decorators.CleanupTestCase
classmethodsetUpClass()[source] Hook method for setting up class fixture before running tests in the class.
matplotlib.testing_api#matplotlib.testing.decorators.CleanupTestCase.setUpClass
classmethodtearDownClass()[source] Hook method for deconstructing the class fixture after running all tests in the class.
matplotlib.testing_api#matplotlib.testing.decorators.CleanupTestCase.tearDownClass
matplotlib.testing.decorators.image_comparison(baseline_images, extensions=None, tol=0, freetype_version=None, remove_text=False, savefig_kwarg=None, style=('classic', '_classic_test_patch'))[source] Compare images generated by the test with those specified in baseline_images, which must correspond, else an ImageComp...
matplotlib.testing_api#matplotlib.testing.decorators.image_comparison
matplotlib.testing.decorators.remove_ticks_and_titles(figure)[source]
matplotlib.testing_api#matplotlib.testing.decorators.remove_ticks_and_titles
exceptionmatplotlib.testing.exceptions.ImageComparisonFailure[source] Bases: AssertionError Raise this exception to mark a test as a comparison between two images.
matplotlib.testing_api#matplotlib.testing.exceptions.ImageComparisonFailure
matplotlib.testing.set_font_settings_for_testing()[source]
matplotlib.testing_api#matplotlib.testing.set_font_settings_for_testing
matplotlib.testing.set_reproducibility_for_testing()[source]
matplotlib.testing_api#matplotlib.testing.set_reproducibility_for_testing
matplotlib.testing.setup()[source]
matplotlib.testing_api#matplotlib.testing.setup
matplotlib.texmanager Support for embedded TeX expressions in Matplotlib. Requirements: LaTeX. *Agg backends: dvipng>=1.6. PS backend: PSfrag, dvips, and Ghostscript>=9.0. PDF and SVG backends: if LuaTeX is present, it will be used to speed up some post-processing steps, but note that it is not used to parse the TeX s...
matplotlib.texmanager_api
classmatplotlib.texmanager.TexManager[source] Bases: object Convert strings to dvi files using TeX, caching the results to a directory. Repeated calls to this constructor always return the same instance. propertyfont_families[source] propertyfont_family[source] propertyfont_info[source] get_basefile(tex...
matplotlib.texmanager_api#matplotlib.texmanager.TexManager
get_basefile(tex, fontsize, dpi=None)[source] Return a filename based on a hash of the string, fontsize, and dpi.
matplotlib.texmanager_api#matplotlib.texmanager.TexManager.get_basefile
get_custom_preamble()[source] Return a string containing user additions to the tex preamble.
matplotlib.texmanager_api#matplotlib.texmanager.TexManager.get_custom_preamble
get_font_config()[source]
matplotlib.texmanager_api#matplotlib.texmanager.TexManager.get_font_config
get_font_preamble()[source] Return a string containing font configuration for the tex preamble.
matplotlib.texmanager_api#matplotlib.texmanager.TexManager.get_font_preamble
get_grey(tex, fontsize=None, dpi=None)[source] Return the alpha channel.
matplotlib.texmanager_api#matplotlib.texmanager.TexManager.get_grey
get_rgba(tex, fontsize=None, dpi=None, rgb=(0, 0, 0))[source] Return latex's rendering of the tex string as an rgba array. Examples >>> texmanager = TexManager() >>> s = r"\TeX\ is $\displaystyle\sum_n\frac{-e^{i\pi}}{2^n}$!" >>> Z = texmanager.get_rgba(s, fontsize=12, dpi=80, rgb=(1, 0, 0))
matplotlib.texmanager_api#matplotlib.texmanager.TexManager.get_rgba
get_text_width_height_descent(tex, fontsize, renderer=None)[source] Return width, height and descent of the text.
matplotlib.texmanager_api#matplotlib.texmanager.TexManager.get_text_width_height_descent
make_dvi(tex, fontsize)[source] Generate a dvi file containing latex's layout of tex string. Return the file name.
matplotlib.texmanager_api#matplotlib.texmanager.TexManager.make_dvi
make_png(tex, fontsize, dpi)[source] Generate a png file containing latex's rendering of tex string. Return the file name.
matplotlib.texmanager_api#matplotlib.texmanager.TexManager.make_png
make_tex(tex, fontsize)[source] Generate a tex file to render the tex string at a specific font size. Return the file name.
matplotlib.texmanager_api#matplotlib.texmanager.TexManager.make_tex
texcache='/home/elliott/.cache/matplotlib/tex.cache'
matplotlib.texmanager_api#matplotlib.texmanager.TexManager.texcache
matplotlib.text Classes for including text in a figure. classmatplotlib.text.Annotation(text, xy, xytext=None, xycoords='data', textcoords=None, arrowprops=None, annotation_clip=None, **kwargs)[source] Bases: matplotlib.text.Text, matplotlib.text._AnnotationBase An Annotation is a Text that can refer to a specific ...
matplotlib.text_api
classmatplotlib.text.Annotation(text, xy, xytext=None, xycoords='data', textcoords=None, arrowprops=None, annotation_clip=None, **kwargs)[source] Bases: matplotlib.text.Text, matplotlib.text._AnnotationBase An Annotation is a Text that can refer to a specific position xy. Optionally an arrow pointing from the text to...
matplotlib.text_api#matplotlib.text.Annotation
contains(event)[source] Return whether the mouse event occurred inside the axis-aligned bounding-box of the text.
matplotlib.text_api#matplotlib.text.Annotation.contains
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.text_api#matplotlib.text.Annotation.draw
get_anncoords()[source] Return the coordinate system to use for Annotation.xyann. See also xycoords in Annotation.
matplotlib.text_api#matplotlib.text.Annotation.get_anncoords
get_tightbbox(renderer)[source] Like Artist.get_window_extent, but includes any clipping. Parameters rendererRendererBase subclass renderer that will be used to draw the figures (i.e. fig.canvas.get_renderer()) Returns Bbox The enclosing bounding box (in figure pixel coordinates).
matplotlib.text_api#matplotlib.text.Annotation.get_tightbbox
get_window_extent(renderer=None)[source] Return the Bbox bounding the text, in display units. In addition to being used internally, this is useful for specifying clickable regions in a png file on a web page. Parameters rendererRenderer, optional A renderer is needed to compute the bounding box. If the artist h...
matplotlib.text_api#matplotlib.text.Annotation.get_window_extent
set(*, agg_filter=<UNSET>, alpha=<UNSET>, animated=<UNSET>, anncoords=<UNSET>, annotation_clip=<UNSET>, backgroundcolor=<UNSET>, bbox=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, color=<UNSET>, fontfamily=<UNSET>, fontproperties=<UNSET>, fontsize=<UNSET>, fontstretch=<UNSET>, fontstyle=<UNSET>, fontva...
matplotlib.text_api#matplotlib.text.Annotation.set
set_anncoords(coords)[source] Set the coordinate system to use for Annotation.xyann. See also xycoords in Annotation.
matplotlib.text_api#matplotlib.text.Annotation.set_anncoords
set_figure(fig)[source] Set the Figure instance the artist belongs to. Parameters figFigure
matplotlib.text_api#matplotlib.text.Annotation.set_figure
update_positions(renderer)[source] Update the pixel positions of the annotation text and the arrow patch.
matplotlib.text_api#matplotlib.text.Annotation.update_positions
matplotlib.text.get_rotation(rotation)[source] Return rotation normalized to an angle between 0 and 360 degrees. Parameters rotationfloat or {None, 'horizontal', 'vertical'} Rotation angle in degrees. None and 'horizontal' equal 0, 'vertical' equals 90. Returns float
matplotlib.text_api#matplotlib.text.get_rotation
classmatplotlib.text.OffsetFrom(artist, ref_coord, unit='points')[source] Bases: object Callable helper class for working with Annotation. Parameters artistArtist or BboxBase or Transform The object to compute the offset from. ref_coord(float, float) If artist is an Artist or BboxBase, this values is the lo...
matplotlib.text_api#matplotlib.text.OffsetFrom
get_unit()[source] Return the unit for input to the transform used by __call__.
matplotlib.text_api#matplotlib.text.OffsetFrom.get_unit
set_unit(unit)[source] Set the unit for input to the transform used by __call__. Parameters unit{'points', 'pixels'}
matplotlib.text_api#matplotlib.text.OffsetFrom.set_unit
classmatplotlib.text.Text(x=0, y=0, text='', color=None, verticalalignment='baseline', horizontalalignment='left', multialignment=None, fontproperties=None, rotation=None, linespacing=None, rotation_mode=None, usetex=None, wrap=False, transform_rotates_text=False, *, parse_math=True, **kwargs)[source] Bases: matplotl...
matplotlib.text_api#matplotlib.text.Text
contains(mouseevent)[source] Return whether the mouse event occurred inside the axis-aligned bounding-box of the text.
matplotlib.text_api#matplotlib.text.Text.contains
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.text_api#matplotlib.text.Text.draw
get_bbox_patch()[source] Return the bbox Patch, or None if the patches.FancyBboxPatch is not made.
matplotlib.text_api#matplotlib.text.Text.get_bbox_patch
get_c()[source] Alias for get_color.
matplotlib.text_api#matplotlib.text.Text.get_c
get_color()[source] Return the color of the text.
matplotlib.text_api#matplotlib.text.Text.get_color
get_family()[source] Alias for get_fontfamily.
matplotlib.text_api#matplotlib.text.Text.get_family
get_font()[source] Alias for get_fontproperties.
matplotlib.text_api#matplotlib.text.Text.get_font
get_font_properties()[source] Alias for get_fontproperties.
matplotlib.text_api#matplotlib.text.Text.get_font_properties
get_fontfamily()[source] Return the list of font families used for font lookup. See also font_manager.FontProperties.get_family
matplotlib.text_api#matplotlib.text.Text.get_fontfamily
get_fontname()[source] Return the font name as a string. See also font_manager.FontProperties.get_name
matplotlib.text_api#matplotlib.text.Text.get_fontname
get_fontproperties()[source] Return the font_manager.FontProperties.
matplotlib.text_api#matplotlib.text.Text.get_fontproperties
get_fontsize()[source] Return the font size as an integer. See also font_manager.FontProperties.get_size_in_points
matplotlib.text_api#matplotlib.text.Text.get_fontsize