neulab/docprompting-conala huggingface dataset:
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 SubFigure object.      See also  Figure.subfigures
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 list (or ndarray) of Axes to align the labels. Default is to align all Axes on the figure.      See also  matplotlib.figure.Figure.align_xlabels
matplotlib.figure.Figure.align_ylabels
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 their label on the bottom and that have the same bottom-most subplot row. If the label is on the top, it is aligned with labels on Axes with the same top-most row.  Parameters 
 
axslist of Axes


Optional list of (or ndarray) Axes to align the xlabels. Default is to align all Axes on the figure.      See also  matplotlib.figure.Figure.align_ylabels
matplotlib.figure.Figure.align_labels
  Notes This assumes that axs are from the same GridSpec, so that their SubplotSpec positions correspond to figure positions. Examples Example with rotated xtick labels: fig, axs = plt.subplots(1, 2)
for tick in axs[0].get_xticklabels():
    tick.set_rotation(55)
axs[0].set_xlabel('XLabel 0')
axs[1].set_xlabel('XLabel 1')
fig.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 their label on the left and that have the same left-most subplot column. If the label is on the right, it is aligned with labels on Axes with the same right-most column.  Parameters 
 
axslist of Axes


Optional list (or ndarray) of Axes to align the ylabels. Default is to align all Axes on the figure.      See also  matplotlib.figure.Figure.align_xlabels
matplotlib.figure.Figure.align_labels
  Notes This assumes that axs are from the same GridSpec, so that their SubplotSpec positions correspond to figure positions. Examples Example with large yticks labels: fig, axs = plt.subplots(2, 1)
axs[0].plot(np.arange(0, 1000, 50))
axs[0].set_ylabel('YLabel 0')
axs[1].set_ylabel('YLabel 1')
fig.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 the bottom subplot and turn them off on other subplots, as well as turn off xlabels.  Parameters 
 
bottomfloat, default: 0.2


The bottom of the subplots for subplots_adjust.  
rotationfloat, default: 30 degrees


The rotation angle of the xtick labels in degrees.  
ha{'left', 'center', 'right'}, default: 'right'


The horizontal alignment of the xticklabels.  
which{'major', 'minor', 'both'}, default: 'major'


Selects which ticklabels to rotate.
clear(keep_observers=False)[source]
 
Clear the figure -- synonym for clf.
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.
contains(mouseevent)[source]
 
Test whether the mouse event occurred on the figure.  Returns 
 bool, {}
delaxes(ax)[source]
 
Remove the Axes ax from the figure; update the current Axes.
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.
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).
execute_constrained_layout(renderer=None)[source]
 
Use layoutgrid to determine pos positions within Axes. See also set_constrained_layout_pads.  Returns 
 
layoutgridprivate debugging object
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 shapes:  MxN: luminance (grayscale) values MxNx3: RGB values MxNx4: RGBA values   
xo, yoint


The x/y image offset in pixels.  
alphaNone or float


The alpha blending value.  
normmatplotlib.colors.Normalize


A Normalize instance to map the luminance to the interval [0, 1].  
cmapstr or matplotlib.colors.Colormap, default: rcParams["image.cmap"] (default: 'viridis')


The colormap to use.  
vmin, vmaxfloat


If norm is not given, these values set the data limits for the colormap.  
origin{'upper', 'lower'}, default: rcParams["image.origin"] (default: 'upper')


Indicates where the [0, 0] index of the array is in the upper left or lower left corner of the axes.  
resizebool


If True, resize the figure to match the given image size.    Returns 
 matplotlib.image.FigureImage
  Other Parameters 
 **kwargs

Additional kwargs are Artist kwargs passed on to FigureImage.     Notes figimage complements the Axes image (imshow) which will be resampled to fit the current Axes. If you want a resampled image to fill the entire figure, you can define an Axes with extent [0, 0, 1, 1]. Examples f = plt.figure()
nx = int(f.get_figwidth() * f.dpi)
ny = int(f.get_figheight() * f.dpi)
data = np.random.random((ny, nx))
f.figimage(data)
plt.show()
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 pyplot.get_fignums() is empty.) The following kwargs are supported for ensuring the returned Axes adheres to the given projection etc., and for Axes creation if the active Axes does not exist:   
Property Description   
adjustable {'box', 'datalim'}  
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  
anchor (float, float) or {'C', 'SW', 'S', 'SE', 'E', 'NE', ...}  
animated bool  
aspect {'auto', 'equal'} or float  
autoscale_on bool  
autoscalex_on bool  
autoscaley_on bool  
axes_locator Callable[[Axes, Renderer], Bbox]  
axisbelow bool or 'line'  
box_aspect float or None  
clip_box Bbox  
clip_on bool  
clip_path Patch or (Path, Transform) or None  
facecolor or fc color  
figure Figure  
frame_on bool  
gid str  
in_layout bool  
label object  
navigate bool  
navigate_mode unknown  
path_effects AbstractPathEffect  
picker None or bool or float or callable  
position [left, bottom, width, height] or Bbox  
prop_cycle unknown  
rasterization_zorder float or None  
rasterized bool  
sketch_params (scale: float, length: float, randomness: float)  
snap bool or None  
title str  
transform Transform  
url str  
visible bool  
xbound unknown  
xlabel str  
xlim (bottom: float, top: float)  
xmargin float greater than -0.5  
xscale {"linear", "log", "symlog", "logit", ...} or ScaleBase  
xticklabels unknown  
xticks unknown  
ybound unknown  
ylabel str  
ylim (bottom: float, top: float)  
ymargin float greater than -0.5  
yscale {"linear", "log", "symlog", "logit", ...} or ScaleBase  
yticklabels unknown  
yticks unknown  
zorder float
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.
get_constrained_layout()[source]
 
Return whether constrained layout is being used. See Constrained Layout Guide.
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.
get_dpi()[source]
 
Return the resolution in dots per inch as a float.
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().
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 obtained by multiplying with Figure.dpi.
get_tight_layout()[source]
 
Return whether tight_layout is called when drawing.
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 subclass


renderer that will be used to draw the figures (i.e. fig.canvas.get_renderer())  
bbox_extra_artistslist of Artist or None


List of artists to include in the tight bounding box. If None (default), then all artist children of each Axes are included in the tight bounding box.    Returns 
 BboxBase

containing the bounding box (in figure inches).
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 results will not update if the artist window extent of the artist changes. The extent can change due to any changes in the transform stack, such as changing the axes limits, the figure size, or the canvas used (as is done when saving a figure). This can lead to unexpected behavior where interactive figures will look fine on the screen, but will save incorrectly.
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:  Add a point. Remove the most recently added point. Stop the interaction and return the points added so far.  The actions are assigned to mouse buttons via the arguments mouse_add, mouse_pop and mouse_stop.  Parameters 
 
nint, default: 1


Number of mouse clicks to accumulate. If negative, accumulate clicks until the input is terminated manually.  
timeoutfloat, default: 30 seconds


Number of seconds to wait before timing out. If zero or negative will never timeout.  
show_clicksbool, default: True


If True, show a red cross at the location of each click.  
mouse_addMouseButton or None, default: MouseButton.LEFT


Mouse button used to add points.  
mouse_popMouseButton or None, default: MouseButton.RIGHT


Mouse button used to remove the most recently added point.  
mouse_stopMouseButton or None, default: MouseButton.MIDDLE


Mouse button used to stop input.    Returns 
 list of tuples

A list of the clicked (x, y) coordinates.     Notes The keyboard can also be used to select points in case your mouse does not have one or more of the buttons. The delete and backspace keys act like right clicking (i.e., remove last point), the enter key terminates input and any other key (not already used by the window manager) selects a point.
sca(a)[source]
 
Set the current Axes to be a and return a.
set(*, agg_filter=<UNSET>, alpha=<UNSET>, animated=<UNSET>, canvas=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, constrained_layout=<UNSET>, constrained_layout_pads=<UNSET>, dpi=<UNSET>, edgecolor=<UNSET>, facecolor=<UNSET>, figheight=<UNSET>, figwidth=<UNSET>, frameon=<UNSET>, gid=<UNSET>, in_layout=<UNSET>, label=<UNSET>, linewidth=<UNSET>, path_effects=<UNSET>, picker=<UNSET>, rasterized=<UNSET>, size_inches=<UNSET>, sketch_params=<UNSET>, snap=<UNSET>, tight_layout=<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  
canvas FigureCanvas  
clip_box Bbox  
clip_on bool  
clip_path Patch or (Path, Transform) or None  
constrained_layout bool or dict or None  
constrained_layout_pads float, default: rcParams["figure.constrained_layout.w_pad"] (default: 0.04167)  
dpi float  
edgecolor color  
facecolor color  
figheight float  
figure Figure  
figwidth float  
frameon bool  
gid str  
in_layout bool  
label object  
linewidth number  
path_effects AbstractPathEffect  
picker None or bool or float or callable  
rasterized bool  
size_inches (float, float) or float  
sketch_params (scale: float, length: float, randomness: float)  
snap bool or None  
tight_layout bool or dict with keys "pad", "w_pad", "h_pad", "rect" or None  
transform Transform  
url str  
visible bool  
zorder float
set_alpha(alpha)[source]
 
Set the alpha value used for blending - not supported on all backends.  Parameters 
 
alphascalar or None


alpha must be within the 0-1 range, inclusive.
set_canvas(canvas)[source]
 
Set the canvas that contains the figure  Parameters 
 
canvasFigureCanvas
set_constrained_layout(constrained)[source]
 
Set whether constrained_layout is used upon drawing. If None, rcParams["figure.constrained_layout.use"] (default: False) value will be used. When providing a dict containing the keys w_pad, h_pad the default constrained_layout paddings will be overridden. These pads are in inches and default to 3.0/72.0. w_pad is the width padding and h_pad is the height padding. See Constrained Layout Guide.  Parameters 
 
constrainedbool or dict or None
set_constrained_layout_pads(*, w_pad=None, h_pad=None, wspace=None, hspace=None)[source]
 
Set padding for constrained_layout. Tip: The parameters can be passed from a dictionary by using fig.set_constrained_layout(**pad_dict). See Constrained Layout Guide.  Parameters 
 
w_padfloat, default: rcParams["figure.constrained_layout.w_pad"] (default: 0.04167)


Width padding in inches. This is the pad around Axes and is meant to make sure there is enough room for fonts to look good. Defaults to 3 pts = 0.04167 inches  
h_padfloat, default: rcParams["figure.constrained_layout.h_pad"] (default: 0.04167)


Height padding in inches. Defaults to 3 pts.  
wspacefloat, default: rcParams["figure.constrained_layout.wspace"] (default: 0.02)


Width padding between subplots, expressed as a fraction of the subplot width. The total padding ends up being w_pad + wspace.  
hspacefloat, default: rcParams["figure.constrained_layout.hspace"] (default: 0.02)


Height padding between subplots, expressed as a fraction of the subplot width. The total padding ends up being h_pad + hspace.
set_dpi(val)[source]
 
Set the resolution of the figure in dots-per-inch.  Parameters 
 
valfloat
set_edgecolor(color)[source]
 
Set the edge color of the Figure rectangle.  Parameters 
 
colorcolor
set_facecolor(color)[source]
 
Set the face color of the Figure rectangle.  Parameters 
 
colorcolor
set_figheight(val, forward=True)[source]
 
Set the height of the figure in inches.  Parameters 
 
valfloat


forwardbool


See set_size_inches.      See also  matplotlib.figure.Figure.set_figwidth
matplotlib.figure.Figure.set_size_inches
set_figwidth(val, forward=True)[source]
 
Set the width of the figure in inches.  Parameters 
 
valfloat


forwardbool


See set_size_inches.      See also  matplotlib.figure.Figure.set_figheight
matplotlib.figure.Figure.set_size_inches
set_frameon(b)[source]
 
Set the figure's background patch visibility, i.e. whether the figure background will be drawn. Equivalent to Figure.patch.set_visible().  Parameters 
 
bbool
set_linewidth(linewidth)[source]
 
Set the line width of the Figure rectangle.  Parameters 
 
linewidthnumber
set_size_inches(w, h=None, forward=True)[source]
 
Set the figure size in inches. Call signatures: fig.set_size_inches(w, h)  # OR
fig.set_size_inches((w, h))
  Parameters 
 
w(float, float) or float


Width and height in inches (if height not specified as a separate argument) or width.  
hfloat


Height in inches.  
forwardbool, default: True


If True, the canvas size is automatically updated, e.g., you can resize the figure window from the shell.      See also  matplotlib.figure.Figure.get_size_inches
matplotlib.figure.Figure.set_figwidth
matplotlib.figure.Figure.set_figheight
  Notes To transform from pixels to inches divide by Figure.dpi.
set_tight_layout(tight)[source]
 
Set whether and how tight_layout is called when drawing.  Parameters 
 
tightbool or dict with keys "pad", "w_pad", "h_pad", "rect" or None


If a bool, sets whether to call tight_layout upon drawing. If None, use rcParams["figure.autolayout"] (default: False) instead. If a dict, pass it as kwargs to tight_layout, overriding the default paddings.
show(warn=True)[source]
 
If using a GUI backend with pyplot, display the figure window. If the figure was not created using figure, it will lack a FigureManagerBase, and this method will raise an AttributeError.  Warning This does not manage an GUI event loop. Consequently, the figure may only be shown briefly or not shown at all if you or your environment are not managing an event loop. Proper use cases for Figure.show include running this from a GUI application or an IPython shell. If you're running a pure python shell or executing a non-GUI python script, you should use matplotlib.pyplot.show instead, which takes care of managing the event loop for you.   Parameters 
 
warnbool, default: True


If True and we are not running headless (i.e. on Linux with an unset DISPLAY), issue warning when called on a non-GUI backend.
subfigures(nrows=1, ncols=1, squeeze=True, wspace=None, hspace=None, width_ratios=None, height_ratios=None, **kwargs)[source]
 
Add a subfigure to this figure or subfigure. A subfigure has the same artist methods as a figure, and is logically the same as a figure, but cannot print itself. See Figure subfigures.  Parameters 
 
nrows, ncolsint, default: 1


Number of rows/columns of the subfigure grid.  
squeezebool, default: True


If True, extra dimensions are squeezed out from the returned array of subfigures.  
wspace, hspacefloat, default: None


The amount of width/height reserved for space between subfigures, expressed as a fraction of the average subfigure width/height. If not given, the values will be inferred from a figure or rcParams when necessary.  
width_ratiosarray-like of length ncols, optional


Defines the relative widths of the columns. Each column gets a relative width of width_ratios[i] / sum(width_ratios). If not given, all columns will have the same width.  
height_ratiosarray-like of length nrows, optional


Defines the relative heights of the rows. Each row gets a relative height of height_ratios[i] / sum(height_ratios). If not given, all rows will have the same height.
subplot_mosaic(mosaic, *, sharex=False, sharey=False, subplot_kw=None, gridspec_kw=None, empty_sentinel='.')[source]
 
Build a layout of Axes based on ASCII art or nested lists. This is a helper function to build complex GridSpec layouts visually.  Note This API is provisional and may be revised in the future based on early user feedback.   Parameters 
 
mosaiclist of list of {hashable or nested} or str


A visual layout of how you want your Axes to be arranged labeled as strings. For example x = [['A panel', 'A panel', 'edge'],
     ['C panel', '.',       'edge']]
 produces 4 Axes:  'A panel' which is 1 row high and spans the first two columns 'edge' which is 2 rows high and is on the right edge 'C panel' which in 1 row and 1 column wide in the bottom left a blank space 1 row and 1 column wide in the bottom center  Any of the entries in the layout can be a list of lists of the same form to create nested layouts. If input is a str, then it can either be a multi-line string of the form '''
AAE
C.E
'''
 where each character is a column and each line is a row. Or it can be a single-line string where rows are separated by ;: 'AB;CC'
 The string notation allows only single character Axes labels and does not support nesting but is very terse.  
sharex, shareybool, default: False


If True, the x-axis (sharex) or y-axis (sharey) will be shared among all subplots. In that case, tick label visibility and axis units behave as for subplots. If False, each subplot's x- or y-axis will be independent.  
subplot_kwdict, optional


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


Dictionary with keywords passed to the GridSpec constructor used to create the grid the subplots are placed on.  
empty_sentinelobject, optional


Entry in the layout to mean "leave this space empty". Defaults to '.'. Note, if layout is a string, it is processed via inspect.cleandoc to remove leading white space, which may interfere with using white-space as the empty sentinel.    Returns 
 dict[label, Axes]

A dictionary mapping the labels to the Axes objects. The order of the axes is left-to-right and top-to-bottom of their position in the total layout.