Participer au site avec un Tip
Rechercher
 

Améliorations / Corrections

Vous avez des améliorations (ou des corrections) à proposer pour ce document : je vous remerçie par avance de m'en faire part, cela m'aide à améliorer le site.

Emplacement :

Description des améliorations :

Vous êtes un professionnel et vous avez besoin d'une formation ? RAG (Retrieval-Augmented Generation)
et Fine Tuning d'un LLM
Voir le programme détaillé
Module « matplotlib.figure »

Classe « Axes »

Informations générales

Héritage

builtins.object
    Artist
        _AxesBase
            Axes

Définition

class Axes(_AxesBase):

help(Axes)

An Axes object encapsulates all the elements of an individual (sub-)plot in
a figure.

It contains most of the (sub-)plot elements: `~.axis.Axis`,
`~.axis.Tick`, `~.lines.Line2D`, `~.text.Text`, `~.patches.Polygon`, etc.,
and sets the coordinate system.

Like all visible elements in a figure, Axes is an `.Artist` subclass.

The `Axes` instance supports callbacks through a callbacks attribute which
is a `~.cbook.CallbackRegistry` instance.  The events you can connect to
are 'xlim_changed' and 'ylim_changed' and the callback will be called with
func(*ax*) where *ax* is the `Axes` instance.

.. note::

    As a user, you do not instantiate Axes directly, but use Axes creation
    methods instead; e.g. from `.pyplot` or `.Figure`:
    `~.pyplot.subplots`, `~.pyplot.subplot_mosaic` or `.Figure.add_axes`.

Constructeur(s)

Signature du constructeur Description
__init__(self, fig, *args, facecolor=None, frameon=True, sharex=None, sharey=None, label='', xscale=None, yscale=None, box_aspect=None, forward_navigation_events='auto', **kwargs) Build an Axes in a figure. [extrait de __init__.__doc__]

Liste des attributs statiques

Nom de l'attribut Valeur
namerectilinear
zorder0

Liste des propriétés

Nom de la propriétéDescription
artists
axesThe `~.axes.Axes` instance the artist resides in, or *None*. [extrait de axes.__doc__]
collections
figureThe (Sub)Figure that the artist is on. For more control, use the `get_figure` method. [extrait de figure.__doc__]
images
lines
mouseover
patches
stale
sticky_edges
tables
texts
use_sticky_edges
viewLimThe view limits as `.Bbox` in data coordinates. [extrait de viewLim.__doc__]

Liste des opérateurs

Opérateurs hérités de la classe object

__eq__, __ge__, __gt__, __le__, __lt__, __ne__

Liste des méthodes

Toutes les méthodes Méthodes d'instance Méthodes statiques Méthodes dépréciées
Signature de la méthodeDescription
acorr(self, x, *, data=None, **kwargs) Plot the autocorrelation of *x*. [extrait de acorr.__doc__]
angle_spectrum(self, x, *, Fs=None, Fc=None, window=None, pad_to=None, sides=None, data=None, **kwargs) Plot the angle spectrum. [extrait de angle_spectrum.__doc__]
annotate(self, text, xy, xytext=None, xycoords='data', textcoords=None, arrowprops=None, annotation_clip=None, **kwargs)
arrow(self, x, y, dx, dy, **kwargs) Add an arrow to the Axes. [extrait de arrow.__doc__]
axhline(self, y=0, xmin=0, xmax=1, **kwargs) Add a horizontal line spanning the whole or fraction of the Axes. [extrait de axhline.__doc__]
axhspan(self, ymin, ymax, xmin=0, xmax=1, **kwargs) Add a horizontal span (rectangle) across the Axes. [extrait de axhspan.__doc__]
axline(self, xy1, xy2=None, *, slope=None, **kwargs) Add an infinitely long straight line. [extrait de axline.__doc__]
axvline(self, x=0, ymin=0, ymax=1, **kwargs) Add a vertical line spanning the whole or fraction of the Axes. [extrait de axvline.__doc__]
axvspan(self, xmin, xmax, ymin=0, ymax=1, **kwargs) Add a vertical span (rectangle) across the Axes. [extrait de axvspan.__doc__]
bar(self, x, height, width=0.8, bottom=None, *, align='center', data=None, **kwargs) Make a bar plot. [extrait de bar.__doc__]
bar_label(self, container, labels=None, *, fmt='%g', label_type='edge', padding=0, **kwargs)
barbs(self, *args, data=None, **kwargs) Plot a 2D field of wind barbs. [extrait de barbs.__doc__]
barh(self, y, width, height=0.8, left=None, *, align='center', data=None, **kwargs) Make a horizontal bar plot. [extrait de barh.__doc__]
boxplot(self, x, *, notch=None, sym=None, vert=None, orientation='vertical', whis=None, positions=None, widths=None, patch_artist=None, bootstrap=None, usermedians=None, conf_intervals=None, meanline=None, showmeans=None, showcaps=None, showbox=None, showfliers=None, boxprops=None, tick_labels=None, flierprops=None, medianprops=None, meanprops=None, capprops=None, whiskerprops=None, manage_ticks=True, autorange=False, zorder=None, capwidths=None, label=None, data=None) Draw a box and whisker plot. [extrait de boxplot.__doc__]
broken_barh(self, xranges, yrange, *, data=None, **kwargs) Plot a horizontal sequence of rectangles. [extrait de broken_barh.__doc__]
bxp(self, bxpstats, positions=None, *, widths=None, vert=None, orientation='vertical', patch_artist=False, shownotches=False, showmeans=False, showcaps=True, showbox=True, showfliers=True, boxprops=None, whiskerprops=None, flierprops=None, medianprops=None, capprops=None, meanprops=None, meanline=False, manage_ticks=True, zorder=None, capwidths=None, label=None)
clabel(self, CS, levels=None, **kwargs)
cohere(self, x, y, *, NFFT=256, Fs=2, Fc=0, detrend=<function detrend_none at 0x0000020D9ABF6660>, window=<function window_hanning at 0x0000020D9ABF63E0>, noverlap=0, pad_to=None, sides='default', scale_by_freq=None, data=None, **kwargs) Plot the coherence between *x* and *y*. [extrait de cohere.__doc__]
contour(self, *args, data=None, **kwargs) Plot contour lines. [extrait de contour.__doc__]
contourf(self, *args, data=None, **kwargs) Plot filled contours. [extrait de contourf.__doc__]
csd(self, x, y, *, NFFT=None, Fs=None, Fc=None, detrend=None, window=None, noverlap=None, pad_to=None, sides=None, scale_by_freq=None, return_line=None, data=None, **kwargs) Plot the cross-spectral density. [extrait de csd.__doc__]
ecdf(self, x, weights=None, *, complementary=False, orientation='vertical', compress=False, data=None, **kwargs) Compute and plot the empirical cumulative distribution function of *x*. [extrait de ecdf.__doc__]
errorbar(self, x, y, yerr=None, xerr=None, fmt='', *, ecolor=None, elinewidth=None, capsize=None, barsabove=False, lolims=False, uplims=False, xlolims=False, xuplims=False, errorevery=1, capthick=None, data=None, **kwargs) Plot y versus x as lines and/or markers with attached errorbars. [extrait de errorbar.__doc__]
eventplot(self, positions, *, orientation='horizontal', lineoffsets=1, linelengths=1, linewidths=None, colors=None, alpha=None, linestyles='solid', data=None, **kwargs) Plot identical parallel lines at the given positions. [extrait de eventplot.__doc__]
fill(self, *args, data=None, **kwargs)
fill_between(self, x, y1, y2=0, where=None, interpolate=False, step=None, *, data=None, **kwargs) Fill the area between two horizontal curves. [extrait de fill_between.__doc__]
fill_betweenx(self, y, x1, x2=0, where=None, step=None, interpolate=False, *, data=None, **kwargs) Fill the area between two vertical curves. [extrait de fill_betweenx.__doc__]
get_legend_handles_labels(self, legend_handler_map=None)
get_title(self, loc='center')
hexbin(self, x, y, C=None, *, gridsize=100, bins=None, xscale='linear', yscale='linear', extent=None, cmap=None, norm=None, vmin=None, vmax=None, alpha=None, linewidths=None, edgecolors='face', reduce_C_function=<function mean at 0x0000020DE89D1D70>, mincnt=None, marginals=False, colorizer=None, data=None, **kwargs) Make a 2D hexagonal binning plot of points *x*, *y*. [extrait de hexbin.__doc__]
hist(self, x, bins=None, *, range=None, density=False, weights=None, cumulative=False, bottom=None, histtype='bar', align='mid', orientation='vertical', rwidth=None, log=False, color=None, label=None, stacked=False, data=None, **kwargs) Compute and plot a histogram. [extrait de hist.__doc__]
hist2d(self, x, y, bins=10, *, range=None, density=False, weights=None, cmin=None, cmax=None, data=None, **kwargs) Make a 2D histogram plot. [extrait de hist2d.__doc__]
hlines(self, y, xmin, xmax, colors=None, linestyles='solid', *, label='', data=None, **kwargs) Plot horizontal lines at each *y* from *xmin* to *xmax*. [extrait de hlines.__doc__]
imshow(self, X, cmap=None, norm=None, *, aspect=None, interpolation=None, alpha=None, vmin=None, vmax=None, colorizer=None, origin=None, extent=None, interpolation_stage=None, filternorm=True, filterrad=4.0, resample=None, url=None, data=None, **kwargs) Display data as an image, i.e., on a 2D regular raster. [extrait de imshow.__doc__]
indicate_inset(self, bounds=None, inset_ax=None, *, transform=None, facecolor='none', edgecolor='0.5', alpha=0.5, zorder=None, **kwargs) Add an inset indicator to the Axes. This is a rectangle on the plot [extrait de indicate_inset.__doc__]
indicate_inset_zoom(self, inset_ax, **kwargs)
inset_axes(self, bounds, *, transform=None, zorder=5, **kwargs)
legend(self, *args, **kwargs) Place a legend on the Axes. [extrait de legend.__doc__]
loglog(self, *args, **kwargs) Make a plot with log scaling on both the x- and y-axis. [extrait de loglog.__doc__]
magnitude_spectrum(self, x, *, Fs=None, Fc=None, window=None, pad_to=None, sides=None, scale=None, data=None, **kwargs) Plot the magnitude spectrum. [extrait de magnitude_spectrum.__doc__]
matshow(self, Z, **kwargs)
pcolor(self, *args, shading=None, alpha=None, norm=None, cmap=None, vmin=None, vmax=None, colorizer=None, data=None, **kwargs) Create a pseudocolor plot with a non-regular rectangular grid. [extrait de pcolor.__doc__]
pcolorfast(self, *args, alpha=None, norm=None, cmap=None, vmin=None, vmax=None, colorizer=None, data=None, **kwargs) Create a pseudocolor plot with a non-regular rectangular grid. [extrait de pcolorfast.__doc__]
pcolormesh(self, *args, alpha=None, norm=None, cmap=None, vmin=None, vmax=None, colorizer=None, shading=None, antialiased=False, data=None, **kwargs) Create a pseudocolor plot with a non-regular rectangular grid. [extrait de pcolormesh.__doc__]
phase_spectrum(self, x, *, Fs=None, Fc=None, window=None, pad_to=None, sides=None, data=None, **kwargs) Plot the phase spectrum. [extrait de phase_spectrum.__doc__]
pie(self, x, *, explode=None, labels=None, colors=None, autopct=None, pctdistance=0.6, shadow=False, labeldistance=1.1, startangle=0, radius=1, counterclock=True, wedgeprops=None, textprops=None, center=(0, 0), frame=False, rotatelabels=False, normalize=True, hatch=None, data=None) Plot a pie chart. [extrait de pie.__doc__]
plot(self, *args, scalex=True, scaley=True, data=None, **kwargs) Plot y versus x as lines and/or markers. [extrait de plot.__doc__]
plot_date(self, x, y, fmt='o', tz=None, xdate=True, ydate=False, *, data=None, **kwargs) [*Deprecated*] Plot coercing the axis to treat floats as dates. [extrait de plot_date.__doc__]
psd(self, x, *, NFFT=None, Fs=None, Fc=None, detrend=None, window=None, noverlap=None, pad_to=None, sides=None, scale_by_freq=None, return_line=None, data=None, **kwargs) Plot the power spectral density. [extrait de psd.__doc__]
quiver(self, *args, data=None, **kwargs) Plot a 2D field of arrows. [extrait de quiver.__doc__]
quiverkey(self, Q, X, Y, U, label, **kwargs)
scatter(self, x, y, s=None, c=None, *, marker=None, cmap=None, norm=None, vmin=None, vmax=None, alpha=None, linewidths=None, edgecolors=None, colorizer=None, plotnonfinite=False, data=None, **kwargs) A scatter plot of *y* vs. *x* with varying marker size and/or color. [extrait de scatter.__doc__]
secondary_xaxis(self, location, functions=None, *, transform=None, **kwargs) Add a second x-axis to this `~.axes.Axes`. [extrait de secondary_xaxis.__doc__]
secondary_yaxis(self, location, functions=None, *, transform=None, **kwargs) Add a second y-axis to this `~.axes.Axes`. [extrait de secondary_yaxis.__doc__]
semilogx(self, *args, **kwargs) Make a plot with log scaling on the x-axis. [extrait de semilogx.__doc__]
semilogy(self, *args, **kwargs) Make a plot with log scaling on the y-axis. [extrait de semilogy.__doc__]
set(self, *, adjustable=<UNSET>, agg_filter=<UNSET>, alpha=<UNSET>, anchor=<UNSET>, animated=<UNSET>, aspect=<UNSET>, autoscale_on=<UNSET>, autoscalex_on=<UNSET>, autoscaley_on=<UNSET>, axes_locator=<UNSET>, axisbelow=<UNSET>, box_aspect=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, facecolor=<UNSET>, forward_navigation_events=<UNSET>, frame_on=<UNSET>, gid=<UNSET>, in_layout=<UNSET>, label=<UNSET>, mouseover=<UNSET>, navigate=<UNSET>, path_effects=<UNSET>, picker=<UNSET>, position=<UNSET>, prop_cycle=<UNSET>, rasterization_zorder=<UNSET>, rasterized=<UNSET>, sketch_params=<UNSET>, snap=<UNSET>, subplotspec=<UNSET>, title=<UNSET>, transform=<UNSET>, url=<UNSET>, visible=<UNSET>, xbound=<UNSET>, xlabel=<UNSET>, xlim=<UNSET>, xmargin=<UNSET>, xscale=<UNSET>, xticklabels=<UNSET>, xticks=<UNSET>, ybound=<UNSET>, ylabel=<UNSET>, ylim=<UNSET>, ymargin=<UNSET>, yscale=<UNSET>, yticklabels=<UNSET>, yticks=<UNSET>, zorder=<UNSET>) Set multiple properties at once. [extrait de set.__doc__]
set_title(self, label, fontdict=None, loc=None, pad=None, *, y=None, **kwargs)
specgram(self, x, *, NFFT=None, Fs=None, Fc=None, detrend=None, window=None, noverlap=None, cmap=None, xextent=None, pad_to=None, sides=None, scale_by_freq=None, mode=None, scale=None, vmin=None, vmax=None, data=None, **kwargs) Plot a spectrogram. [extrait de specgram.__doc__]
spy(self, Z, *, precision=0, marker=None, markersize=None, aspect='equal', origin='upper', **kwargs) Plot the sparsity pattern of a 2D array. [extrait de spy.__doc__]
stackplot(axes, x, *args, labels=(), colors=None, hatch=None, baseline='zero', data=None, **kwargs) Draw a stacked area plot or a streamgraph. [extrait de stackplot.__doc__]
stairs(self, values, edges=None, *, orientation='vertical', baseline=0, fill=False, data=None, **kwargs) Draw a stepwise constant function as a line or a filled plot. [extrait de stairs.__doc__]
stem(self, *args, linefmt=None, markerfmt=None, basefmt=None, bottom=0, label=None, orientation='vertical', data=None) Create a stem plot. [extrait de stem.__doc__]
step(self, x, y, *args, where='pre', data=None, **kwargs)
streamplot(axes, x, y, u, v, density=1, linewidth=None, color=None, cmap=None, norm=None, arrowsize=1, arrowstyle='-|>', minlength=0.1, transform=None, zorder=None, start_points=None, maxlength=4.0, integration_direction='both', broken_streamlines=True, *, data=None) Draw streamlines of a vector flow. [extrait de streamplot.__doc__]
table(ax, cellText=None, cellColours=None, cellLoc='right', colWidths=None, rowLabels=None, rowColours=None, rowLoc='left', colLabels=None, colColours=None, colLoc='center', loc='bottom', bbox=None, edges='closed', **kwargs) Add a table to an `~.axes.Axes`. [extrait de table.__doc__]
text(self, x, y, s, fontdict=None, **kwargs) Add text to the Axes. [extrait de text.__doc__]
tricontour(ax, *args, **kwargs) Draw contour lines on an unstructured triangular grid. [extrait de tricontour.__doc__]
tricontourf(ax, *args, **kwargs) Draw contour regions on an unstructured triangular grid. [extrait de tricontourf.__doc__]
tripcolor(ax, *args, alpha=1.0, norm=None, cmap=None, vmin=None, vmax=None, shading='flat', facecolors=None, **kwargs) Create a pseudocolor plot of an unstructured triangular grid. [extrait de tripcolor.__doc__]
triplot(ax, *args, **kwargs)
violin(self, vpstats, positions=None, *, vert=None, orientation='vertical', widths=0.5, showmeans=False, showextrema=True, showmedians=False, side='both')
violinplot(self, dataset, positions=None, *, vert=None, orientation='vertical', widths=0.5, showmeans=False, showextrema=True, showmedians=False, quantiles=None, points=100, bw_method=None, side='both', data=None) Make a violin plot. [extrait de violinplot.__doc__]
vlines(self, x, ymin, ymax, colors=None, linestyles='solid', *, label='', data=None, **kwargs) Plot vertical lines at each *x* from *ymin* to *ymax*. [extrait de vlines.__doc__]
xcorr(self, x, y, *, normed=True, detrend=<function detrend_none at 0x0000020D9ABF6660>, usevlines=True, maxlags=10, data=None, **kwargs) Plot the cross correlation between *x* and *y*. [extrait de xcorr.__doc__]

Méthodes héritées de la classe _AxesBase

__getstate__, __init_subclass__, __repr__, __setstate__, __str__, __subclasshook__, add_artist, add_child_axes, add_collection, add_container, add_image, add_line, add_patch, add_table, apply_aspect, ArtistList, autoscale, autoscale_view, axis, can_pan, can_zoom, cla, clear, contains, contains_point, drag_pan, draw, draw_artist, end_pan, format_coord, format_xdata, format_ydata, get_adjustable, get_anchor, get_aspect, get_autoscale_on, get_autoscalex_on, get_autoscaley_on, get_axes_locator, get_axisbelow, get_box_aspect, get_children, get_data_ratio, get_default_bbox_extra_artists, get_facecolor, get_fc, get_forward_navigation_events, get_frame_on, get_gridspec, get_images, get_legend, get_lines, get_navigate, get_navigate_mode, get_position, get_rasterization_zorder, get_shared_x_axes, get_shared_y_axes, get_subplotspec, get_tightbbox, get_window_extent, get_xaxis, get_xaxis_text1_transform, get_xaxis_text2_transform, get_xaxis_transform, get_xbound, get_xgridlines, get_xlabel, get_xlim, get_xmajorticklabels, get_xmargin, get_xminorticklabels, get_xscale, get_xticklabels, get_xticklines, get_xticks, get_yaxis, get_yaxis_text1_transform, get_yaxis_text2_transform, get_yaxis_transform, get_ybound, get_ygridlines, get_ylabel, get_ylim, get_ymajorticklabels, get_ymargin, get_yminorticklabels, get_yscale, get_yticklabels, get_yticklines, get_yticks, grid, has_data, in_axes, invert_xaxis, invert_yaxis, label_outer, locator_params, margins, minorticks_off, minorticks_on, redraw_in_frame, relim, reset_position, set_adjustable, set_anchor, set_aspect, set_autoscale_on, set_autoscalex_on, set_autoscaley_on, set_axes_locator, set_axis_off, set_axis_on, set_axisbelow, set_box_aspect, set_facecolor, set_fc, set_figure, set_forward_navigation_events, set_frame_on, set_navigate, set_navigate_mode, set_position, set_prop_cycle, set_rasterization_zorder, set_subplotspec, set_xbound, set_xlabel, set_xlim, set_xmargin, set_xscale, set_xticklabels, set_xticks, set_ybound, set_ylabel, set_ylim, set_ymargin, set_yscale, set_yticklabels, set_yticks, sharex, sharey, start_pan, tick_params, ticklabel_format, twinx, twiny, update_datalim, xaxis_date, xaxis_inverted, yaxis_date, yaxis_inverted

Méthodes héritées de la classe Artist

add_callback, convert_xunits, convert_yunits, findobj, format_cursor_data, get_agg_filter, get_alpha, get_animated, get_clip_box, get_clip_on, get_clip_path, get_cursor_data, get_figure, get_gid, get_in_layout, get_label, get_mouseover, get_path_effects, get_picker, get_rasterized, get_sketch_params, get_snap, get_transform, get_transformed_clip_path_and_affine, get_url, get_visible, get_zorder, have_units, is_transform_set, pchanged, pick, pickable, properties, remove, remove_callback, set_agg_filter, set_alpha, set_animated, set_clip_box, set_clip_on, set_clip_path, set_gid, set_in_layout, set_label, set_mouseover, set_path_effects, set_picker, set_rasterized, set_sketch_params, set_snap, set_transform, set_url, set_visible, set_zorder, update, update_from

Méthodes héritées de la classe object

__delattr__, __dir__, __format__, __getattribute__, __hash__, __reduce__, __reduce_ex__, __setattr__, __sizeof__

Vous êtes un professionnel et vous avez besoin d'une formation ? Deep Learning avec Python
et Keras et Tensorflow
Voir le programme détaillé