neulab/docprompting-conala huggingface dataset:
subplots(nrows=1, ncols=1, *, sharex=False, sharey=False, squeeze=True, subplot_kw=None, gridspec_kw=None)[source]
 
Add a set of subplots to this figure. This utility wrapper makes it convenient to create common layouts of subplots in a single call.  Parameters 
 
nrows, ncolsint, default: 1


Number of rows/columns of the subplot grid.  
sharex, shareybool or {'none', 'all', 'row', 'col'}, default: False


Controls sharing of x-axis (sharex) or y-axis (sharey):  True or 'all': x- or y-axis will be shared among all subplots. False or 'none': each subplot x- or y-axis will be independent. 'row': each subplot row will share an x- or y-axis. 'col': each subplot column will share an x- or y-axis.  When subplots have a shared x-axis along a column, only the x tick labels of the bottom subplot are created. Similarly, when subplots have a shared y-axis along a row, only the y tick labels of the first column subplot are created. To later turn other subplots' ticklabels on, use tick_params. When subplots have a shared axis that has units, calling Axis.set_units will update each axis with the new units.  
squeezebool, default: True


 
If True, extra dimensions are squeezed out from the returned array of Axes:  if only one subplot is constructed (nrows=ncols=1), the resulting single Axes object is returned as a scalar. for Nx1 or 1xM subplots, the returned object is a 1D numpy object array of Axes objects. for NxM, subplots with N>1 and M>1 are returned as a 2D array.   If False, no squeezing at all is done: the returned Axes object is always a 2D array containing Axes instances, even if it ends up being 1x1.   
subplot_kwdict, optional


Dict with keywords passed to the Figure.add_subplot call used to create each subplot.  
gridspec_kwdict, optional


Dict with keywords passed to the GridSpec constructor used to create the grid the subplots are placed on.    Returns 
 
Axes or array of Axes

Either a single Axes object or an array of Axes objects if more than one subplot was created. The dimensions of the resulting array can be controlled with the squeeze keyword, see above.      See also  pyplot.subplots
Figure.add_subplot
pyplot.subplot
  Examples # First create some toy data:
x = np.linspace(0, 2*np.pi, 400)
y = np.sin(x**2)

# Create a figure
plt.figure()

# Create a subplot
ax = fig.subplots()
ax.plot(x, y)
ax.set_title('Simple plot')

# Create two subplots and unpack the output array immediately
ax1, ax2 = fig.subplots(1, 2, sharey=True)
ax1.plot(x, y)
ax1.set_title('Sharing Y axis')
ax2.scatter(x, y)

# Create four polar Axes and access them through the returned array
axes = fig.subplots(2, 2, subplot_kw=dict(projection='polar'))
axes[0, 0].plot(x, y)
axes[1, 1].scatter(x, y)

# Share a X axis with each column of subplots
fig.subplots(2, 2, sharex='col')

# Share a Y axis with each row of subplots
fig.subplots(2, 2, sharey='row')

# Share both X and Y axes with all subplots
fig.subplots(2, 2, sharex='all', sharey='all')

# Note that this is the same as
fig.subplots(2, 2, sharex=True, sharey=True)
subplots_adjust(left=None, bottom=None, right=None, top=None, wspace=None, hspace=None)[source]
 
Adjust the subplot layout parameters. Unset parameters are left unmodified; initial values are given by rcParams["figure.subplot.[name]"].  Parameters 
 
leftfloat, optional


The position of the left edge of the subplots, as a fraction of the figure width.  
rightfloat, optional


The position of the right edge of the subplots, as a fraction of the figure width.  
bottomfloat, optional


The position of the bottom edge of the subplots, as a fraction of the figure height.  
topfloat, optional


The position of the top edge of the subplots, as a fraction of the figure height.  
wspacefloat, optional


The width of the padding between subplots, as a fraction of the average Axes width.  
hspacefloat, optional


The height of the padding between subplots, as a fraction of the average Axes height.
suptitle(t, **kwargs)[source]
 
Add a centered suptitle to the figure.  Parameters 
 
tstr


The suptitle text.  
xfloat, default: 0.5


The x location of the text in figure coordinates.  
yfloat, default: 0.98


The y location of the text in figure coordinates.  
horizontalalignment, ha{'center', 'left', 'right'}, default: center


The horizontal alignment of the text relative to (x, y).  
verticalalignment, va{'top', 'center', 'bottom', 'baseline'}, default: top


The vertical alignment of the text relative to (x, y).  
fontsize, sizedefault: rcParams["figure.titlesize"] (default: 'large')


The font size of the text. See Text.set_size for possible values.  
fontweight, weightdefault: rcParams["figure.titleweight"] (default: 'normal')


The font weight of the text. See Text.set_weight for possible values.    Returns 
 text

The Text instance of the suptitle.    Other Parameters 
 
fontpropertiesNone or dict, optional


A dict of font properties. If fontproperties is given the default values for font size and weight are taken from the FontProperties defaults. rcParams["figure.titlesize"] (default: 'large') and rcParams["figure.titleweight"] (default: 'normal') are ignored in this case.  **kwargs

Additional kwargs are matplotlib.text.Text properties.
supxlabel(t, **kwargs)[source]
 
Add a centered supxlabel to the figure.  Parameters 
 
tstr


The supxlabel text.  
xfloat, default: 0.5


The x location of the text in figure coordinates.  
yfloat, default: 0.01


The y location of the text in figure coordinates.  
horizontalalignment, ha{'center', 'left', 'right'}, default: center


The horizontal alignment of the text relative to (x, y).  
verticalalignment, va{'top', 'center', 'bottom', 'baseline'}, default: bottom


The vertical alignment of the text relative to (x, y).  
fontsize, sizedefault: rcParams["figure.titlesize"] (default: 'large')


The font size of the text. See Text.set_size for possible values.  
fontweight, weightdefault: rcParams["figure.titleweight"] (default: 'normal')


The font weight of the text. See Text.set_weight for possible values.    Returns 
 text

The Text instance of the supxlabel.    Other Parameters 
 
fontpropertiesNone or dict, optional


A dict of font properties. If fontproperties is given the default values for font size and weight are taken from the FontProperties defaults. rcParams["figure.titlesize"] (default: 'large') and rcParams["figure.titleweight"] (default: 'normal') are ignored in this case.  **kwargs

Additional kwargs are matplotlib.text.Text properties.
supylabel(t, **kwargs)[source]
 
Add a centered supylabel to the figure.  Parameters 
 
tstr


The supylabel text.  
xfloat, default: 0.02


The x location of the text in figure coordinates.  
yfloat, default: 0.5


The y location of the text in figure coordinates.  
horizontalalignment, ha{'center', 'left', 'right'}, default: left


The horizontal alignment of the text relative to (x, y).  
verticalalignment, va{'top', 'center', 'bottom', 'baseline'}, default: center


The vertical alignment of the text relative to (x, y).  
fontsize, sizedefault: rcParams["figure.titlesize"] (default: 'large')


The font size of the text. See Text.set_size for possible values.  
fontweight, weightdefault: rcParams["figure.titleweight"] (default: 'normal')


The font weight of the text. See Text.set_weight for possible values.    Returns 
 text

The Text instance of the supylabel.    Other Parameters 
 
fontpropertiesNone or dict, optional


A dict of font properties. If fontproperties is given the default values for font size and weight are taken from the FontProperties defaults. rcParams["figure.titlesize"] (default: 'large') and rcParams["figure.titleweight"] (default: 'normal') are ignored in this case.  **kwargs

Additional kwargs are matplotlib.text.Text properties.
text(x, y, s, fontdict=None, **kwargs)[source]
 
Add text to figure.  Parameters 
 
x, yfloat


The position to place the text. By default, this is in figure coordinates, floats in [0, 1]. The coordinate system can be changed using the transform keyword.  
sstr


The text string.  
fontdictdict, optional


A dictionary to override the default text properties. If not given, the defaults are determined by rcParams["font.*"]. Properties passed as kwargs override the corresponding ones given in fontdict.    Returns 
 Text
  Other Parameters 
 
**kwargsText properties


Other miscellaneous text parameters.   
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 properties for patches.FancyBboxPatch  
clip_box unknown  
clip_on unknown  
clip_path unknown  
color or c color  
figure Figure  
fontfamily or family {FONTNAME, 'serif', 'sans-serif', 'cursive', 'fantasy', 'monospace'}  
fontproperties or font or font_properties font_manager.FontProperties or str or pathlib.Path  
fontsize or size float or {'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'}  
fontstretch or stretch {a numeric value in range 0-1000, 'ultra-condensed', 'extra-condensed', 'condensed', 'semi-condensed', 'normal', 'semi-expanded', 'expanded', 'extra-expanded', 'ultra-expanded'}  
fontstyle or style {'normal', 'italic', 'oblique'}  
fontvariant or variant {'normal', 'small-caps'}  
fontweight or weight {a numeric value in range 0-1000, 'ultralight', 'light', 'normal', 'regular', 'book', 'medium', 'roman', 'semibold', 'demibold', 'demi', 'bold', 'heavy', 'extra bold', 'black'}  
gid str  
horizontalalignment or ha {'center', 'right', 'left'}  
in_layout bool  
label object  
linespacing float (multiple of font size)  
math_fontfamily str  
multialignment or ma {'left', 'right', 'center'}  
parse_math bool  
path_effects AbstractPathEffect  
picker None or bool or float or callable  
position (float, float)  
rasterized bool  
rotation float or {'vertical', 'horizontal'}  
rotation_mode {None, 'default', 'anchor'}  
sketch_params (scale: float, length: float, randomness: float)  
snap bool or None  
text object  
transform Transform  
transform_rotates_text bool  
url str  
usetex bool or None  
verticalalignment or va {'center', 'top', 'bottom', 'baseline', 'center_baseline'}  
visible bool  
wrap bool  
x float  
y float  
zorder float        See also  Axes.text
pyplot.text
tight_layout(*, pad=1.08, h_pad=None, w_pad=None, rect=None)[source]
 
Adjust the padding between and around subplots. To exclude an artist on the Axes from the bounding box calculation that determines the subplot parameters (i.e. legend, or annotation), set a.set_in_layout(False) for that artist.  Parameters 
 
padfloat, default: 1.08


Padding between the figure edge and the edges of subplots, as a fraction of the font size.  
h_pad, w_padfloat, default: pad


Padding (height/width) between edges of adjacent subplots, as a fraction of the font size.  
recttuple (left, bottom, right, top), default: (0, 0, 1, 1)


A rectangle in normalized figure coordinates into which the whole subplots area (including labels) will fit.      See also  Figure.set_tight_layout
pyplot.tight_layout
waitforbuttonpress(timeout=- 1)[source]
 
Blocking call to interact with the figure. Wait for user input and return True if a key was pressed, False if a mouse button was pressed and None if no input was given within timeout seconds. Negative values deactivate timeout.
set(*, agg_filter=<UNSET>, alpha=<UNSET>, animated=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, edgecolor=<UNSET>, facecolor=<UNSET>, frameon=<UNSET>, gid=<UNSET>, in_layout=<UNSET>, label=<UNSET>, linewidth=<UNSET>, path_effects=<UNSET>, picker=<UNSET>, rasterized=<UNSET>, sketch_params=<UNSET>, snap=<UNSET>, transform=<UNSET>, url=<UNSET>, visible=<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  
clip_box Bbox  
clip_on bool  
clip_path Patch or (Path, Transform) or None  
edgecolor color  
facecolor color  
figure Figure  
frameon bool  
gid str  
in_layout bool  
label object  
linewidth number  
path_effects AbstractPathEffect  
picker None or bool or float or callable  
rasterized bool  
sketch_params (scale: float, length: float, randomness: float)  
snap bool or None  
transform Transform  
url str  
visible bool  
zorder float
get_axes()[source]
 
List of Axes in the SubFigure. You can access and modify the Axes in the SubFigure 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 SubFigure.axes property and get_axes method are equivalent.
classmatplotlib.figure.SubplotParams(left=None, bottom=None, right=None, top=None, wspace=None, hspace=None)[source]
 
A class to hold the parameters for a subplot. Defaults are given by rcParams["figure.subplot.[name]"].  Parameters 
 
leftfloat


The position of the left edge of the subplots, as a fraction of the figure width.  
rightfloat


The position of the right edge of the subplots, as a fraction of the figure width.  
bottomfloat


The position of the bottom edge of the subplots, as a fraction of the figure height.  
topfloat


The position of the top edge of the subplots, as a fraction of the figure height.  
wspacefloat


The width of the padding between subplots, as a fraction of the average Axes width.  
hspacefloat


The height of the padding between subplots, as a fraction of the average Axes height.       update(left=None, bottom=None, right=None, top=None, wspace=None, hspace=None)[source]
 
Update the dimensions of the passed parameters. None means unchanged. 
   propertyvalidate[source]
update(left=None, bottom=None, right=None, top=None, wspace=None, hspace=None)[source]
 
Update the dimensions of the passed parameters. None means unchanged.
matplotlib.font_manager.afmFontProperty(fontpath, font)[source]
 
Extract information from an AFM font file.  Parameters 
 
fontAFM


The AFM font file from which information will be extracted.    Returns 
 FontEntry

The extracted font properties.
matplotlib.font_manager.findfont(prop, fontext='ttf', directory=None, fallback_to_default=True, rebuild_if_missing=True)[source]
 
Find a font that most closely matches the given font properties.  Parameters 
 
propstr or FontProperties


The font properties to search for. This can be either a FontProperties object or a string defining a fontconfig patterns.  
fontext{'ttf', 'afm'}, default: 'ttf'


The extension of the font file:  'ttf': TrueType and OpenType fonts (.ttf, .ttc, .otf) 'afm': Adobe Font Metrics (.afm)   
directorystr, optional


If given, only search this directory and its subdirectories.  
fallback_to_defaultbool


If True, will fallback to the default font family (usually "DejaVu Sans" or "Helvetica") if the first lookup hard-fails.  
rebuild_if_missingbool


Whether to rebuild the font cache and search again if the first match appears to point to a nonexisting font (i.e., the font cache contains outdated entries).    Returns 
 str

The filename of the best matching font.     Notes This performs a nearest neighbor search. Each font is given a similarity score to the target font properties. The first font with the highest score is returned. If no matches below a certain threshold are found, the default font (usually DejaVu Sans) is returned. The result is cached, so subsequent lookups don't have to perform the O(n) nearest neighbor search. See the W3C Cascading Style Sheet, Level 1 documentation for a description of the font finding algorithm.
matplotlib.font_manager.findSystemFonts(fontpaths=None, fontext='ttf')[source]
 
Search for fonts in the specified font paths. If no paths are given, will use a standard set of system paths, as well as the list of fonts tracked by fontconfig if fontconfig is installed and available. A list of TrueType fonts are returned by default with AFM fonts as an option.
classmatplotlib.font_manager.FontEntry(fname:str='', name:str='', style:str='normal', variant:str='normal', weight:str='normal', stretch:str='normal', size:str='medium')
 
A class for storing Font properties. It is used when populating the font lookup dictionary.
addfont(path)[source]
 
Cache the properties of the font at path to make it available to the FontManager. The type of font is inferred from the path suffix.  Parameters 
 
pathstr or path-like
findfont(prop, fontext='ttf', directory=None, fallback_to_default=True, rebuild_if_missing=True)[source]
 
Find a font that most closely matches the given font properties.  Parameters 
 
propstr or FontProperties


The font properties to search for. This can be either a FontProperties object or a string defining a fontconfig patterns.  
fontext{'ttf', 'afm'}, default: 'ttf'


The extension of the font file:  'ttf': TrueType and OpenType fonts (.ttf, .ttc, .otf) 'afm': Adobe Font Metrics (.afm)   
directorystr, optional


If given, only search this directory and its subdirectories.  
fallback_to_defaultbool


If True, will fallback to the default font family (usually "DejaVu Sans" or "Helvetica") if the first lookup hard-fails.  
rebuild_if_missingbool


Whether to rebuild the font cache and search again if the first match appears to point to a nonexisting font (i.e., the font cache contains outdated entries).    Returns 
 str

The filename of the best matching font.     Notes This performs a nearest neighbor search. Each font is given a similarity score to the target font properties. The first font with the highest score is returned. If no matches below a certain threshold are found, the default font (usually DejaVu Sans) is returned. The result is cached, so subsequent lookups don't have to perform the O(n) nearest neighbor search. See the W3C Cascading Style Sheet, Level 1 documentation for a description of the font finding algorithm.
score_family(families, family2)[source]
 
Return a match score between the list of font families in families and the font family name family2. An exact match at the head of the list returns 0.0. A match further down the list will return between 0 and 1. No match will return 1.0.
score_size(size1, size2)[source]
 
Return a match score between size1 and size2. If size2 (the size specified in the font file) is 'scalable', this function always returns 0.0, since any font size can be generated. Otherwise, the result is the absolute distance between size1 and size2, normalized so that the usual range of font sizes (6pt - 72pt) will lie between 0.0 and 1.0.
score_stretch(stretch1, stretch2)[source]
 
Return a match score between stretch1 and stretch2. The result is the absolute value of the difference between the CSS numeric values of stretch1 and stretch2, normalized between 0.0 and 1.0.
score_style(style1, style2)[source]
 
Return a match score between style1 and style2. An exact match returns 0.0. A match between 'italic' and 'oblique' returns 0.1. No match returns 1.0.
score_variant(variant1, variant2)[source]
 
Return a match score between variant1 and variant2. An exact match returns 0.0, otherwise 1.0.
score_weight(weight1, weight2)[source]
 
Return a match score between weight1 and weight2. The result is 0.0 if both weight1 and weight 2 are given as strings and have the same value. Otherwise, the result is the absolute value of the difference between the CSS numeric values of weight1 and weight2, normalized between 0.05 and 1.0.
set_default_weight(weight)[source]
 
Set the default font weight. The initial value is 'normal'.
get_family()[source]
 
Return a list of font names that comprise the font family.
get_fontconfig_pattern()[source]
 
Get a fontconfig pattern suitable for looking up the font as specified with fontconfig's fc-match utility. This support does not depend on fontconfig; we are merely borrowing its pattern syntax for use here.
get_math_fontfamily()[source]
 
Return the name of the font family used for math text. The default font is rcParams["mathtext.fontset"] (default: 'dejavusans').
get_name()[source]
 
Return the name of the font that best matches the font properties.
get_slant()[source]
 
Return the font style. Values are: 'normal', 'italic' or 'oblique'.
get_stretch()[source]
 
Return the font stretch or width. Options are: 'ultra-condensed', 'extra-condensed', 'condensed', 'semi-condensed', 'normal', 'semi-expanded', 'expanded', 'extra-expanded', 'ultra-expanded'.
get_style()[source]
 
Return the font style. Values are: 'normal', 'italic' or 'oblique'.
get_variant()[source]
 
Return the font variant. Values are: 'normal' or 'small-caps'.
get_weight()[source]
 
Set the font weight. Options are: A numeric value in the range 0-1000 or one of 'light', 'normal', 'regular', 'book', 'medium', 'roman', 'semibold', 'demibold', 'demi', 'bold', 'heavy', 'extra bold', 'black'
set_family(family)[source]
 
Change the font family. May be either an alias (generic name is CSS parlance), such as: 'serif', 'sans-serif', 'cursive', 'fantasy', or 'monospace', a real font name or a list of real font names. Real font names are not supported when rcParams["text.usetex"] (default: False) is True.
set_file(file)[source]
 
Set the filename of the fontfile to use. In this case, all other properties will be ignored.
set_fontconfig_pattern(pattern)[source]
 
Set the properties by parsing a fontconfig pattern. This support does not depend on fontconfig; we are merely borrowing its pattern syntax for use here.
set_math_fontfamily(fontfamily)[source]
 
Set the font family for text in math mode. If not set explicitly, rcParams["mathtext.fontset"] (default: 'dejavusans') will be used.  Parameters 
 
fontfamilystr


The name of the font family. Available font families are defined in the matplotlibrc.template file here      See also  text.Text.get_math_fontfamily
set_name(family)[source]
 
Change the font family. May be either an alias (generic name is CSS parlance), such as: 'serif', 'sans-serif', 'cursive', 'fantasy', or 'monospace', a real font name or a list of real font names. Real font names are not supported when rcParams["text.usetex"] (default: False) is True.
set_size(size)[source]
 
Set the font size. Either an relative value of 'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large' or an absolute font size, e.g., 12.
set_slant(style)[source]
 
Set the font style. Values are: 'normal', 'italic' or 'oblique'.
set_stretch(stretch)[source]
 
Set the font stretch or width. Options are: 'ultra-condensed', 'extra-condensed', 'condensed', 'semi-condensed', 'normal', 'semi-expanded', 'expanded', 'extra-expanded' or 'ultra-expanded', or a numeric value in the range 0-1000.
set_style(style)[source]
 
Set the font style. Values are: 'normal', 'italic' or 'oblique'.
set_variant(variant)[source]
 
Set the font variant. Values are: 'normal' or 'small-caps'.
set_weight(weight)[source]
 
Set the font weight. May be either a numeric value in the range 0-1000 or one of 'ultralight', 'light', 'normal', 'regular', 'book', 'medium', 'roman', 'semibold', 'demibold', 'demi', 'bold', 'heavy', 'extra bold', 'black'
matplotlib.font_manager.get_font(filename, hinting_factor=None)[source]
matplotlib.font_manager.get_fontconfig_fonts(fontext='ttf')[source]
 
[Deprecated] List font filenames known to fc-list having the given extension. Notes  Deprecated since version 3.5.
matplotlib.font_manager.get_fontext_synonyms(fontext)[source]
 
Return a list of file extensions extensions that are synonyms for the given file extension fileext.
matplotlib.font_manager.is_opentype_cff_font(filename)[source]
 
Return whether the given font is a Postscript Compact Font Format Font embedded in an OpenType wrapper. Used by the PostScript and PDF backends that can not subset these fonts.
matplotlib.font_manager.json_dump(data, filename)[source]
 
Dump FontManager data as JSON to the file named filename.  See also  json_load
  Notes File paths that are children of the Matplotlib data path (typically, fonts shipped with Matplotlib) are stored relative to that data path (to remain valid across virtualenvs). This function temporarily locks the output file to prevent multiple processes from overwriting one another's output.
matplotlib.font_manager.json_load(filename)[source]
 
Load a FontManager from the JSON file named filename.  See also  json_dump