neulab/docprompting-conala huggingface dataset:
matplotlib.cbook.to_filehandle(fname, flag='r', return_opened=False, encoding=None)[source]
 
Convert a path to an open file handle or pass-through a file-like object. Consider using open_file_cm instead, as it allows one to properly close newly created file objects more easily.  Parameters 
 
fnamestr or path-like or file-like


If str or os.PathLike, the file is opened using the flags specified by flag and encoding. If a file-like object, it is passed through.  
flagstr, default: 'r'


Passed as the mode argument to open when fname is str or os.PathLike; ignored if fname is file-like.  
return_openedbool, default: False


If True, return both the file object and a boolean indicating whether this was a new file (that the caller needs to close). If False, return only the new file.  
encodingstr or None, default: None


Passed as the mode argument to open when fname is str or os.PathLike; ignored if fname is file-like.    Returns 
 
fhfile-like


openedbool


opened is only returned if return_opened is True.
matplotlib.cbook.violin_stats(X, method, points=100, quantiles=None)[source]
 
Return a list of dictionaries of data which can be used to draw a series of violin plots. See the Returns section below to view the required keys of the dictionary. Users can skip this function and pass a user-defined set of dictionaries with the same keys to violinplot instead of using Matplotlib to do the calculations. See the Returns section below for the keys that must be present in the dictionaries.  Parameters 
 
Xarray-like


Sample data that will be used to produce the gaussian kernel density estimates. Must have 2 or fewer dimensions.  
methodcallable


The method used to calculate the kernel density estimate for each column of data. When called via method(v, coords), it should return a vector of the values of the KDE evaluated at the values specified in coords.  
pointsint, default: 100


Defines the number of points to evaluate each of the gaussian kernel density estimates at.  
quantilesarray-like, default: None


Defines (if not None) a list of floats in interval [0, 1] for each column of data, which represents the quantiles that will be rendered for that column of data. Must have 2 or fewer dimensions. 1D array will be treated as a singleton list containing them.    Returns 
 list of dict

A list of dictionaries containing the results for each column of data. The dictionaries contain at least the following:  coords: A list of scalars containing the coordinates this particular kernel density estimate was evaluated at. vals: A list of scalars containing the values of the kernel density estimate at each of the coordinates given in coords. mean: The mean value for this column of data. median: The median value for this column of data. min: The minimum value for this column of data. max: The maximum value for this column of data. quantiles: The quantile values for this column of data.
matplotlib.cbook.warn_deprecated(*args, **kwargs)[source]
 
[Deprecated] Notes  Deprecated since version 3.4:
classmatplotlib.cm.ColormapRegistry(cmaps)[source]
 
Bases: collections.abc.Mapping Container for colormaps that are known to Matplotlib by name.  Experimental While we expect the API to be final, we formally mark it as experimental for 3.5 because we want to keep the option to still adapt the API for 3.6 should the need arise.  The universal registry instance is matplotlib.colormaps. There should be no need for users to instantiate ColormapRegistry themselves. Read access uses a dict-like interface mapping names to Colormaps: import matplotlib as mpl
cmap = mpl.colormaps['viridis']
 Returned Colormaps are copies, so that their modification does not change the global definition of the colormap. Additional colormaps can be added via ColormapRegistry.register: mpl.colormaps.register(my_colormap)
   register(cmap, *, name=None, force=False)[source]
 
Register a new colormap. The colormap name can then be used as a string argument to any cmap parameter in Matplotlib. It is also available in pyplot.get_cmap. The colormap registry stores a copy of the given colormap, so that future changes to the original colormap instance do not affect the registered colormap. Think of this as the registry taking a snapshot of the colormap at registration.  Parameters 
 
cmapmatplotlib.colors.Colormap


The colormap to register.  
namestr, optional


The name for the colormap. If not given, cmap.name is used.  force: bool, default: False

If False, a ValueError is raised if trying to overwrite an already registered name. True supports overwriting registered colormaps other than the builtin colormaps.
register(cmap, *, name=None, force=False)[source]
 
Register a new colormap. The colormap name can then be used as a string argument to any cmap parameter in Matplotlib. It is also available in pyplot.get_cmap. The colormap registry stores a copy of the given colormap, so that future changes to the original colormap instance do not affect the registered colormap. Think of this as the registry taking a snapshot of the colormap at registration.  Parameters 
 
cmapmatplotlib.colors.Colormap


The colormap to register.  
namestr, optional


The name for the colormap. If not given, cmap.name is used.  force: bool, default: False

If False, a ValueError is raised if trying to overwrite an already registered name. True supports overwriting registered colormaps other than the builtin colormaps.
matplotlib.cm.get_cmap(name=None, lut=None)[source]
 
Get a colormap instance, defaulting to rc values if name is None. Colormaps added with register_cmap() take precedence over built-in colormaps.  Parameters 
 
namematplotlib.colors.Colormap or str or None, default: None


If a Colormap instance, it will be returned. Otherwise, the name of a colormap known to Matplotlib, which will be resampled by lut. The default, None, means rcParams["image.cmap"] (default: 'viridis').  
lutint or None, default: None


If name is not already a Colormap instance and lut is not None, the colormap will be resampled to have lut entries in the lookup table.     Notes Currently, this returns the global colormap object, which is deprecated. In Matplotlib 3.5, you will no longer be able to modify the global colormaps in-place.
matplotlib.cm.register_cmap(name=None, cmap=None, *, override_builtin=False)[source]
 
Add a colormap to the set recognized by get_cmap(). Register a new colormap to be accessed by name LinearSegmentedColormap('swirly', data, lut)
register_cmap(cmap=swirly_cmap)
  Parameters 
 
namestr, optional


The name that can be used in get_cmap() or rcParams["image.cmap"] (default: 'viridis') If absent, the name will be the name attribute of the cmap.  
cmapmatplotlib.colors.Colormap


Despite being the second argument and having a default value, this is a required argument.  
override_builtinbool


Allow built-in colormaps to be overridden by a user-supplied colormap. Please do not use this unless you are sure you need it.     Notes Registering a colormap stores a reference to the colormap object which can currently be modified and inadvertently change the global colormap state. This behavior is deprecated and in Matplotlib 3.5 the registered colormap will be immutable.
autoscale()[source]
 
Autoscale the scalar limits on the norm instance using the current array
autoscale_None()[source]
 
Autoscale the scalar limits on the norm instance using the current array, changing only limits that are None
changed()[source]
 
Call this whenever the mappable is changed to notify all the callbackSM listeners to the 'changed' signal.
colorbar
 
The last colorbar associated with this ScalarMappable. May be None.
get_alpha()[source]
 
 Returns 
 float

Always returns 1.
get_array()[source]
 
Return the array of values, that are mapped to colors. The base class ScalarMappable does not make any assumptions on the dimensionality and shape of the array.
get_clim()[source]
 
Return the values (min, max) that are mapped to the colormap limits.
set_array(A)[source]
 
Set the value array from array-like A.  Parameters 
 
Aarray-like or None


The values that are mapped to colors. The base class ScalarMappable does not make any assumptions on the dimensionality and shape of the value array A.
set_clim(vmin=None, vmax=None)[source]
 
Set the norm limits for image scaling.  Parameters 
 
vmin, vmaxfloat


The limits. The limits may also be passed as a tuple (vmin, vmax) as a single positional argument.
set_cmap(cmap)[source]
 
Set the colormap for luminance data.  Parameters 
 
cmapColormap or str or None
set_norm(norm)[source]
 
Set the normalization instance.  Parameters 
 
normNormalize or None

   Notes If there are any colorbars using the mappable for this norm, setting the norm of the mappable will reset the norm, locator, and formatters on the colorbar to default.
to_rgba(x, alpha=None, bytes=False, norm=True)[source]
 
Return a normalized rgba array corresponding to x. In the normal case, x is a 1D or 2D sequence of scalars, and the corresponding ndarray of rgba values will be returned, based on the norm and colormap set for this ScalarMappable. There is one special case, for handling images that are already rgb or rgba, such as might have been read from an image file. If x is an ndarray with 3 dimensions, and the last dimension is either 3 or 4, then it will be treated as an rgb or rgba array, and no mapping will be done. The array can be uint8, or it can be floating point with values in the 0-1 range; otherwise a ValueError will be raised. If it is a masked array, the mask will be ignored. If the last dimension is 3, the alpha kwarg (defaulting to 1) will be used to fill in the transparency. If the last dimension is 4, the alpha kwarg is ignored; it does not replace the pre-existing alpha. A ValueError will be raised if the third dimension is other than 3 or 4. In either case, if bytes is False (default), the rgba array will be floats in the 0-1 range; if it is True, the returned rgba array will be uint8 in the 0 to 255 range. If norm is False, no normalization of the input data is performed, and it is assumed to be in the range (0-1).
matplotlib.cm.unregister_cmap(name)[source]
 
Remove a colormap recognized by get_cmap(). You may not remove built-in colormaps. If the named colormap is not registered, returns with no error, raises if you try to de-register a default colormap.  Warning Colormap names are currently a shared namespace that may be used by multiple packages. Use unregister_cmap only if you know you have registered that name before. In particular, do not unregister just in case to clean the name before registering a new colormap.   Parameters 
 
namestr


The name of the colormap to be un-registered    Returns 
 ColorMap or None

If the colormap was registered, return it if not return None    Raises 
 ValueError

If you try to de-register a default built-in colormap.
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.    Returns 
 int

The observer id associated with the callback. This id can be used for removing the callback with remove_callback later.      See also  remove_callback
contains(mouseevent)[source]
 
Test whether the mouse event occurred in the collection. Returns bool, dict(ind=itemlist), where every item in itemlist contains the event.
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.
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.
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 result will only contain artists for which the function returns True. A class instance: e.g., Line2D. The result will only contain artists of this class or its subclasses (isinstance check).   
include_selfbool


Include self in the list to be checked for a match.    Returns 
 list of Artist
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-separated string enclosed in square brackets, unless the artist has an associated colorbar, in which case scalar values are formatted using the colorbar's formatter.  See also  get_cursor_data
get_agg_filter()[source]
 
Return filter function to be used for agg filter.
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. The default implementation just returns None. Subclasses can override the method and return arbitrary data. However, when doing so, they must ensure that format_cursor_data can convert the data to a string representation. The only current use case is displaying the z-value of an AxesImage in the status bar of a plot window, while moving the mouse.  Parameters 
 
eventmatplotlib.backend_bases.MouseEvent

    See also  format_cursor_data
get_edgecolors()[source]
 
Alias for get_edgecolor.
get_facecolors()[source]
 
Alias for get_facecolor.
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').
get_offset_transform()[source]
 
Return the Transform instance used by this artist offset.
get_picker()[source]
 
Return the picking behavior of the artist. The possible values are described in set_picker.  See also  
set_picker, pickable, pick
get_rasterized()[source]
 
Return whether the artist is to be rasterized.
get_sizes()[source]
 
Return the sizes ('areas') of the elements in the collection.  Returns 
 array

The 'area' of each element.
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 shrunken or expanded.  Returns None if no sketch parameters were set.
get_snap()[source]
 
Return the snap setting. See set_snap for details.
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.
get_urls()[source]
 
Return a list of URLs, one for each element of the collection. The list contains None for elements without a URL. See Hyperlinks for an example.
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 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.
is_transform_set()[source]
 
Return whether the Artist has an explicitly set transform. This is True after set_transform has been called.
pchanged()[source]
 
Call all of the registered callbacks. This function is triggered internally when a property is changed.  See also  add_callback
remove_callback
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
pickable()[source]
 
Return whether the artist is pickable.  See also  
set_picker, get_picker, pick
remove()[source]
 
Remove the artist from the figure if possible. The effect will not be visible until the figure is redrawn, e.g., with FigureCanvasBase.draw_idle. Call relim to update the axes limits if desired. Note: relim will not see collections even if the collection was added to the axes with autolim = True. Note: there is no support for removing the artist's legend entry.
remove_callback(oid)[source]
 
Remove a callback based on its observer id.  See also  add_callback
set(*, agg_filter=<UNSET>, alpha=<UNSET>, animated=<UNSET>, antialiased=<UNSET>, array=<UNSET>, capstyle=<UNSET>, clim=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, cmap=<UNSET>, color=<UNSET>, edgecolor=<UNSET>, facecolor=<UNSET>, gid=<UNSET>, hatch=<UNSET>, in_layout=<UNSET>, joinstyle=<UNSET>, label=<UNSET>, linestyle=<UNSET>, linewidth=<UNSET>, norm=<UNSET>, offset_transform=<UNSET>, offsets=<UNSET>, path_effects=<UNSET>, picker=<UNSET>, pickradius=<UNSET>, rasterized=<UNSET>, sizes=<UNSET>, sketch_params=<UNSET>, snap=<UNSET>, transform=<UNSET>, url=<UNSET>, urls=<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 array-like or scalar or None  
animated bool  
antialiased or aa or antialiaseds bool or list of bools  
array array-like or None  
capstyle CapStyle or {'butt', 'projecting', 'round'}  
clim (vmin: float, vmax: float)  
clip_box Bbox  
clip_on bool  
clip_path Patch or (Path, Transform) or None  
cmap Colormap or str or None  
color color or list of rgba tuples  
edgecolor or ec or edgecolors color or list of colors or 'face'  
facecolor or facecolors or fc color or list of colors  
figure Figure  
gid str  
hatch {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '*'}  
in_layout bool  
joinstyle JoinStyle or {'miter', 'round', 'bevel'}  
label object  
linestyle or dashes or linestyles or ls str or tuple or list thereof  
linewidth or linewidths or lw float or list of floats  
norm Normalize or None  
offset_transform Transform  
offsets (N, 2) or (2,) array-like  
path_effects AbstractPathEffect  
picker None or bool or float or callable  
pickradius float  
rasterized bool  
sizes ndarray or None  
sketch_params (scale: float, length: float, randomness: float)  
snap bool or None  
transform Transform  
url str  
urls list of str or None  
visible bool  
zorder float
set_agg_filter(filter_func)[source]
 
Set the agg filter.  Parameters 
 
filter_funccallable


A filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array.
set_alpha(alpha)[source]
 
Set the alpha value used for blending - not supported on all backends.  Parameters 
 
alphaarray-like or scalar or None


All values must be within the 0-1 range, inclusive. Masked values and nans are not supported.
set_animated(b)[source]
 
Set whether the artist is intended to be used in an animation. If True, the artist is excluded from regular drawing of the figure. You have to call Figure.draw_artist / Axes.draw_artist explicitly on the artist. This appoach is used to speed up animations using blitting. See also matplotlib.animation and Faster rendering by using blitting.  Parameters 
 
bbool
set_antialiased(aa)[source]
 
Set the antialiasing state for rendering.  Parameters 
 
aabool or list of bools
set_antialiaseds(aa)[source]
 
Alias for set_antialiased.
set_capstyle(cs)[source]
 
Set the CapStyle for the collection (for all its elements).  Parameters 
 
csCapStyle or {'butt', 'projecting', 'round'}
set_clip_box(clipbox)[source]
 
Set the artist's clip Bbox.  Parameters 
 
clipboxBbox
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
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 which case the given Path is converted to a TransformedPath using transform.     Notes For efficiency, if path is a Rectangle this method will set the clipping box to the corresponding rectangle and set the clipping path to None. For technical reasons (support of set), a tuple (path, transform) is also accepted as a single positional parameter.
set_color(c)[source]
 
Set both the edgecolor and the facecolor.  Parameters 
 
ccolor or list of rgba tuples

    See also  
Collection.set_facecolor, Collection.set_edgecolor


For setting the edge or face color individually.
set_edgecolor(c)[source]
 
Set the edgecolor(s) of the collection.  Parameters 
 
ccolor or list of colors or 'face'


The collection edgecolor(s). If a sequence, the patches cycle through it. If 'face', match the facecolor.
set_edgecolors(c)[source]
 
Alias for set_edgecolor.
set_facecolor(c)[source]
 
Set the facecolor(s) of the collection. c can be a color (all patches have same color), or a sequence of colors; if it is a sequence the patches will cycle through the sequence. If c is 'none', the patch will not be filled.  Parameters 
 
ccolor or list of colors
set_facecolors(c)[source]
 
Alias for set_facecolor.
set_figure(fig)[source]
 
Set the Figure instance the artist belongs to.  Parameters 
 
figFigure
set_gid(gid)[source]
 
Set the (group) id for the artist.  Parameters 
 
gidstr
set_hatch(hatch)[source]
 
Set the hatching pattern hatch can be one of: /   - diagonal hatching
\   - back diagonal
|   - vertical
-   - horizontal
+   - crossed
x   - crossed diagonal
o   - small circle
O   - large circle
.   - dots
*   - stars
 Letters can be combined, in which case all the specified hatchings are done. If same letter repeats, it increases the density of hatching of that pattern. Hatching is supported in the PostScript, PDF, SVG and Agg backends only. Unlike other properties such as linewidth and colors, hatching can only be specified for the collection as a whole, not separately for each member.  Parameters 
 
hatch{'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '*'}
set_in_layout(in_layout)[source]
 
Set if artist is to be included in layout calculations, E.g. Constrained Layout Guide, Figure.tight_layout(), and fig.savefig(fname, bbox_inches='tight').  Parameters 
 
in_layoutbool
set_joinstyle(js)[source]
 
Set the JoinStyle for the collection (for all its elements).  Parameters 
 
jsJoinStyle or {'miter', 'round', 'bevel'}
set_linestyle(ls)[source]
 
Set the linestyle(s) for the collection.   
linestyle description   
'-' or 'solid' solid line  
'--' or 'dashed' dashed line  
'-.' or 'dashdot' dash-dotted line  
':' or 'dotted' dotted line   Alternatively a dash tuple of the following form can be provided: (offset, onoffseq),
 where onoffseq is an even length tuple of on and off ink in points.  Parameters 
 
lsstr or tuple or list thereof


Valid values for individual linestyles include {'-', '--', '-.', ':', '', (offset, on-off-seq)}. See Line2D.set_linestyle for a complete description.
set_linestyles(ls)[source]
 
Alias for set_linestyle.
set_linewidth(lw)[source]
 
Set the linewidth(s) for the collection. lw can be a scalar or a sequence; if it is a sequence the patches will cycle through the sequence  Parameters 
 
lwfloat or list of floats
set_linewidths(lw)[source]
 
Alias for set_linewidth.
set_lw(lw)[source]
 
Alias for set_linewidth.
set_offset_transform(transOffset)[source]
 
Set the artist offset transform.  Parameters 
 
transOffsetTransform