doc_content stringlengths 1 386k | doc_id stringlengths 5 188 |
|---|---|
get_fontstyle()[source]
Return the font style as a string. See also font_manager.FontProperties.get_style | matplotlib.text_api#matplotlib.text.Text.get_fontstyle |
get_fontvariant()[source]
Return the font variant as a string. See also font_manager.FontProperties.get_variant | matplotlib.text_api#matplotlib.text.Text.get_fontvariant |
get_fontweight()[source]
Return the font weight as a string or a number. See also font_manager.FontProperties.get_weight | matplotlib.text_api#matplotlib.text.Text.get_fontweight |
get_ha()[source]
Alias for get_horizontalalignment. | matplotlib.text_api#matplotlib.text.Text.get_ha |
get_horizontalalignment()[source]
Return the horizontal alignment as a string. Will be one of 'left', 'center' or 'right'. | matplotlib.text_api#matplotlib.text.Text.get_horizontalalignment |
get_math_fontfamily()[source]
Return the font family name for math text rendered by Matplotlib. The default value is rcParams["mathtext.fontset"] (default: 'dejavusans'). See also set_math_fontfamily | matplotlib.text_api#matplotlib.text.Text.get_math_fontfamily |
get_name()[source]
Alias for get_fontname. | matplotlib.text_api#matplotlib.text.Text.get_name |
get_parse_math()[source]
Return whether mathtext parsing is considered for this Text. | matplotlib.text_api#matplotlib.text.Text.get_parse_math |
get_position()[source]
Return the (x, y) position of the text. | matplotlib.text_api#matplotlib.text.Text.get_position |
get_prop_tup(renderer=None)[source]
[Deprecated] Return a hashable tuple of properties. Not intended to be human readable, but useful for backends who want to cache derived information about text (e.g., layouts) and need to know if the text has changed. Notes Deprecated since version 3.5. | matplotlib.text_api#matplotlib.text.Text.get_prop_tup |
get_rotation()[source]
Return the text angle in degrees between 0 and 360. | matplotlib.text_api#matplotlib.text.Text.get_rotation |
get_rotation_mode()[source]
Return the text rotation mode. | matplotlib.text_api#matplotlib.text.Text.get_rotation_mode |
get_size()[source]
Alias for get_fontsize. | matplotlib.text_api#matplotlib.text.Text.get_size |
get_stretch()[source]
Return the font stretch as a string or a number. See also font_manager.FontProperties.get_stretch | matplotlib.text_api#matplotlib.text.Text.get_stretch |
get_style()[source]
Alias for get_fontstyle. | matplotlib.text_api#matplotlib.text.Text.get_style |
get_text()[source]
Return the text string. | matplotlib.text_api#matplotlib.text.Text.get_text |
get_transform_rotates_text()[source]
Return whether rotations of the transform affect the text direction. | matplotlib.text_api#matplotlib.text.Text.get_transform_rotates_text |
get_unitless_position()[source]
Return the (x, y) unitless position of the text. | matplotlib.text_api#matplotlib.text.Text.get_unitless_position |
get_usetex()[source]
Return whether this Text object uses TeX for rendering. | matplotlib.text_api#matplotlib.text.Text.get_usetex |
get_va()[source]
Alias for get_verticalalignment. | matplotlib.text_api#matplotlib.text.Text.get_va |
get_variant()[source]
Alias for get_fontvariant. | matplotlib.text_api#matplotlib.text.Text.get_variant |
get_verticalalignment()[source]
Return the vertical alignment as a string. Will be one of 'top', 'center', 'bottom', 'baseline' or 'center_baseline'. | matplotlib.text_api#matplotlib.text.Text.get_verticalalignment |
get_weight()[source]
Alias for get_fontweight. | matplotlib.text_api#matplotlib.text.Text.get_weight |
get_window_extent(renderer=None, dpi=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 th... | matplotlib.text_api#matplotlib.text.Text.get_window_extent |
get_wrap()[source]
Return whether the text can be wrapped. | matplotlib.text_api#matplotlib.text.Text.get_wrap |
set(*, agg_filter=<UNSET>, alpha=<UNSET>, animated=<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>, fontvariant=<UNSET>, fontweight=<UNSET>, gid=<UNSE... | matplotlib.text_api#matplotlib.text.Text.set |
set_backgroundcolor(color)[source]
Set the background color of the text by updating the bbox. Parameters
colorcolor
See also set_bbox
To change the position of the bounding box | matplotlib.text_api#matplotlib.text.Text.set_backgroundcolor |
set_bbox(rectprops)[source]
Draw a bounding box around self. Parameters
rectpropsdict with properties for patches.FancyBboxPatch
The default boxstyle is 'square'. The mutation scale of the patches.FancyBboxPatch is set to the fontsize. Examples t.set_bbox(dict(facecolor='red', alpha=0.5)) | matplotlib.text_api#matplotlib.text.Text.set_bbox |
set_c(color)[source]
Alias for set_color. | matplotlib.text_api#matplotlib.text.Text.set_c |
set_clip_box(clipbox)[source]
Set the artist's clip Bbox. Parameters
clipboxBbox | matplotlib.text_api#matplotlib.text.Text.set_clip_box |
set_clip_on(b)[source]
Set whether the artist uses clipping. When False artists will be visible outside of the axes which can lead to unexpected results. Parameters
bbool | matplotlib.text_api#matplotlib.text.Text.set_clip_on |
set_clip_path(path, transform=None)[source]
Set the artist's clip path. Parameters
pathPatch or Path or TransformedPath or None
The clip path. If given a Path, transform must be provided as well. If None, a previously set clip path is removed.
transformTransform, optional
Only used if path is a Path, in whi... | matplotlib.text_api#matplotlib.text.Text.set_clip_path |
set_color(color)[source]
Set the foreground color of the text Parameters
colorcolor | matplotlib.text_api#matplotlib.text.Text.set_color |
set_family(fontname)[source]
Alias for set_fontfamily. | matplotlib.text_api#matplotlib.text.Text.set_family |
set_font(fp)[source]
Alias for set_fontproperties. | matplotlib.text_api#matplotlib.text.Text.set_font |
set_font_properties(fp)[source]
Alias for set_fontproperties. | matplotlib.text_api#matplotlib.text.Text.set_font_properties |
set_fontfamily(fontname)[source]
Set the font family. May be either a single string, or a list of strings in decreasing priority. Each string may be either a real font name or a generic font class name. If the latter, the specific font names will be looked up in the corresponding rcParams. If a Text instance is const... | matplotlib.text_api#matplotlib.text.Text.set_fontfamily |
set_fontname(fontname)[source]
Alias for set_family. One-way alias only: the getter differs. Parameters
fontname{FONTNAME, 'serif', 'sans-serif', 'cursive', 'fantasy', 'monospace'}
See also font_manager.FontProperties.set_family | matplotlib.text_api#matplotlib.text.Text.set_fontname |
set_fontproperties(fp)[source]
Set the font properties that control the text. Parameters
fpfont_manager.FontProperties or str or pathlib.Path
If a str, it is interpreted as a fontconfig pattern parsed by FontProperties. If a pathlib.Path, it is interpreted as the absolute path to a font file. | matplotlib.text_api#matplotlib.text.Text.set_fontproperties |
set_fontsize(fontsize)[source]
Set the font size. Parameters
fontsizefloat or {'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'}
If float, the fontsize in points. The string values denote sizes relative to the default font size. See also font_manager.FontProperties.set_size | matplotlib.text_api#matplotlib.text.Text.set_fontsize |
set_fontstretch(stretch)[source]
Set the font stretch (horizontal condensation or expansion). Parameters
stretch{a numeric value in range 0-1000, 'ultra-condensed', 'extra-condensed', 'condensed', 'semi-condensed', 'normal', 'semi-expanded', 'expanded', 'extra-expanded', 'ultra-expanded'}
See also font_mana... | matplotlib.text_api#matplotlib.text.Text.set_fontstretch |
set_fontstyle(fontstyle)[source]
Set the font style. Parameters
fontstyle{'normal', 'italic', 'oblique'}
See also font_manager.FontProperties.set_style | matplotlib.text_api#matplotlib.text.Text.set_fontstyle |
set_fontvariant(variant)[source]
Set the font variant. Parameters
variant{'normal', 'small-caps'}
See also font_manager.FontProperties.set_variant | matplotlib.text_api#matplotlib.text.Text.set_fontvariant |
set_fontweight(weight)[source]
Set the font weight. Parameters
weight{a numeric value in range 0-1000, 'ultralight', 'light', 'normal', 'regular', 'book', 'medium', 'roman', 'semibold', 'demibold', 'demi', 'bold', 'heavy', 'extra bold', 'black'}
See also font_manager.FontProperties.set_weight | matplotlib.text_api#matplotlib.text.Text.set_fontweight |
set_ha(align)[source]
Alias for set_horizontalalignment. | matplotlib.text_api#matplotlib.text.Text.set_ha |
set_horizontalalignment(align)[source]
Set the horizontal alignment to one of Parameters
align{'center', 'right', 'left'} | matplotlib.text_api#matplotlib.text.Text.set_horizontalalignment |
set_linespacing(spacing)[source]
Set the line spacing as a multiple of the font size. The default line spacing is 1.2. Parameters
spacingfloat (multiple of font size) | matplotlib.text_api#matplotlib.text.Text.set_linespacing |
set_ma(align)[source]
Alias for set_multialignment. | matplotlib.text_api#matplotlib.text.Text.set_ma |
set_math_fontfamily(fontfamily)[source]
Set the font family for math text rendered by Matplotlib. This does only affect Matplotlib's own math renderer. It has no effect when rendering with TeX (usetex=True). Parameters
fontfamilystr
The name of the font family. Available font families are defined in the matplot... | matplotlib.text_api#matplotlib.text.Text.set_math_fontfamily |
set_multialignment(align)[source]
Set the text alignment for multiline texts. The layout of the bounding box of all the lines is determined by the horizontalalignment and verticalalignment properties. This property controls the alignment of the text lines within that box. Parameters
align{'left', 'right', 'center... | matplotlib.text_api#matplotlib.text.Text.set_multialignment |
set_name(fontname)[source]
Alias for set_fontname. | matplotlib.text_api#matplotlib.text.Text.set_name |
set_parse_math(parse_math)[source]
Override switch to disable any mathtext parsing for this Text. Parameters
parse_mathbool
If False, this Text will never use mathtext. If True, mathtext will be used if there is an even number of unescaped dollar signs. | matplotlib.text_api#matplotlib.text.Text.set_parse_math |
set_position(xy)[source]
Set the (x, y) position of the text. Parameters
xy(float, float) | matplotlib.text_api#matplotlib.text.Text.set_position |
set_rotation(s)[source]
Set the rotation of the text. Parameters
sfloat or {'vertical', 'horizontal'}
The rotation angle in degrees in mathematically positive direction (counterclockwise). 'horizontal' equals 0, 'vertical' equals 90. | matplotlib.text_api#matplotlib.text.Text.set_rotation |
set_rotation_mode(m)[source]
Set text rotation mode. Parameters
m{None, 'default', 'anchor'}
If None or "default", the text will be first rotated, then aligned according to their horizontal and vertical alignments. If "anchor", then alignment occurs before rotation. | matplotlib.text_api#matplotlib.text.Text.set_rotation_mode |
set_size(fontsize)[source]
Alias for set_fontsize. | matplotlib.text_api#matplotlib.text.Text.set_size |
set_stretch(stretch)[source]
Alias for set_fontstretch. | matplotlib.text_api#matplotlib.text.Text.set_stretch |
set_style(fontstyle)[source]
Alias for set_fontstyle. | matplotlib.text_api#matplotlib.text.Text.set_style |
set_text(s)[source]
Set the text string s. It may contain newlines (\n) or math in LaTeX syntax. Parameters
sobject
Any object gets converted to its str representation, except for None which is converted to an empty string. | matplotlib.text_api#matplotlib.text.Text.set_text |
set_transform_rotates_text(t)[source]
Whether rotations of the transform affect the text direction. Parameters
tbool | matplotlib.text_api#matplotlib.text.Text.set_transform_rotates_text |
set_usetex(usetex)[source]
Parameters
usetexbool or None
Whether to render using TeX, None means to use rcParams["text.usetex"] (default: False). | matplotlib.text_api#matplotlib.text.Text.set_usetex |
set_va(align)[source]
Alias for set_verticalalignment. | matplotlib.text_api#matplotlib.text.Text.set_va |
set_variant(variant)[source]
Alias for set_fontvariant. | matplotlib.text_api#matplotlib.text.Text.set_variant |
set_verticalalignment(align)[source]
Set the vertical alignment. Parameters
align{'center', 'top', 'bottom', 'baseline', 'center_baseline'} | matplotlib.text_api#matplotlib.text.Text.set_verticalalignment |
set_weight(weight)[source]
Alias for set_fontweight. | matplotlib.text_api#matplotlib.text.Text.set_weight |
set_wrap(wrap)[source]
Set whether the text can be wrapped. Parameters
wrapbool
Notes Wrapping does not work together with savefig(..., bbox_inches='tight') (which is also used internally by %matplotlib inline in IPython/Jupyter). The 'tight' setting rescales the canvas to accommodate all content and happens ... | matplotlib.text_api#matplotlib.text.Text.set_wrap |
set_x(x)[source]
Set the x position of the text. Parameters
xfloat | matplotlib.text_api#matplotlib.text.Text.set_x |
set_y(y)[source]
Set the y position of the text. Parameters
yfloat | matplotlib.text_api#matplotlib.text.Text.set_y |
update(kwargs)[source]
Update this artist's properties from the dict props. Parameters
propsdict | matplotlib.text_api#matplotlib.text.Text.update |
update_bbox_position_size(renderer)[source]
Update the location and the size of the bbox. This method should be used when the position and size of the bbox needs to be updated before actually drawing the bbox. | matplotlib.text_api#matplotlib.text.Text.update_bbox_position_size |
update_from(other)[source]
Copy properties from other to self. | matplotlib.text_api#matplotlib.text.Text.update_from |
zorder=3 | matplotlib.text_api#matplotlib.text.Text.zorder |
matplotlib.textpath classmatplotlib.textpath.TextPath(xy, s, size=None, prop=None, _interpolation_steps=1, usetex=False)[source]
Bases: matplotlib.path.Path Create a path from the text. Create a path from the text. Note that it simply is a path, not an artist. You need to use the PathPatch (or other artists) to dra... | matplotlib.textpath_api |
classmatplotlib.textpath.TextPath(xy, s, size=None, prop=None, _interpolation_steps=1, usetex=False)[source]
Bases: matplotlib.path.Path Create a path from the text. Create a path from the text. Note that it simply is a path, not an artist. You need to use the PathPatch (or other artists) to draw this path onto the c... | matplotlib.textpath_api#matplotlib.textpath.TextPath |
get_size()[source]
Get the text size. | matplotlib.textpath_api#matplotlib.textpath.TextPath.get_size |
set_size(size)[source]
Set the text size. | matplotlib.textpath_api#matplotlib.textpath.TextPath.set_size |
classmatplotlib.textpath.TextToPath[source]
Bases: object A class that converts strings to paths. DPI=72
FONT_SCALE=100.0
get_glyphs_mathtext(prop, s, glyph_map=None, return_new_glyphs_only=False)[source]
Parse mathtext string s and convert it to a (vertices, codes) pair.
get_glyphs_tex(prop, s, glyph... | matplotlib.textpath_api#matplotlib.textpath.TextToPath |
DPI=72 | matplotlib.textpath_api#matplotlib.textpath.TextToPath.DPI |
FONT_SCALE=100.0 | matplotlib.textpath_api#matplotlib.textpath.TextToPath.FONT_SCALE |
get_glyphs_mathtext(prop, s, glyph_map=None, return_new_glyphs_only=False)[source]
Parse mathtext string s and convert it to a (vertices, codes) pair. | matplotlib.textpath_api#matplotlib.textpath.TextToPath.get_glyphs_mathtext |
get_glyphs_tex(prop, s, glyph_map=None, return_new_glyphs_only=False)[source]
Convert the string s to vertices and codes using usetex mode. | matplotlib.textpath_api#matplotlib.textpath.TextToPath.get_glyphs_tex |
get_glyphs_with_font(font, s, glyph_map=None, return_new_glyphs_only=False)[source]
Convert string s to vertices and codes using the provided ttf font. | matplotlib.textpath_api#matplotlib.textpath.TextToPath.get_glyphs_with_font |
get_texmanager()[source]
Return the cached TexManager instance. | matplotlib.textpath_api#matplotlib.textpath.TextToPath.get_texmanager |
get_text_path(prop, s, ismath=False)[source]
Convert text s to path (a tuple of vertices and codes for matplotlib.path.Path). Parameters
propFontProperties
The font properties for the text.
sstr
The text to be converted.
ismath{False, True, "TeX"}
If True, use mathtext parser. If "TeX", use tex for rend... | matplotlib.textpath_api#matplotlib.textpath.TextToPath.get_text_path |
get_text_width_height_descent(s, prop, ismath)[source] | matplotlib.textpath_api#matplotlib.textpath.TextToPath.get_text_width_height_descent |
matplotlib.ticker Tick locating and formatting This module contains classes for configuring tick locating and formatting. Generic tick locators and formatters are provided, as well as domain specific custom ones. Although the locators know nothing about major or minor ticks, they are used by the Axis class to support ... | matplotlib.ticker_api |
classmatplotlib.ticker.AutoLocator[source]
Bases: matplotlib.ticker.MaxNLocator Dynamically find major tick positions. This is actually a subclass of MaxNLocator, with parameters nbins = 'auto' and steps = [1, 2, 2.5, 5, 10]. To know the values of the non-public parameters, please have a look to the defaults of MaxNL... | matplotlib.ticker_api#matplotlib.ticker.AutoLocator |
classmatplotlib.ticker.AutoMinorLocator(n=None)[source]
Bases: matplotlib.ticker.Locator Dynamically find minor tick positions based on the positions of major ticks. The scale must be linear with major ticks evenly spaced. n is the number of subdivisions of the interval between major ticks; e.g., n=2 will place a sin... | matplotlib.ticker_api#matplotlib.ticker.AutoMinorLocator |
tick_values(vmin, vmax)[source]
Return the values of the located ticks given vmin and vmax. Note To get tick locations with the vmin and vmax values defined automatically for the associated axis simply call the Locator instance: >>> print(type(loc))
<type 'Locator'>
>>> print(loc())
[1, 2, 3, 4] | matplotlib.ticker_api#matplotlib.ticker.AutoMinorLocator.tick_values |
classmatplotlib.ticker.EngFormatter(unit='', places=None, sep=' ', *, usetex=None, useMathText=None)[source]
Bases: matplotlib.ticker.Formatter Format axis values using engineering prefixes to represent powers of 1000, plus a specified unit, e.g., 10 MHz instead of 1e7. Parameters
unitstr, default: ""
Unit symb... | matplotlib.ticker_api#matplotlib.ticker.EngFormatter |
ENG_PREFIXES={-24: 'y', -21: 'z', -18: 'a', -15: 'f', -12: 'p', -9: 'n', -6: 'µ', -3: 'm', 0: '', 3: 'k', 6: 'M', 9: 'G', 12: 'T', 15: 'P', 18: 'E', 21: 'Z', 24: 'Y'} | matplotlib.ticker_api#matplotlib.ticker.EngFormatter.ENG_PREFIXES |
format_eng(num)[source]
Format a number in engineering notation, appending a letter representing the power of 1000 of the original number. Some examples: >>> format_eng(0) # for self.places = 0
'0'
>>> format_eng(1000000) # for self.places = 1
'1.0 M'
>>> format_eng("-1e-6") # for self.places = 2
'-1.00 µ' | matplotlib.ticker_api#matplotlib.ticker.EngFormatter.format_eng |
get_useMathText()[source] | matplotlib.ticker_api#matplotlib.ticker.EngFormatter.get_useMathText |
get_usetex()[source] | matplotlib.ticker_api#matplotlib.ticker.EngFormatter.get_usetex |
set_useMathText(val)[source] | matplotlib.ticker_api#matplotlib.ticker.EngFormatter.set_useMathText |
set_usetex(val)[source] | matplotlib.ticker_api#matplotlib.ticker.EngFormatter.set_usetex |
classmatplotlib.ticker.FixedFormatter(seq)[source]
Bases: matplotlib.ticker.Formatter Return fixed strings for tick labels based only on position, not value. Note FixedFormatter should only be used together with FixedLocator. Otherwise, the labels may end up in unexpected positions. Set the sequence seq of strings ... | matplotlib.ticker_api#matplotlib.ticker.FixedFormatter |
get_offset()[source] | matplotlib.ticker_api#matplotlib.ticker.FixedFormatter.get_offset |
set_offset_string(ofs)[source] | matplotlib.ticker_api#matplotlib.ticker.FixedFormatter.set_offset_string |
classmatplotlib.ticker.FixedLocator(locs, nbins=None)[source]
Bases: matplotlib.ticker.Locator Tick locations are fixed. If nbins is not None, the array of possible positions will be subsampled to keep the number of ticks <= nbins +1. The subsampling will be done so as to include the smallest absolute value; for exam... | matplotlib.ticker_api#matplotlib.ticker.FixedLocator |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.