WrightTools.artists.Axes

class WrightTools.artists.Axes(fig, *args, facecolor=None, frameon=True, sharex=None, sharey=None, label='', xscale=None, yscale=None, box_aspect=None, **kwargs)[source]

Axes.

__init__(fig, *args, facecolor=None, frameon=True, sharex=None, sharey=None, label='', xscale=None, yscale=None, box_aspect=None, **kwargs)

Build an Axes in a figure.

Parameters:
  • fig (~matplotlib.figure.Figure) – The Axes is built in the .Figure fig.

  • *args

    *args can be a single (left, bottom, width, height) rectangle or a single .Bbox. This specifies the rectangle (in figure coordinates) where the Axes is positioned.

    *args can also consist of three numbers or a single three-digit number; in the latter case, the digits are considered as independent numbers. The numbers are interpreted as (nrows, ncols, index): (nrows, ncols) specifies the size of an array of subplots, and index is the 1-based index of the subplot being created. Finally, *args can also directly be a .SubplotSpec instance.

  • sharex (~matplotlib.axes.Axes, optional) – The x- or y-~.matplotlib.axis is shared with the x- or y-axis in the input ~.axes.Axes.

  • sharey (~matplotlib.axes.Axes, optional) – The x- or y-~.matplotlib.axis is shared with the x- or y-axis in the input ~.axes.Axes.

  • frameon (bool, default: True) – Whether the Axes frame is visible.

  • box_aspect (float, optional) – Set a fixed aspect for the Axes box, i.e. the ratio of height to width. See ~.axes.Axes.set_box_aspect for details.

  • **kwargs

    Other optional keyword arguments:

    Properties: 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 and two offsets from the bottom left corner of the image 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: unknown autoscaley_on: unknown axes_locator: Callable[[Axes, Renderer], Bbox] axisbelow: bool or ‘line’ box_aspect: float or None clip_box: ~matplotlib.transforms.BboxBase or None clip_on: bool clip_path: Patch or (Path, Transform) or None facecolor or fc: color figure: ~matplotlib.figure.Figure frame_on: bool gid: str in_layout: bool label: object mouseover: bool navigate: bool navigate_mode: unknown path_effects: list of .AbstractPathEffect picker: None or bool or float or callable position: [left, bottom, width, height] or ~matplotlib.transforms.Bbox prop_cycle: ~cycler.Cycler rasterization_zorder: float or None rasterized: bool sketch_params: (scale: float, length: float, randomness: float) snap: bool or None subplotspec: unknown title: str transform: ~matplotlib.transforms.Transform url: str visible: bool xbound: (lower: float, upper: float) xlabel: str xlim: (left: float, right: float) xmargin: float greater than -0.5 xscale: unknown xticklabels: unknown xticks: unknown ybound: (lower: float, upper: float) ylabel: str ylim: (bottom: float, top: float) ymargin: float greater than -0.5 yscale: unknown yticklabels: unknown yticks: unknown zorder: float

Returns:

The new ~.axes.Axes object.

Return type:

~.axes.Axes

Methods

__init__(fig, *args[, facecolor, frameon, ...])

Build an Axes in a figure.

acorr(x, *[, data])

Plot the autocorrelation of x.

add_artist(a)

Add an .Artist to the Axes; return the artist.

add_callback(func)

Add a callback function that will be called whenever one of the .Artist's properties changes.

add_child_axes(ax)

Add an .AxesBase to the Axes' children; return the child Axes.

add_collection(collection[, autolim])

Add a .Collection to the Axes; return the collection.

add_container(container)

Add a .Container to the Axes' containers; return the container.

add_image(image)

Add an .AxesImage to the Axes; return the image.

add_line(line)

Add a .Line2D to the Axes; return the line.

add_patch(p)

Add a .Patch to the Axes; return the patch.

add_sideplot(along[, pad, height, ymin, ymax])

Add a side axis.

add_table(tab)

Add a .Table to the Axes; return the table.

angle_spectrum(x[, Fs, Fc, window, pad_to, ...])

Plot the angle spectrum.

annotate(text, xy[, xytext, xycoords, ...])

Annotate the point xy with text text.

apply_aspect([position])

Adjust the Axes for a specified data aspect ratio.

arrow(x, y, dx, dy, **kwargs)

Add an arrow to the Axes.

autoscale([enable, axis, tight])

Autoscale the axis view to the data (toggle).

autoscale_view([tight, scalex, scaley])

Autoscale the view limits using the data limits.

axhline([y, xmin, xmax])

Add a horizontal line across the Axes.

axhspan(ymin, ymax[, xmin, xmax])

Add a horizontal span (rectangle) across the Axes.

axis([arg, emit])

Convenience method to get or set some axis properties.

axline(xy1[, xy2, slope])

Add an infinitely long straight line.

axvline([x, ymin, ymax])

Add a vertical line across the Axes.

axvspan(xmin, xmax[, ymin, ymax])

Add a vertical span (rectangle) across the Axes.

bar(x, height[, width, bottom, align, data])

Make a bar plot.

bar_label(container[, labels, fmt, ...])

Label a bar plot.

barbs(*args[, data])

Plot a 2D field of barbs.

barh(y, width[, height, left, align, data])

Make a horizontal bar plot.

boxplot(x[, notch, sym, vert, whis, ...])

Draw a box and whisker plot.

broken_barh(xranges, yrange, *[, data])

Plot a horizontal sequence of rectangles.

bxp(bxpstats[, positions, widths, vert, ...])

Drawing function for box and whisker plots.

can_pan()

Return whether this Axes supports any pan/zoom button functionality.

can_zoom()

Return whether this Axes supports the zoom box button functionality.

cla()

Clear the Axes.

clabel(CS[, levels])

Label a contour plot.

clear()

Clear the Axes.

cohere(x, y[, NFFT, Fs, Fc, detrend, ...])

Plot the coherence between x and y.

contains(mouseevent)

Test whether the artist contains the mouse event.

contains_point(point)

Return whether point (pair of pixel coordinates) is inside the Axes patch.

contour(*args, **kwargs)

Plot contours.

contourf(*args, **kwargs)

Plot contours.

convert_xunits(x)

Convert x using the unit type of the xaxis.

convert_yunits(y)

Convert y using the unit type of the yaxis.

csd(x, y[, NFFT, Fs, Fc, detrend, window, ...])

Plot the cross-spectral density.

drag_pan(button, key, x, y)

Called when the mouse moves during a pan operation.

draw(renderer)

Draw the Artist (and its children) using the given renderer.

draw_artist(a)

Efficiently redraw a single artist.

ecdf(x[, weights, complementary, ...])

Compute and plot the empirical cumulative distribution function of x.

end_pan()

Called when a pan operation completes (when the mouse button is up.)

errorbar(x, y[, yerr, xerr, fmt, ecolor, ...])

Plot y versus x as lines and/or markers with attached errorbars.

eventplot(positions[, orientation, ...])

Plot identical parallel lines at the given positions.

fill(*args[, data])

Plot filled polygons.

fill_between(x, y1[, y2, where, ...])

Fill the area between two horizontal curves.

fill_betweenx(y, x1[, x2, where, step, ...])

Fill the area between two vertical curves.

findobj([match, include_self])

Find artist objects.

format_coord(x, y)

Return a format string formatting the x, y coordinates.

format_cursor_data(data)

Return a string representation of data.

format_xdata(x)

Return x formatted as an x-value.

format_ydata(y)

Return y formatted as a y-value.

get_adjustable()

Return whether the Axes will adjust its physical dimension ('box') or its data limits ('datalim') to achieve the desired aspect ratio.

get_agg_filter()

Return filter function to be used for agg filter.

get_alpha()

Return the alpha value used for blending - not supported on all backends.

get_anchor()

Get the anchor location.

get_animated()

Return whether the artist is animated.

get_aspect()

Return the aspect ratio of the axes scaling.

get_autoscale_on()

Return True if each axis is autoscaled, False otherwise.

get_autoscalex_on()

Return whether the xaxis is autoscaled.

get_autoscaley_on()

Return whether the yaxis is autoscaled.

get_axes_locator()

Return the axes_locator.

get_axisbelow()

Get whether axis ticks and gridlines are above or below most artists.

get_box_aspect()

Return the Axes box aspect, i.e. the ratio of height to width.

get_children()

Return a list of the child .Artists of this .Artist.

get_clip_box()

Return the clipbox.

get_clip_on()

Return whether the artist uses clipping.

get_clip_path()

Return the clip path.

get_cursor_data(event)

Return the cursor data for a given event.

get_data_ratio()

Return the aspect ratio of the scaled data.

get_default_bbox_extra_artists()

Return a default list of artists that are used for the bounding box calculation.

get_facecolor()

Get the facecolor of the Axes.

get_fc()

Alias for get_facecolor.

get_figure()

Return the .Figure instance the artist belongs to.

get_frame_on()

Get whether the Axes rectangle patch is drawn.

get_gid()

Return the group id.

get_gridspec()

Return the .GridSpec associated with the subplot, or None.

get_images()

Return a list of .AxesImages contained by the Axes.

get_in_layout()

Return boolean flag, True if artist is included in layout calculations.

get_label()

Return the label used for this artist in the legend.

get_legend()

Return the .Legend instance, or None if no legend is defined.

get_legend_handles_labels([legend_handler_map])

Return handles and labels for legend

get_lines()

Return a list of lines contained by the Axes.

get_mouseover()

Return whether this artist is queried for custom context information when the mouse cursor moves over it.

get_navigate()

Get whether the Axes responds to navigation commands.

get_navigate_mode()

Get the navigation toolbar button status: 'PAN', 'ZOOM', or None.

get_path_effects()

get_picker()

Return the picking behavior of the artist.

get_position([original])

Return the position of the Axes within the figure as a .Bbox.

get_rasterization_zorder()

Return the zorder value below which artists will be rasterized.

get_rasterized()

Return whether the artist is to be rasterized.

get_shared_x_axes()

Return an immutable view on the shared x-axes Grouper.

get_shared_y_axes()

Return an immutable view on the shared y-axes Grouper.

get_sketch_params()

Return the sketch parameters for the artist.

get_snap()

Return the snap setting.

get_subplotspec()

Return the .SubplotSpec associated with the subplot, or None.

get_tightbbox([renderer, call_axes_locator, ...])

Return the tight bounding box of the Axes, including axis and their decorators (xlabel, title, etc).

get_title([loc])

Get an Axes title.

get_transform()

Return the .Transform instance used by this artist.

get_transformed_clip_path_and_affine()

Return the clip path with the non-affine part of its transformation applied, and the remaining affine part of its transformation.

get_url()

Return the url.

get_visible()

Return the visibility.

get_window_extent([renderer])

Return the Axes bounding box in display space.

get_xaxis()

[Discouraged] Return the XAxis instance.

get_xaxis_text1_transform(pad_points)

returns:
  • transform (Transform) -- The transform used for drawing x-axis labels, which will add

get_xaxis_text2_transform(pad_points)

returns:
  • transform (Transform) -- The transform used for drawing secondary x-axis labels, which will

get_xaxis_transform([which])

Get the transformation used for drawing x-axis labels, ticks and gridlines.

get_xbound()

Return the lower and upper x-axis bounds, in increasing order.

get_xgridlines()

Return the xaxis' grid lines as a list of .Line2Ds.

get_xlabel()

Get the xlabel text string.

get_xlim()

Return the x-axis view limits.

get_xmajorticklabels()

Return the xaxis' major tick labels, as a list of ~.text.Text.

get_xminorticklabels()

Return the xaxis' minor tick labels, as a list of ~.text.Text.

get_xscale()

Return the xaxis' scale (as a str).

get_xticklabels([minor, which])

Get the xaxis' tick labels.

get_xticklines([minor])

Return the xaxis' tick lines as a list of .Line2Ds.

get_xticks(*[, minor])

Return the xaxis' tick locations in data coordinates.

get_yaxis()

[Discouraged] Return the YAxis instance.

get_yaxis_text1_transform(pad_points)

returns:
  • transform (Transform) -- The transform used for drawing y-axis labels, which will add

get_yaxis_text2_transform(pad_points)

returns:
  • transform (Transform) -- The transform used for drawing secondart y-axis labels, which will

get_yaxis_transform([which])

Get the transformation used for drawing y-axis labels, ticks and gridlines.

get_ybound()

Return the lower and upper y-axis bounds, in increasing order.

get_ygridlines()

Return the yaxis' grid lines as a list of .Line2Ds.

get_ylabel()

Get the ylabel text string.

get_ylim()

Return the y-axis view limits.

get_ymajorticklabels()

Return the yaxis' major tick labels, as a list of ~.text.Text.

get_yminorticklabels()

Return the yaxis' minor tick labels, as a list of ~.text.Text.

get_yscale()

Return the yaxis' scale (as a str).

get_yticklabels([minor, which])

Get the yaxis' tick labels.

get_yticklines([minor])

Return the yaxis' tick lines as a list of .Line2Ds.

get_yticks(*[, minor])

Return the yaxis' tick locations in data coordinates.

get_zorder()

Return the artist's zorder.

grid([visible, which, axis])

Configure the grid lines.

has_data()

Return whether any artists have been added to the Axes.

have_units()

Return whether units are set on any axis.

hexbin(x, y[, C, gridsize, bins, xscale, ...])

Make a 2D hexagonal binning plot of points x, y.

hist(x[, bins, range, density, weights, ...])

Compute and plot a histogram.

hist2d(x, y[, bins, range, density, ...])

Make a 2D histogram plot.

hlines(y, xmin, xmax[, colors, linestyles, ...])

Plot horizontal lines at each y from xmin to xmax.

imshow(*args, **kwargs)

Create a pseudocolor plot of a 2-D array.

in_axes(mouseevent)

Return whether the given event (in display coords) is in the Axes.

indicate_inset(bounds[, inset_ax, ...])

Add an inset indicator to the Axes.

indicate_inset_zoom(inset_ax, **kwargs)

Add an inset indicator rectangle to the Axes based on the axis limits for an inset_ax and draw connectors between inset_ax and the rectangle.

inset_axes(bounds, *[, transform, zorder])

Add a child inset Axes to this existing Axes.

invert_xaxis()

Invert the x-axis.

invert_yaxis()

Invert the y-axis.

is_transform_set()

Return whether the Artist has an explicitly set transform.

label_outer([remove_inner_ticks])

Only show "outer" labels and tick labels.

legend(*args, **kwargs)

Add a legend.

locator_params([axis, tight])

Control behavior of major tick locators.

loglog(*args, **kwargs)

Make a plot with log scaling on both the x- and y-axis.

magnitude_spectrum(x[, Fs, Fc, window, ...])

Plot the magnitude spectrum.

margins(*margins[, x, y, tight])

Set or retrieve autoscaling margins.

matshow(Z, **kwargs)

Plot the values of a 2D matrix or array as color-coded image.

minorticks_off()

Remove minor ticks from the Axes.

minorticks_on()

Display minor ticks on the Axes.

pchanged()

Call all of the registered callbacks.

pcolor(*args, **kwargs)

Create a pseudocolor plot of a 2-D array.

pcolorfast(*args[, alpha, norm, cmap, vmin, ...])

Create a pseudocolor plot with a non-regular rectangular grid.

pcolormesh(*args, **kwargs)

Create a pseudocolor plot of a 2-D array.

phase_spectrum(x[, Fs, Fc, window, pad_to, ...])

Plot the phase spectrum.

pick(mouseevent)

Process a pick event.

pickable()

Return whether the artist is pickable.

pie(x[, explode, labels, colors, autopct, ...])

Plot a pie chart.

plot(*args, **kwargs)

Plot lines and/or markers.

plot_date(x, y[, fmt, tz, xdate, ydate, data])

[Discouraged] Plot coercing the axis to treat floats as dates.

properties()

Return a dictionary of all the properties of the artist.

psd(x[, NFFT, Fs, Fc, detrend, window, ...])

Plot the power spectral density.

quiver(*args[, data])

Plot a 2D field of arrows.

quiverkey(Q, X, Y, U, label, **kwargs)

Add a key to a quiver plot.

redraw_in_frame()

Efficiently redraw Axes data, but not axis ticks, labels, etc.

relim([visible_only])

Recompute the data limits based on current artists.

remove()

Remove the artist from the figure if possible.

remove_callback(oid)

Remove a callback based on its observer id.

reset_position()

Reset the active position to the original position.

scatter(*args, **kwargs)

Scatter plot a channel against two _variables_.

secondary_xaxis(location, *[, functions])

Add a second x-axis to this ~.axes.Axes.

secondary_yaxis(location, *[, functions])

Add a second y-axis to this ~.axes.Axes.

semilogx(*args, **kwargs)

Make a plot with log scaling on the x-axis.

semilogy(*args, **kwargs)

Make a plot with log scaling on the y-axis.

set(*[, adjustable, agg_filter, alpha, ...])

Set multiple properties at once.

set_adjustable(adjustable[, share])

Set how the Axes adjusts to achieve the required aspect ratio.

set_agg_filter(filter_func)

Set the agg filter.

set_alpha(alpha)

Set the alpha value used for blending - not supported on all backends.

set_anchor(anchor[, share])

Define the anchor location.

set_animated(b)

Set whether the artist is intended to be used in an animation.

set_aspect(aspect[, adjustable, anchor, share])

Set the aspect ratio of the axes scaling, i.e. y/x-scale.

set_autoscale_on(b)

Set whether autoscaling is applied to each axis on the next draw or call to .Axes.autoscale_view.

set_autoscalex_on(b)

Set whether the xaxis is autoscaled when drawing or by .Axes.autoscale_view.

set_autoscaley_on(b)

Set whether the yaxis is autoscaled when drawing or by .Axes.autoscale_view.

set_axes_locator(locator)

Set the Axes locator.

set_axis_off()

Hide all visual components of the x- and y-axis.

set_axis_on()

Do not hide all visual components of the x- and y-axis.

set_axisbelow(b)

Set whether axis ticks and gridlines are above or below most artists.

set_box_aspect([aspect])

Set the Axes box aspect, i.e. the ratio of height to width.

set_clip_box(clipbox)

Set the artist's clip .Bbox.

set_clip_on(b)

Set whether the artist uses clipping.

set_clip_path(path[, transform])

Set the artist's clip path.

set_facecolor(color)

Set the facecolor of the Axes.

set_fc(color)

Alias for set_facecolor.

set_figure(fig)

Set the .Figure instance the artist belongs to.

set_frame_on(b)

Set whether the Axes rectangle patch is drawn.

set_gid(gid)

Set the (group) id for the artist.

set_in_layout(in_layout)

Set if artist is to be included in layout calculations, E.g.

set_label(s)

Set a label that will be displayed in the legend.

set_mouseover(mouseover)

Set whether this artist is queried for custom context information when the mouse cursor moves over it.

set_navigate(b)

Set whether the Axes responds to navigation toolbar commands.

set_navigate_mode(b)

Set the navigation toolbar button status.

set_path_effects(path_effects)

Set the path effects.

set_picker(picker)

Define the picking behavior of the artist.

set_position(pos[, which])

Set the Axes position.

set_prop_cycle(*args, **kwargs)

Set the property cycle of the Axes.

set_rasterization_zorder(z)

Set the zorder threshold for rasterization for vector graphics output.

set_rasterized(rasterized)

Force rasterized (bitmap) drawing for vector graphics output.

set_sketch_params([scale, length, randomness])

Set the sketch parameters.

set_snap(snap)

Set the snapping behavior.

set_subplotspec(subplotspec)

Set the .SubplotSpec.

set_title(label[, fontdict, loc, pad, y])

Set a title for the Axes.

set_transform(t)

Set the artist transform.

set_url(url)

Set the url for the artist.

set_visible(b)

Set the artist's visibility.

set_xbound([lower, upper])

Set the lower and upper numerical bounds of the x-axis.

set_xlabel(xlabel[, fontdict, labelpad, loc])

Set the label for the x-axis.

set_xlim([left, right, emit, auto, xmin, xmax])

Set the x-axis view limits.

set_xmargin(m)

Set padding of X data limits prior to autoscaling.

set_xscale(value, **kwargs)

Set the xaxis' scale.

set_xticklabels(labels, *[, minor, fontdict])

[Discouraged] Set the xaxis' tick labels with list of string labels.

set_xticks(ticks[, labels, minor])

Set the xaxis' tick locations and optionally tick labels.

set_ybound([lower, upper])

Set the lower and upper numerical bounds of the y-axis.

set_ylabel(ylabel[, fontdict, labelpad, loc])

Set the label for the y-axis.

set_ylim([bottom, top, emit, auto, ymin, ymax])

Set the y-axis view limits.

set_ymargin(m)

Set padding of Y data limits prior to autoscaling.

set_yscale(value, **kwargs)

Set the yaxis' scale.

set_yticklabels(labels, *[, minor, fontdict])

[Discouraged] Set the yaxis' tick labels with list of string labels.

set_yticks(ticks[, labels, minor])

Set the yaxis' tick locations and optionally tick labels.

set_zorder(level)

Set the zorder for the artist.

sharex(other)

Share the x-axis with other.

sharey(other)

Share the y-axis with other.

specgram(x[, NFFT, Fs, Fc, detrend, window, ...])

Plot a spectrogram.

spy(Z[, precision, marker, markersize, ...])

Plot the sparsity pattern of a 2D array.

stackplot(x, *args[, labels, colors, ...])

Draw a stacked area plot.

stairs(values[, edges, orientation, ...])

A stepwise constant function as a line with bounding edges or a filled plot.

start_pan(x, y, button)

Called when a pan operation has started.

stem(*args[, linefmt, markerfmt, basefmt, ...])

Create a stem plot.

step(x, y, *args[, where, data])

Make a step plot.

streamplot(x, y, u, v[, density, linewidth, ...])

Draw streamlines of a vector flow.

table([cellText, cellColours, cellLoc, ...])

Add a table to an ~.axes.Axes.

text(x, y, s[, fontdict])

Add text to the Axes.

tick_params([axis])

Change the appearance of ticks, tick labels, and gridlines.

ticklabel_format(*[, axis, style, ...])

Configure the .ScalarFormatter used by default for linear Axes.

tricontour(*args, **kwargs)

Draw contour lines on an unstructured triangular grid.

tricontourf(*args, **kwargs)

Draw contour regions on an unstructured triangular grid.

tripcolor(*args[, alpha, norm, cmap, vmin, ...])

Create a pseudocolor plot of an unstructured triangular grid.

triplot(*args, **kwargs)

Draw an unstructured triangular grid as lines and/or markers.

twinx()

Create a twin Axes sharing the xaxis.

twiny()

Create a twin Axes sharing the yaxis.

update(props)

Update this artist's properties from the dict props.

update_datalim(xys[, updatex, updatey])

Extend the ~.Axes.dataLim Bbox to include the given points.

update_from(other)

Copy properties from other to self.

violin(vpstats[, positions, vert, widths, ...])

Drawing function for violin plots.

violinplot(dataset[, positions, vert, ...])

Make a violin plot.

vlines(x, ymin, ymax[, colors, linestyles, ...])

Plot vertical lines at each x from ymin to ymax.

xaxis_date([tz])

Set up axis ticks and labels to treat data along the xaxis as dates.

xaxis_inverted()

Return whether the xaxis is oriented in the "inverse" direction.

xcorr(x, y[, normed, detrend, usevlines, ...])

Plot the cross correlation between x and y.

yaxis_date([tz])

Set up axis ticks and labels to treat data along the yaxis as dates.

yaxis_inverted()

Return whether the yaxis is oriented in the "inverse" direction.

Attributes

artists

axes

The ~.axes.Axes instance the artist resides in, or None.

collections

images

is_sideplot

lines

mouseover

Return whether this artist is queried for custom context information when the mouse cursor moves over it.

name

patches

stale

Whether the artist is 'stale' and needs to be re-drawn for the output to match the internal state of the artist.

sticky_edges

x and y sticky edge lists for autoscaling.

tables

texts

transposed

use_sticky_edges

When autoscaling, whether to obey all Artist.sticky_edges.

viewLim

zorder