mpl.axes.Subplot¶
-
mpl.axes.Subplot¶ alias of
AxesSubplot
Methods¶
__init__(fig, *args, **kwargs) |
fig is a matplotlib.figure.Figure instance. |
acorr(ax, *args, **kwargs) |
Plot the autocorrelation of x. |
add_artist(a) |
Add any Artist to the axes. |
add_callback(func) |
Adds a callback function that will be called whenever one of the Artist‘s properties changes. |
add_collection(collection[, autolim]) |
Add a Collection instance to the axes. |
add_container(container) |
Add a Container instance to the axes. |
add_image(image) |
Add a AxesImage to the axes. |
add_line(line) |
Add a Line2D to the list of plot |
add_patch(p) |
Add a Patch p to the list of axes patches; the clipbox will be set to the Axes clipping box. |
add_table(tab) |
Add a Table instance to the |
angle_spectrum(ax, *args, **kwargs) |
Plot the angle spectrum. |
annotate(*args, **kwargs) |
Create an annotation: a piece of text referring to a data point. |
apply_aspect([position]) |
Use _aspect() and _adjustable() to modify the axes box or the view limits. |
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 axis. |
axhspan(ymin, ymax[, xmin, xmax]) |
Add a horizontal span (rectangle) across the axis. |
axis(*v, **kwargs) |
Set axis properties. |
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(ax, *args, **kwargs) |
Make a bar plot. |
barbs(ax, *args, **kwargs) |
Plot a 2-D field of barbs. |
barh(bottom, width[, height, left]) |
Make a horizontal bar plot. |
boxplot(ax, *args, **kwargs) |
Make a box and whisker plot. |
broken_barh(ax, *args, **kwargs) |
Plot horizontal bars. |
bxp(bxpstats[, positions, widths, vert, ...]) |
Drawing function for box and whisker plots. |
can_pan() |
Return True if this axes supports any pan/zoom button functionality. |
can_zoom() |
Return True if this axes supports the zoom box button functionality. |
change_geometry(numrows, numcols, num) |
change subplot geometry, e.g., from 1,1,1 to 2,2,3 |
cla() |
Clear the current axes. |
clabel(CS, *args, **kwargs) |
Label a contour plot. |
clear() |
clear the axes |
cohere(ax, *args, **kwargs) |
Plot the coherence between x and y. |
contains(mouseevent) |
Test whether the mouse event occured in the axes. |
contains_point(point) |
Returns True if the point (tuple of x,y) is inside the axes (the area defined by the its patch). |
contour(ax, *args, **kwargs) |
Plot contours. |
contourf(ax, *args, **kwargs) |
Plot contours. |
convert_xunits(x) |
For artists in an axes, if the xaxis has units support, |
convert_yunits(y) |
For artists in an axes, if the yaxis has units support, |
csd(ax, *args, **kwargs) |
Plot the cross-spectral density. |
drag_pan(button, key, x, y) |
Called when the mouse moves during a pan operation. |
draw(artist, renderer, *args, **kwargs) |
Draw everything (plot lines, axes, labels) |
draw_artist(a) |
This method can only be used after an initial draw which caches the renderer. |
end_pan() |
Called when a pan operation completes (when the mouse button |
errorbar(ax, *args, **kwargs) |
Plot an errorbar graph. |
eventplot(ax, *args, **kwargs) |
Plot identical parallel lines at specific positions. |
fill(ax, *args, **kwargs) |
Plot filled polygons. |
fill_between(ax, *args, **kwargs) |
Make filled polygons between two curves. |
fill_betweenx(ax, *args, **kwargs) |
Make filled polygons between two horizontal curves. |
findobj([match, include_self]) |
Find artist objects. |
format_coord(x, y) |
Return a format string formatting the x, y coord |
format_cursor_data(data) |
Return cursor data string formatted. |
format_xdata(x) |
Return x string formatted. |
format_ydata(y) |
Return y string formatted. |
get_adjustable() |
|
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 |
get_anchor() |
|
get_animated() |
Return the artist’s animated state |
get_aspect() |
|
get_autoscale_on() |
Get whether autoscaling is applied for both axes on plot commands |
get_autoscalex_on() |
Get whether autoscaling for the x-axis is applied on plot commands |
get_autoscaley_on() |
Get whether autoscaling for the y-axis is applied on plot commands |
get_axes() |
Return the Axes instance the artist resides in, or None. |
get_axes_locator() |
return axes_locator |
get_axis_bgcolor() |
Return the axis background color |
get_axisbelow() |
Get whether axis below is true or not |
get_children() |
return a list of child artists |
get_clip_box() |
Return artist clipbox |
get_clip_on() |
Return whether artist uses clipping |
get_clip_path() |
Return artist clip path |
get_contains() |
Return the _contains test used by the artist, or None for default. |
get_cursor_data(event) |
Get the cursor data for a given event. |
get_cursor_props() |
Return the cursor propertiess as a (linewidth, color) |
get_data_ratio() |
Returns the aspect ratio of the raw data. |
get_data_ratio_log() |
Returns the aspect ratio of the raw data in log scale. |
get_default_bbox_extra_artists() |
|
get_figure() |
Return the Figure instance the artist belongs to. |
get_frame_on() |
Get whether the axes rectangle patch is drawn |
get_geometry() |
get the subplot geometry, e.g., 2,2,3 |
get_gid() |
Returns the group id |
get_images() |
return a list of Axes images contained by the Axes |
get_label() |
Get the label used for this artist in the legend. |
get_legend() |
Return the legend.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_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 picker object used by this artist |
get_position([original]) |
Return the a copy of the axes rectangle as a Bbox |
get_rasterization_zorder() |
Get zorder value below which artists will be rasterized |
get_rasterized() |
return True if the artist is to be rasterized |
get_renderer_cache() |
|
get_shared_x_axes() |
Return a copy of the shared axes Grouper object for x axes |
get_shared_y_axes() |
Return a copy of the shared axes Grouper object for y axes |
get_sketch_params() |
Returns the sketch parameters for the artist. |
get_snap() |
Returns the snap setting which may be: |
get_subplotspec() |
get the SubplotSpec instance associated with the subplot |
get_tightbbox(renderer[, call_axes_locator]) |
Return the tight bounding box of the axes. |
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() |
Returns the url |
get_visible() |
Return the artist’s visiblity |
get_window_extent(*args, **kwargs) |
get the axes bounding box in display space; args and |
get_xaxis() |
Return the XAxis instance |
get_xaxis_text1_transform(pad_points) |
Get the transformation used for drawing x-axis labels, which will add the given amount of padding (in points) between the axes and the label. |
get_xaxis_text2_transform(pad_points) |
Get the transformation used for drawing the secondary x-axis labels, which will add the given amount of padding (in points) between the axes and the label. |
get_xaxis_transform([which]) |
Get the transformation used for drawing x-axis labels, ticks and gridlines. |
get_xbound() |
Returns the x-axis numerical bounds where: |
get_xgridlines() |
Get the x grid lines as a list of Line2D instances |
get_xlabel() |
Get the xlabel text string. |
get_xlim() |
Get the x-axis range [left, right] |
get_xmajorticklabels() |
Get the xtick labels as a list of Text instances. |
get_xminorticklabels() |
Get the x minor tick labels as a list of matplotlib.text.Text instances. |
get_xscale() |
Return the xaxis scale string: linear, log, logit, symlog |
get_xticklabels([minor, which]) |
Get the x tick labels as a list of Text instances. |
get_xticklines() |
Get the xtick lines as a list of Line2D instances |
get_xticks([minor]) |
Return the x ticks as a list of locations |
get_yaxis() |
Return the YAxis instance |
get_yaxis_text1_transform(pad_points) |
Get the transformation used for drawing y-axis labels, which will add the given amount of padding (in points) between the axes and the label. |
get_yaxis_text2_transform(pad_points) |
Get the transformation used for drawing the secondary y-axis labels, which will add the given amount of padding (in points) between the axes and the label. |
get_yaxis_transform([which]) |
Get the transformation used for drawing y-axis labels, ticks and gridlines. |
get_ybound() |
Return y-axis numerical bounds in the form of |
get_ygridlines() |
Get the y grid lines as a list of Line2D instances |
get_ylabel() |
Get the ylabel text string. |
get_ylim() |
Get the y-axis range [bottom, top] |
get_ymajorticklabels() |
Get the major y tick labels as a list of Text instances. |
get_yminorticklabels() |
Get the minor y tick labels as a list of Text instances. |
get_yscale() |
Return the yaxis scale string: linear, log, logit, symlog |
get_yticklabels([minor, which]) |
Get the x tick labels as a list of Text instances. |
get_yticklines() |
Get the ytick lines as a list of Line2D instances |
get_yticks([minor]) |
Return the y ticks as a list of locations |
get_zorder() |
Return the Artist‘s zorder. |
grid([b, which, axis]) |
Turn the axes grids on or off. |
has_data() |
Return True if any artists have been added to axes. |
have_units() |
Return True if units are set on the x or y axes |
hexbin(ax, *args, **kwargs) |
Make a hexagonal binning plot. |
hist(ax, *args, **kwargs) |
Plot a histogram. |
hist2d(ax, *args, **kwargs) |
Make a 2D histogram plot. |
hitlist(event) |
List the children of the artist which contain the mouse event event. |
hlines(ax, *args, **kwargs) |
Plot horizontal lines at each y from xmin to xmax. |
hold([b]) |
Call signature: |
imshow(ax, *args, **kwargs) |
Display an image on the axes. |
in_axes(mouseevent) |
Return True if the given mouseevent (in display coords) |
invert_xaxis() |
Invert the x-axis. |
invert_yaxis() |
Invert the y-axis. |
is_figure_set() |
Returns True if the artist is assigned to a Figure. |
is_first_col() |
|
is_first_row() |
|
is_last_col() |
|
is_last_row() |
|
is_transform_set() |
Returns True if Artist has a transform explicitly set. |
ishold() |
return the HOLD status of the axes |
label_outer() |
set the visible property on ticklabels so xticklabels are |
legend(*args, **kwargs) |
Places a legend on the axes. |
locator_params([axis, tight]) |
Control behavior of tick locators. |
loglog(*args, **kwargs) |
Make a plot with log scaling on both the x and y axis. |
magnitude_spectrum(ax, *args, **kwargs) |
Plot the magnitude spectrum. |
margins(*args, **kw) |
Set or retrieve autoscaling margins. |
matshow(Z, **kwargs) |
Plot a matrix or array as an image. |
minorticks_off() |
Remove minor ticks from the axes. |
minorticks_on() |
Add autoscaling minor ticks to the axes. |
pchanged() |
Fire an event when property changed, calling all of the registered callbacks. |
pcolor(ax, *args, **kwargs) |
Create a pseudocolor plot of a 2-D array. |
pcolorfast(ax, *args, **kwargs) |
pseudocolor plot of a 2-D array |
pcolormesh(ax, *args, **kwargs) |
Plot a quadrilateral mesh. |
phase_spectrum(ax, *args, **kwargs) |
Plot the phase spectrum. |
pick(*args) |
Call signature: |
pickable() |
Return True if Artist is pickable. |
pie(ax, *args, **kwargs) |
Plot a pie chart. |
plot(ax, *args, **kwargs) |
Plot lines and/or markers to the Axes. |
plot_date(ax, *args, **kwargs) |
Plot with data with dates. |
properties() |
return a dictionary mapping property name -> value for all Artist props |
psd(ax, *args, **kwargs) |
Plot the power spectral density. |
quiver(ax, *args, **kwargs) |
Plot a 2-D field of arrows. |
quiverkey(*args, **kw) |
Add a key to a quiver plot. |
redraw_in_frame() |
This method can only be used after an initial draw which caches the renderer. |
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 id. |
reset_position() |
Make the original position the active position |
scatter(ax, *args, **kwargs) |
Make a scatter plot of x vs y, where x and y are sequence like objects of the same lengths. |
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(**kwargs) |
A property batch setter. |
set_adjustable(adjustable) |
ACCEPTS: [ ‘box’ | ‘datalim’ | ‘box-forced’] |
set_agg_filter(filter_func) |
set agg_filter fuction. |
set_alpha(alpha) |
Set the alpha value used for blending - not supported on all backends. |
set_anchor(anchor) |
anchor |
set_animated(b) |
Set the artist’s animation state. |
set_aspect(aspect[, adjustable, anchor]) |
aspect |
set_autoscale_on(b) |
Set whether autoscaling is applied on plot commands |
set_autoscalex_on(b) |
Set whether autoscaling for the x-axis is applied on plot commands |
set_autoscaley_on(b) |
Set whether autoscaling for the y-axis is applied on plot commands |
set_axes(axes) |
Set the Axes instance in which the artist resides, if any. |
set_axes_locator(locator) |
set axes_locator |
set_axis_bgcolor(color) |
set the axes background color |
set_axis_off() |
turn off the axis |
set_axis_on() |
turn on the axis |
set_axisbelow(b) |
Set whether the axis ticks and gridlines are above or below most |
set_clip_box(clipbox) |
Set the artist’s clip Bbox. |
set_clip_on(b) |
Set whether artist uses clipping. |
set_clip_path(path[, transform]) |
Set the artist’s clip path, which may be: |
set_color_cycle(clist) |
Set the color cycle for any future plot commands on this Axes. |
set_contains(picker) |
Replace the contains test used by this artist. |
set_cursor_props(*args) |
Set the cursor property as: |
set_figure(fig) |
Set the class:~matplotlib.axes.Axes figure |
set_frame_on(b) |
Set whether the axes rectangle patch is drawn |
set_gid(gid) |
Sets the (group) id for the artist |
set_label(s) |
Set the label to s for auto legend. |
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 path_effects, which should be a list of instances of |
set_picker(picker) |
Set the epsilon for picking used by this artist |
set_position(pos[, which]) |
Set the axes position with: |
set_prop_cycle(*args, **kwargs) |
Set the property cycle for any future plot commands on this Axes. |
set_rasterization_zorder(z) |
Set zorder value below which artists will be rasterized. |
set_rasterized(rasterized) |
Force rasterized (bitmap) drawing in vector backend output. |
set_sketch_params([scale, length, randomness]) |
Sets the sketch parameters. |
set_snap(snap) |
Sets the snap setting which may be: |
set_subplotspec(subplotspec) |
set the SubplotSpec instance associated with the subplot |
set_title(label[, fontdict, loc]) |
Set a title for the axes. |
set_transform(t) |
Set the Transform instance used by this artist. |
set_url(url) |
Sets the url for the artist |
set_visible(b) |
Set the artist’s visiblity. |
set_xbound([lower, upper]) |
Set the lower and upper numerical bounds of the x-axis. |
set_xlabel(xlabel[, fontdict, labelpad]) |
Set the label for the xaxis. |
set_xlim([left, right, emit, auto]) |
Call signature: |
set_xmargin(m) |
Set padding of X data limits prior to autoscaling. |
set_xscale(value, **kwargs) |
Call signature: |
set_xticklabels(labels[, fontdict, minor]) |
Call signature: |
set_xticks(ticks[, minor]) |
Set the x ticks with list of ticks |
set_ybound([lower, upper]) |
Set the lower and upper numerical bounds of the y-axis. |
set_ylabel(ylabel[, fontdict, labelpad]) |
Set the label for the yaxis |
set_ylim([bottom, top, emit, auto]) |
Call signature: |
set_ymargin(m) |
Set padding of Y data limits prior to autoscaling. |
set_yscale(value, **kwargs) |
Call signature: |
set_yticklabels(labels[, fontdict, minor]) |
Call signature: |
set_yticks(ticks[, minor]) |
Set the y ticks with list of ticks |
set_zorder(level) |
Set the zorder for the artist. |
specgram(ax, *args, **kwargs) |
Plot a spectrogram. |
spy(Z[, precision, marker, markersize, ...]) |
Plot the sparsity pattern on a 2-D array. |
stackplot(ax, *args, **kwargs) |
Draws a stacked area plot. |
start_pan(x, y, button) |
Called when a pan operation has started. |
stem(ax, *args, **kwargs) |
Create a stem plot. |
step(ax, *args, **kwargs) |
Make a step plot. |
streamplot(ax, *args, **kwargs) |
Draws streamlines of a vector flow. |
table(**kwargs) |
Add a table to the current axes. |
text(x, y, s[, fontdict, withdash]) |
Add text to the axes. |
tick_params([axis]) |
Change the appearance of ticks and tick labels. |
ticklabel_format(**kwargs) |
Change the ~matplotlib.ticker.ScalarFormatter used by default for linear axes. |
tricontour(*args, **kwargs) |
Draw contours on an unstructured triangular grid. |
tricontourf(*args, **kwargs) |
Draw contours on an unstructured triangular grid. |
tripcolor(*args, **kwargs) |
Create a pseudocolor plot of an unstructured triangular grid. |
triplot(*args, **kwargs) |
Draw a unstructured triangular grid as lines and/or markers. |
twinx() |
Call signature: |
twiny() |
Call signature: |
update(props) |
Update the properties of this Artist from the dictionary prop. |
update_datalim(xys[, updatex, updatey]) |
Update the data lim bbox with seq of xy tups or equiv. |
update_datalim_bounds(bounds) |
Update the datalim to include the given |
update_datalim_numerix(x, y) |
Update the data lim bbox with seq of xy tups |
update_from(other) |
Copy properties from other to self. |
update_params() |
update the subplot position from fig.subplotpars |
violin(vpstats[, positions, vert, widths, ...]) |
Drawing function for violin plots. |
violinplot(ax, *args, **kwargs) |
Make a violin plot. |
vlines(ax, *args, **kwargs) |
Plot vertical lines. |
xaxis_date([tz]) |
Sets up x-axis ticks and labels that treat the x data as dates. |
xaxis_inverted() |
Returns True if the x-axis is inverted. |
xcorr(ax, *args, **kwargs) |
Plot the cross correlation between x and y. |
yaxis_date([tz]) |
Sets up y-axis ticks and labels that treat the y data as dates. |
yaxis_inverted() |
Returns True if the y-axis is inverted. |