doc_content
stringlengths
1
386k
doc_id
stringlengths
5
188
parse(s, dpi=72, prop=None, *, _force_standard_ps_fonts=False)[source] Parse the given math expression s at the given dpi. If prop is provided, it is a FontProperties object specifying the "default" font to use in the math expression, used for all non-math text. The results are cached, so multiple calls to parse with the same expression should be fast.
matplotlib.mathtext_api#matplotlib.mathtext.MathTextParser.parse
to_mask(texstr, dpi=120, fontsize=14)[source] [Deprecated] Convert a mathtext string to a grayscale array and depth. Parameters texstrstr A valid mathtext string, e.g., r'IQ: $sigma_i=15$'. dpifloat The dots-per-inch setting used to render the text. fontsizeint The font size in points Returns array2D uint8 alpha Mask array of rasterized tex. depthint Offset of the baseline from the bottom of the image, in pixels. Notes Deprecated since version 3.4.
matplotlib.mathtext_api#matplotlib.mathtext.MathTextParser.to_mask
to_png(filename, texstr, color='black', dpi=120, fontsize=14)[source] [Deprecated] Render a tex expression to a PNG file. Parameters filename A writable filename or fileobject. texstrstr A valid mathtext string, e.g., r'IQ: $sigma_i=15$'. colorcolor The text color. dpifloat The dots-per-inch setting used to render the text. fontsizeint The font size in points. Returns int Offset of the baseline from the bottom of the image, in pixels. Notes Deprecated since version 3.4.
matplotlib.mathtext_api#matplotlib.mathtext.MathTextParser.to_png
to_rgba(texstr, color='black', dpi=120, fontsize=14)[source] [Deprecated] Convert a mathtext string to an RGBA array and depth. Parameters texstrstr A valid mathtext string, e.g., r'IQ: $sigma_i=15$'. colorcolor The text color. dpifloat The dots-per-inch setting used to render the text. fontsizeint The font size in points. Returns array(M, N, 4) array RGBA color values of rasterized tex, colorized with color. depthint Offset of the baseline from the bottom of the image, in pixels. Notes Deprecated since version 3.4.
matplotlib.mathtext_api#matplotlib.mathtext.MathTextParser.to_rgba
exceptionmatplotlib.mathtext.MathTextWarning[source] Bases: Warning
matplotlib.mathtext_api#matplotlib.mathtext.MathTextWarning
matplotlib.mathtext.ship(ox, oy, box)[source] [Deprecated] Notes Deprecated since version 3.4:
matplotlib.mathtext_api#matplotlib.mathtext.ship
matplotlib Backend management matplotlib.use(backend, *, force=True)[source] Select the backend used for rendering and GUI integration. Parameters backendstr The backend to switch to. This can either be one of the standard backend names, which are case-insensitive: interactive backends: GTK3Agg, GTK3Cairo, GTK4Agg, GTK4Cairo, MacOSX, nbAgg, QtAgg, QtCairo, TkAgg, TkCairo, WebAgg, WX, WXAgg, WXCairo, Qt5Agg, Qt5Cairo non-interactive backends: agg, cairo, pdf, pgf, ps, svg, template or a string of the form: module://my.module.name. Switching to an interactive backend is not possible if an unrelated event loop has already been started (e.g., switching to GTK3Agg if a TkAgg window has already been opened). Switching to a non-interactive backend is always possible. forcebool, default: True If True (the default), raise an ImportError if the backend cannot be set up (either because it fails to import, or because an incompatible GUI interactive framework is already running); if False, silently ignore the failure. See also Backends matplotlib.get_backend matplotlib.get_backend()[source] Return the name of the current backend. See also matplotlib.use matplotlib.interactive(b)[source] Set whether to redraw after every plotting command (e.g. pyplot.xlabel). matplotlib.is_interactive()[source] Return whether to redraw after every plotting command. Note This function is only intended for use in backends. End users should use pyplot.isinteractive instead. Default values and styling matplotlib.rcParams[source] An instance of RcParams for handling default Matplotlib values. classmatplotlib.RcParams(*args, **kwargs)[source] A dictionary object including validation. Validating functions are defined and associated with rc parameters in matplotlib.rcsetup. The list of rcParams is: _internal.classic_mode agg.path.chunksize animation.bitrate animation.codec animation.convert_args animation.convert_path animation.embed_limit animation.ffmpeg_args animation.ffmpeg_path animation.frame_format animation.html animation.writer axes.autolimit_mode axes.axisbelow axes.edgecolor axes.facecolor axes.formatter.limits axes.formatter.min_exponent axes.formatter.offset_threshold axes.formatter.use_locale axes.formatter.use_mathtext axes.formatter.useoffset axes.grid axes.grid.axis axes.grid.which axes.labelcolor axes.labelpad axes.labelsize axes.labelweight axes.linewidth axes.prop_cycle axes.spines.bottom axes.spines.left axes.spines.right axes.spines.top axes.titlecolor axes.titlelocation axes.titlepad axes.titlesize axes.titleweight axes.titley axes.unicode_minus axes.xmargin axes.ymargin axes.zmargin axes3d.grid backend backend_fallback boxplot.bootstrap boxplot.boxprops.color boxplot.boxprops.linestyle boxplot.boxprops.linewidth boxplot.capprops.color boxplot.capprops.linestyle boxplot.capprops.linewidth boxplot.flierprops.color boxplot.flierprops.linestyle boxplot.flierprops.linewidth boxplot.flierprops.marker boxplot.flierprops.markeredgecolor boxplot.flierprops.markeredgewidth boxplot.flierprops.markerfacecolor boxplot.flierprops.markersize boxplot.meanline boxplot.meanprops.color boxplot.meanprops.linestyle boxplot.meanprops.linewidth boxplot.meanprops.marker boxplot.meanprops.markeredgecolor boxplot.meanprops.markerfacecolor boxplot.meanprops.markersize boxplot.medianprops.color boxplot.medianprops.linestyle boxplot.medianprops.linewidth boxplot.notch boxplot.patchartist boxplot.showbox boxplot.showcaps boxplot.showfliers boxplot.showmeans boxplot.vertical boxplot.whiskerprops.color boxplot.whiskerprops.linestyle boxplot.whiskerprops.linewidth boxplot.whiskers contour.corner_mask contour.linewidth contour.negative_linestyle date.autoformatter.day date.autoformatter.hour date.autoformatter.microsecond date.autoformatter.minute date.autoformatter.month date.autoformatter.second date.autoformatter.year date.converter date.epoch date.interval_multiples docstring.hardcopy errorbar.capsize figure.autolayout figure.constrained_layout.h_pad figure.constrained_layout.hspace figure.constrained_layout.use figure.constrained_layout.w_pad figure.constrained_layout.wspace figure.dpi figure.edgecolor figure.facecolor figure.figsize figure.frameon figure.max_open_warning figure.raise_window figure.subplot.bottom figure.subplot.hspace figure.subplot.left figure.subplot.right figure.subplot.top figure.subplot.wspace figure.titlesize figure.titleweight font.cursive font.family font.fantasy font.monospace font.sans-serif font.serif font.size font.stretch font.style font.variant font.weight grid.alpha grid.color grid.linestyle grid.linewidth hatch.color hatch.linewidth hist.bins image.aspect image.cmap image.composite_image image.interpolation image.lut image.origin image.resample interactive keymap.back keymap.copy keymap.forward keymap.fullscreen keymap.grid keymap.grid_minor keymap.help keymap.home keymap.pan keymap.quit keymap.quit_all keymap.save keymap.xscale keymap.yscale keymap.zoom legend.borderaxespad legend.borderpad legend.columnspacing legend.edgecolor legend.facecolor legend.fancybox legend.fontsize legend.framealpha legend.frameon legend.handleheight legend.handlelength legend.handletextpad legend.labelcolor legend.labelspacing legend.loc legend.markerscale legend.numpoints legend.scatterpoints legend.shadow legend.title_fontsize lines.antialiased lines.color lines.dash_capstyle lines.dash_joinstyle lines.dashdot_pattern lines.dashed_pattern lines.dotted_pattern lines.linestyle lines.linewidth lines.marker lines.markeredgecolor lines.markeredgewidth lines.markerfacecolor lines.markersize lines.scale_dashes lines.solid_capstyle lines.solid_joinstyle markers.fillstyle mathtext.bf mathtext.cal mathtext.default mathtext.fallback mathtext.fontset mathtext.it mathtext.rm mathtext.sf mathtext.tt patch.antialiased patch.edgecolor patch.facecolor patch.force_edgecolor patch.linewidth path.effects path.simplify path.simplify_threshold path.sketch path.snap pcolor.shading pcolormesh.snap pdf.compression pdf.fonttype pdf.inheritcolor pdf.use14corefonts pgf.preamble pgf.rcfonts pgf.texsystem polaraxes.grid ps.distiller.res ps.fonttype ps.papersize ps.useafm ps.usedistiller savefig.bbox savefig.directory savefig.dpi savefig.edgecolor savefig.facecolor savefig.format savefig.orientation savefig.pad_inches savefig.transparent scatter.edgecolors scatter.marker svg.fonttype svg.hashsalt svg.image_inline text.antialiased text.color text.hinting text.hinting_factor text.kerning_factor text.latex.preamble text.usetex timezone tk.window_focus toolbar webagg.address webagg.open_in_browser webagg.port webagg.port_retries xaxis.labellocation xtick.alignment xtick.bottom xtick.color xtick.direction xtick.labelbottom xtick.labelcolor xtick.labelsize xtick.labeltop xtick.major.bottom xtick.major.pad xtick.major.size xtick.major.top xtick.major.width xtick.minor.bottom xtick.minor.pad xtick.minor.size xtick.minor.top xtick.minor.visible xtick.minor.width xtick.top yaxis.labellocation ytick.alignment ytick.color ytick.direction ytick.labelcolor ytick.labelleft ytick.labelright ytick.labelsize ytick.left ytick.major.left ytick.major.pad ytick.major.right ytick.major.size ytick.major.width ytick.minor.left ytick.minor.pad ytick.minor.right ytick.minor.size ytick.minor.visible ytick.minor.width ytick.right See also The matplotlibrc file find_all(pattern)[source] Return the subset of this RcParams dictionary whose keys match, using re.search(), the given pattern. Note Changes to the returned dictionary are not propagated to the parent RcParams dictionary. matplotlib.rc_context(rc=None, fname=None) Return a context manager for temporarily changing rcParams. Parameters rcdict The rcParams to temporarily set. fnamestr or path-like A file with Matplotlib rc settings. If both fname and rc are given, settings from rc take precedence. See also The matplotlibrc file Examples Passing explicit values via a dict: with mpl.rc_context({'interactive': False}): fig, ax = plt.subplots() ax.plot(range(3), range(3)) fig.savefig('example.png') plt.close(fig) Loading settings from a file: with mpl.rc_context(fname='print.rc'): plt.plot(x, y) # uses 'print.rc' matplotlib.rc(group, **kwargs)[source] Set the current rcParams. group is the grouping for the rc, e.g., for lines.linewidth the group is lines, for axes.facecolor, the group is axes, and so on. Group may also be a list or tuple of group names, e.g., (xtick, ytick). kwargs is a dictionary attribute name/value pairs, e.g.,: rc('lines', linewidth=2, color='r') sets the current rcParams and is equivalent to: rcParams['lines.linewidth'] = 2 rcParams['lines.color'] = 'r' The following aliases are available to save typing for interactive users: Alias Property 'lw' 'linewidth' 'ls' 'linestyle' 'c' 'color' 'fc' 'facecolor' 'ec' 'edgecolor' 'mew' 'markeredgewidth' 'aa' 'antialiased' Thus you could abbreviate the above call as: rc('lines', lw=2, c='r') Note you can use python's kwargs dictionary facility to store dictionaries of default parameters. e.g., you can customize the font rc as follows: font = {'family' : 'monospace', 'weight' : 'bold', 'size' : 'larger'} rc('font', **font) # pass in the font dict as kwargs This enables you to easily switch between several configurations. Use matplotlib.style.use('default') or rcdefaults() to restore the default rcParams after changes. Notes Similar functionality is available by using the normal dict interface, i.e. rcParams.update({"lines.linewidth": 2, ...}) (but rcParams.update does not support abbreviations or grouping). matplotlib.rcdefaults()[source] Restore the rcParams from Matplotlib's internal default style. Style-blacklisted rcParams (defined in matplotlib.style.core.STYLE_BLACKLIST) are not updated. See also matplotlib.rc_file_defaults Restore the rcParams from the rc file originally loaded by Matplotlib. matplotlib.style.use Use a specific style file. Call style.use('default') to restore the default style. matplotlib.rc_file_defaults()[source] Restore the rcParams from the original rc file loaded by Matplotlib. Style-blacklisted rcParams (defined in matplotlib.style.core.STYLE_BLACKLIST) are not updated. matplotlib.rc_file(fname, *, use_default_template=True)[source] Update rcParams from file. Style-blacklisted rcParams (defined in matplotlib.style.core.STYLE_BLACKLIST) are not updated. Parameters fnamestr or path-like A file with Matplotlib rc settings. use_default_templatebool If True, initialize with default parameters before updating with those in the given file. If False, the current configuration persists and only the parameters specified in the file are updated. matplotlib.rc_params(fail_on_error=False)[source] Construct a RcParams instance from the default Matplotlib rc file. matplotlib.rc_params_from_file(fname, fail_on_error=False, use_default_template=True)[source] Construct a RcParams from file fname. Parameters fnamestr or path-like A file with Matplotlib rc settings. fail_on_errorbool If True, raise an error when the parser fails to convert a parameter. use_default_templatebool If True, initialize with default parameters before updating with those in the given file. If False, the configuration class only contains the parameters specified in the file. (Useful for updating dicts.) matplotlib.get_configdir()[source] Return the string path of the configuration directory. The directory is chosen as follows: If the MPLCONFIGDIR environment variable is supplied, choose that. On Linux, follow the XDG specification and look first in $XDG_CONFIG_HOME, if defined, or $HOME/.config. On other platforms, choose $HOME/.matplotlib. If the chosen directory exists and is writable, use that as the configuration directory. Else, create a temporary directory, and use it as the configuration directory. matplotlib.matplotlib_fname()[source] Get the location of the config file. The file location is determined in the following order $PWD/matplotlibrc $MATPLOTLIBRC if it is not a directory $MATPLOTLIBRC/matplotlibrc $MPLCONFIGDIR/matplotlibrc On Linux, $XDG_CONFIG_HOME/matplotlib/matplotlibrc (if $XDG_CONFIG_HOME is defined) or $HOME/.config/matplotlib/matplotlibrc (if $XDG_CONFIG_HOME is not defined) On other platforms, - $HOME/.matplotlib/matplotlibrc if $HOME is defined Lastly, it looks in $MATPLOTLIBDATA/matplotlibrc, which should always exist. matplotlib.get_data_path()[source] Return the path to Matplotlib data. Logging matplotlib.set_loglevel(level)[source] Set Matplotlib's root logger and root logger handler level, creating the handler if it does not exist yet. Typically, one should call set_loglevel("info") or set_loglevel("debug") to get additional debugging information. Parameters level{"notset", "debug", "info", "warning", "error", "critical"} The log level of the handler. Notes The first time this function is called, an additional handler is attached to Matplotlib's root handler; this handler is reused every time and this function simply manipulates the logger and handler's level. Colormaps matplotlib.colormaps[source] 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) Miscellaneous matplotlib.get_cachedir()[source] Return the string path of the cache directory. The procedure used to find the directory is the same as for _get_config_dir, except using $XDG_CACHE_HOME/$HOME/.cache instead.
matplotlib_configuration_api
matplotlib.matplotlib_fname()[source] Get the location of the config file. The file location is determined in the following order $PWD/matplotlibrc $MATPLOTLIBRC if it is not a directory $MATPLOTLIBRC/matplotlibrc $MPLCONFIGDIR/matplotlibrc On Linux, $XDG_CONFIG_HOME/matplotlib/matplotlibrc (if $XDG_CONFIG_HOME is defined) or $HOME/.config/matplotlib/matplotlibrc (if $XDG_CONFIG_HOME is not defined) On other platforms, - $HOME/.matplotlib/matplotlibrc if $HOME is defined Lastly, it looks in $MATPLOTLIBDATA/matplotlibrc, which should always exist.
matplotlib_configuration_api#matplotlib.matplotlib_fname
matplotlib.mlab Numerical Python functions written for compatibility with MATLAB commands with the same names. Most numerical Python functions can be found in the NumPy and SciPy libraries. What remains here is code for performing spectral computations and kernel density estimations. Spectral functions cohere Coherence (normalized cross spectral density) csd Cross spectral density using Welch's average periodogram detrend Remove the mean or best fit line from an array psd Power spectral density using Welch's average periodogram specgram Spectrogram (spectrum over segments of time) complex_spectrum Return the complex-valued frequency spectrum of a signal magnitude_spectrum Return the magnitude of the frequency spectrum of a signal angle_spectrum Return the angle (wrapped phase) of the frequency spectrum of a signal phase_spectrum Return the phase (unwrapped angle) of the frequency spectrum of a signal detrend_mean Remove the mean from a line. detrend_linear Remove the best fit line from a line. detrend_none Return the original line. stride_windows Get all windows in an array in a memory-efficient manner classmatplotlib.mlab.GaussianKDE(dataset, bw_method=None)[source] Bases: object Representation of a kernel-density estimate using Gaussian kernels. Parameters datasetarray-like Datapoints to estimate from. In case of univariate data this is a 1-D array, otherwise a 2D array with shape (# of dims, # of data). bw_methodstr, scalar or callable, optional The method used to calculate the estimator bandwidth. This can be 'scott', 'silverman', a scalar constant or a callable. If a scalar, this will be used directly as kde.factor. If a callable, it should take a GaussianKDE instance as only parameter and return a scalar. If None (default), 'scott' is used. Attributes datasetndarray The dataset with which gaussian_kde was initialized. dimint Number of dimensions. num_dpint Number of datapoints. factorfloat The bandwidth factor, obtained from kde.covariance_factor, with which the covariance matrix is multiplied. covariancendarray The covariance matrix of dataset, scaled by the calculated bandwidth (kde.factor). inv_covndarray The inverse of covariance. Methods kde.evaluate(points) (ndarray) Evaluate the estimated pdf on a provided set of points. kde(points) (ndarray) Same as kde.evaluate(points) covariance_factor()[source] evaluate(points)[source] Evaluate the estimated pdf on a set of points. Parameters points(# of dimensions, # of points)-array Alternatively, a (# of dimensions,) vector can be passed in and treated as a single point. Returns (# of points,)-array The values at each point. Raises ValueErrorif the dimensionality of the input points is different than the dimensionality of the KDE. scotts_factor()[source] silverman_factor()[source] matplotlib.mlab.angle_spectrum(x, Fs=None, window=None, pad_to=None, sides=None) Compute the angle of the frequency spectrum (wrapped phase spectrum) of x. Data is padded to a length of pad_to and the windowing function window is applied to the signal. Parameters x1-D array or sequence Array or sequence containing the data Fsfloat, default: 2 The sampling frequency (samples per time unit). It is used to calculate the Fourier frequencies, freqs, in cycles per time unit. windowcallable or ndarray, default: window_hanning A function or a vector of length NFFT. To create window vectors see window_hanning, window_none, numpy.blackman, numpy.hamming, numpy.bartlett, scipy.signal, scipy.signal.get_window, etc. If a function is passed as the argument, it must take a data segment as an argument and return the windowed version of the segment. sides{'default', 'onesided', 'twosided'}, optional Which sides of the spectrum to return. 'default' is one-sided for real data and two-sided for complex data. 'onesided' forces the return of a one-sided spectrum, while 'twosided' forces two-sided. pad_toint, optional The number of points to which the data segment is padded when performing the FFT. While not increasing the actual resolution of the spectrum (the minimum distance between resolvable peaks), this can give more points in the plot, allowing for more detail. This corresponds to the n parameter in the call to fft(). The default is None, which sets pad_to equal to the length of the input signal (i.e. no padding). Returns spectrum1-D array The angle of the frequency spectrum (wrapped phase spectrum). freqs1-D array The frequencies corresponding to the elements in spectrum. See also psd Returns the power spectral density. complex_spectrum Returns the complex-valued frequency spectrum. magnitude_spectrum Returns the absolute value of the complex_spectrum. angle_spectrum Returns the angle of the complex_spectrum. phase_spectrum Returns the phase (unwrapped angle) of the complex_spectrum. specgram Can return the complex spectrum of segments within the signal. matplotlib.mlab.cohere(x, y, NFFT=256, Fs=2, detrend=<function detrend_none>, window=<function window_hanning>, noverlap=0, pad_to=None, sides='default', scale_by_freq=None)[source] The coherence between x and y. Coherence is the normalized cross spectral density: \[C_{xy} = \frac{|P_{xy}|^2}{P_{xx}P_{yy}}\] Parameters x, y Array or sequence containing the data Fsfloat, default: 2 The sampling frequency (samples per time unit). It is used to calculate the Fourier frequencies, freqs, in cycles per time unit. windowcallable or ndarray, default: window_hanning A function or a vector of length NFFT. To create window vectors see window_hanning, window_none, numpy.blackman, numpy.hamming, numpy.bartlett, scipy.signal, scipy.signal.get_window, etc. If a function is passed as the argument, it must take a data segment as an argument and return the windowed version of the segment. sides{'default', 'onesided', 'twosided'}, optional Which sides of the spectrum to return. 'default' is one-sided for real data and two-sided for complex data. 'onesided' forces the return of a one-sided spectrum, while 'twosided' forces two-sided. pad_toint, optional The number of points to which the data segment is padded when performing the FFT. This can be different from NFFT, which specifies the number of data points used. While not increasing the actual resolution of the spectrum (the minimum distance between resolvable peaks), this can give more points in the plot, allowing for more detail. This corresponds to the n parameter in the call to fft(). The default is None, which sets pad_to equal to NFFT NFFTint, default: 256 The number of data points used in each block for the FFT. A power 2 is most efficient. This should NOT be used to get zero padding, or the scaling of the result will be incorrect; use pad_to for this instead. detrend{'none', 'mean', 'linear'} or callable, default: 'none' The function applied to each segment before fft-ing, designed to remove the mean or linear trend. Unlike in MATLAB, where the detrend parameter is a vector, in Matplotlib it is a function. The mlab module defines detrend_none, detrend_mean, and detrend_linear, but you can use a custom function as well. You can also use a string to choose one of the functions: 'none' calls detrend_none. 'mean' calls detrend_mean. 'linear' calls detrend_linear. scale_by_freqbool, default: True Whether the resulting density values should be scaled by the scaling frequency, which gives density in units of Hz^-1. This allows for integration over the returned frequency values. The default is True for MATLAB compatibility. noverlapint, default: 0 (no overlap) The number of points of overlap between segments. Returns Cxy1-D array The coherence vector. freqs1-D array The frequencies for the elements in Cxy. See also psd(), csd() For information about the methods used to compute \(P_{xy}\), \(P_{xx}\) and \(P_{yy}\). matplotlib.mlab.complex_spectrum(x, Fs=None, window=None, pad_to=None, sides=None) Compute the complex-valued frequency spectrum of x. Data is padded to a length of pad_to and the windowing function window is applied to the signal. Parameters x1-D array or sequence Array or sequence containing the data Fsfloat, default: 2 The sampling frequency (samples per time unit). It is used to calculate the Fourier frequencies, freqs, in cycles per time unit. windowcallable or ndarray, default: window_hanning A function or a vector of length NFFT. To create window vectors see window_hanning, window_none, numpy.blackman, numpy.hamming, numpy.bartlett, scipy.signal, scipy.signal.get_window, etc. If a function is passed as the argument, it must take a data segment as an argument and return the windowed version of the segment. sides{'default', 'onesided', 'twosided'}, optional Which sides of the spectrum to return. 'default' is one-sided for real data and two-sided for complex data. 'onesided' forces the return of a one-sided spectrum, while 'twosided' forces two-sided. pad_toint, optional The number of points to which the data segment is padded when performing the FFT. While not increasing the actual resolution of the spectrum (the minimum distance between resolvable peaks), this can give more points in the plot, allowing for more detail. This corresponds to the n parameter in the call to fft(). The default is None, which sets pad_to equal to the length of the input signal (i.e. no padding). Returns spectrum1-D array The complex-valued frequency spectrum. freqs1-D array The frequencies corresponding to the elements in spectrum. See also psd Returns the power spectral density. complex_spectrum Returns the complex-valued frequency spectrum. magnitude_spectrum Returns the absolute value of the complex_spectrum. angle_spectrum Returns the angle of the complex_spectrum. phase_spectrum Returns the phase (unwrapped angle) of the complex_spectrum. specgram Can return the complex spectrum of segments within the signal. matplotlib.mlab.csd(x, y, NFFT=None, Fs=None, detrend=None, window=None, noverlap=None, pad_to=None, sides=None, scale_by_freq=None)[source] Compute the cross-spectral density. The cross spectral density \(P_{xy}\) by Welch's average periodogram method. The vectors x and y are divided into NFFT length segments. Each segment is detrended by function detrend and windowed by function window. noverlap gives the length of the overlap between segments. The product of the direct FFTs of x and y are averaged over each segment to compute \(P_{xy}\), with a scaling to correct for power loss due to windowing. If len(x) < NFFT or len(y) < NFFT, they will be zero padded to NFFT. Parameters x, y1-D arrays or sequences Arrays or sequences containing the data Fsfloat, default: 2 The sampling frequency (samples per time unit). It is used to calculate the Fourier frequencies, freqs, in cycles per time unit. windowcallable or ndarray, default: window_hanning A function or a vector of length NFFT. To create window vectors see window_hanning, window_none, numpy.blackman, numpy.hamming, numpy.bartlett, scipy.signal, scipy.signal.get_window, etc. If a function is passed as the argument, it must take a data segment as an argument and return the windowed version of the segment. sides{'default', 'onesided', 'twosided'}, optional Which sides of the spectrum to return. 'default' is one-sided for real data and two-sided for complex data. 'onesided' forces the return of a one-sided spectrum, while 'twosided' forces two-sided. pad_toint, optional The number of points to which the data segment is padded when performing the FFT. This can be different from NFFT, which specifies the number of data points used. While not increasing the actual resolution of the spectrum (the minimum distance between resolvable peaks), this can give more points in the plot, allowing for more detail. This corresponds to the n parameter in the call to fft(). The default is None, which sets pad_to equal to NFFT NFFTint, default: 256 The number of data points used in each block for the FFT. A power 2 is most efficient. This should NOT be used to get zero padding, or the scaling of the result will be incorrect; use pad_to for this instead. detrend{'none', 'mean', 'linear'} or callable, default: 'none' The function applied to each segment before fft-ing, designed to remove the mean or linear trend. Unlike in MATLAB, where the detrend parameter is a vector, in Matplotlib it is a function. The mlab module defines detrend_none, detrend_mean, and detrend_linear, but you can use a custom function as well. You can also use a string to choose one of the functions: 'none' calls detrend_none. 'mean' calls detrend_mean. 'linear' calls detrend_linear. scale_by_freqbool, default: True Whether the resulting density values should be scaled by the scaling frequency, which gives density in units of Hz^-1. This allows for integration over the returned frequency values. The default is True for MATLAB compatibility. noverlapint, default: 0 (no overlap) The number of points of overlap between segments. Returns Pxy1-D array The values for the cross spectrum \(P_{xy}\) before scaling (real valued) freqs1-D array The frequencies corresponding to the elements in Pxy See also psd equivalent to setting y = x. References Bendat & Piersol -- Random Data: Analysis and Measurement Procedures, John Wiley & Sons (1986) matplotlib.mlab.detrend(x, key=None, axis=None)[source] Return x with its trend removed. Parameters xarray or sequence Array or sequence containing the data. key{'default', 'constant', 'mean', 'linear', 'none'} or function The detrending algorithm to use. 'default', 'mean', and 'constant' are the same as detrend_mean. 'linear' is the same as detrend_linear. 'none' is the same as detrend_none. The default is 'mean'. See the corresponding functions for more details regarding the algorithms. Can also be a function that carries out the detrend operation. axisint The axis along which to do the detrending. See also detrend_mean Implementation of the 'mean' algorithm. detrend_linear Implementation of the 'linear' algorithm. detrend_none Implementation of the 'none' algorithm. matplotlib.mlab.detrend_linear(y)[source] Return x minus best fit line; 'linear' detrending. Parameters y0-D or 1-D array or sequence Array or sequence containing the data See also detrend_mean Another detrend algorithm. detrend_none Another detrend algorithm. detrend A wrapper around all the detrend algorithms. matplotlib.mlab.detrend_mean(x, axis=None)[source] Return x minus the mean(x). Parameters xarray or sequence Array or sequence containing the data Can have any dimensionality axisint The axis along which to take the mean. See numpy.mean for a description of this argument. See also detrend_linear Another detrend algorithm. detrend_none Another detrend algorithm. detrend A wrapper around all the detrend algorithms. matplotlib.mlab.detrend_none(x, axis=None)[source] Return x: no detrending. Parameters xany object An object containing the data axisint This parameter is ignored. It is included for compatibility with detrend_mean See also detrend_mean Another detrend algorithm. detrend_linear Another detrend algorithm. detrend A wrapper around all the detrend algorithms. matplotlib.mlab.magnitude_spectrum(x, Fs=None, window=None, pad_to=None, sides=None) Compute the magnitude (absolute value) of the frequency spectrum of x. Data is padded to a length of pad_to and the windowing function window is applied to the signal. Parameters x1-D array or sequence Array or sequence containing the data Fsfloat, default: 2 The sampling frequency (samples per time unit). It is used to calculate the Fourier frequencies, freqs, in cycles per time unit. windowcallable or ndarray, default: window_hanning A function or a vector of length NFFT. To create window vectors see window_hanning, window_none, numpy.blackman, numpy.hamming, numpy.bartlett, scipy.signal, scipy.signal.get_window, etc. If a function is passed as the argument, it must take a data segment as an argument and return the windowed version of the segment. sides{'default', 'onesided', 'twosided'}, optional Which sides of the spectrum to return. 'default' is one-sided for real data and two-sided for complex data. 'onesided' forces the return of a one-sided spectrum, while 'twosided' forces two-sided. pad_toint, optional The number of points to which the data segment is padded when performing the FFT. While not increasing the actual resolution of the spectrum (the minimum distance between resolvable peaks), this can give more points in the plot, allowing for more detail. This corresponds to the n parameter in the call to fft(). The default is None, which sets pad_to equal to the length of the input signal (i.e. no padding). Returns spectrum1-D array The magnitude (absolute value) of the frequency spectrum. freqs1-D array The frequencies corresponding to the elements in spectrum. See also psd Returns the power spectral density. complex_spectrum Returns the complex-valued frequency spectrum. magnitude_spectrum Returns the absolute value of the complex_spectrum. angle_spectrum Returns the angle of the complex_spectrum. phase_spectrum Returns the phase (unwrapped angle) of the complex_spectrum. specgram Can return the complex spectrum of segments within the signal. matplotlib.mlab.phase_spectrum(x, Fs=None, window=None, pad_to=None, sides=None) Compute the phase of the frequency spectrum (unwrapped phase spectrum) of x. Data is padded to a length of pad_to and the windowing function window is applied to the signal. Parameters x1-D array or sequence Array or sequence containing the data Fsfloat, default: 2 The sampling frequency (samples per time unit). It is used to calculate the Fourier frequencies, freqs, in cycles per time unit. windowcallable or ndarray, default: window_hanning A function or a vector of length NFFT. To create window vectors see window_hanning, window_none, numpy.blackman, numpy.hamming, numpy.bartlett, scipy.signal, scipy.signal.get_window, etc. If a function is passed as the argument, it must take a data segment as an argument and return the windowed version of the segment. sides{'default', 'onesided', 'twosided'}, optional Which sides of the spectrum to return. 'default' is one-sided for real data and two-sided for complex data. 'onesided' forces the return of a one-sided spectrum, while 'twosided' forces two-sided. pad_toint, optional The number of points to which the data segment is padded when performing the FFT. While not increasing the actual resolution of the spectrum (the minimum distance between resolvable peaks), this can give more points in the plot, allowing for more detail. This corresponds to the n parameter in the call to fft(). The default is None, which sets pad_to equal to the length of the input signal (i.e. no padding). Returns spectrum1-D array The phase of the frequency spectrum (unwrapped phase spectrum). freqs1-D array The frequencies corresponding to the elements in spectrum. See also psd Returns the power spectral density. complex_spectrum Returns the complex-valued frequency spectrum. magnitude_spectrum Returns the absolute value of the complex_spectrum. angle_spectrum Returns the angle of the complex_spectrum. phase_spectrum Returns the phase (unwrapped angle) of the complex_spectrum. specgram Can return the complex spectrum of segments within the signal. matplotlib.mlab.psd(x, NFFT=None, Fs=None, detrend=None, window=None, noverlap=None, pad_to=None, sides=None, scale_by_freq=None)[source] Compute the power spectral density. The power spectral density \(P_{xx}\) by Welch's average periodogram method. The vector x is divided into NFFT length segments. Each segment is detrended by function detrend and windowed by function window. noverlap gives the length of the overlap between segments. The \(|\mathrm{fft}(i)|^2\) of each segment \(i\) are averaged to compute \(P_{xx}\). If len(x) < NFFT, it will be zero padded to NFFT. Parameters x1-D array or sequence Array or sequence containing the data Fsfloat, default: 2 The sampling frequency (samples per time unit). It is used to calculate the Fourier frequencies, freqs, in cycles per time unit. windowcallable or ndarray, default: window_hanning A function or a vector of length NFFT. To create window vectors see window_hanning, window_none, numpy.blackman, numpy.hamming, numpy.bartlett, scipy.signal, scipy.signal.get_window, etc. If a function is passed as the argument, it must take a data segment as an argument and return the windowed version of the segment. sides{'default', 'onesided', 'twosided'}, optional Which sides of the spectrum to return. 'default' is one-sided for real data and two-sided for complex data. 'onesided' forces the return of a one-sided spectrum, while 'twosided' forces two-sided. pad_toint, optional The number of points to which the data segment is padded when performing the FFT. This can be different from NFFT, which specifies the number of data points used. While not increasing the actual resolution of the spectrum (the minimum distance between resolvable peaks), this can give more points in the plot, allowing for more detail. This corresponds to the n parameter in the call to fft(). The default is None, which sets pad_to equal to NFFT NFFTint, default: 256 The number of data points used in each block for the FFT. A power 2 is most efficient. This should NOT be used to get zero padding, or the scaling of the result will be incorrect; use pad_to for this instead. detrend{'none', 'mean', 'linear'} or callable, default: 'none' The function applied to each segment before fft-ing, designed to remove the mean or linear trend. Unlike in MATLAB, where the detrend parameter is a vector, in Matplotlib it is a function. The mlab module defines detrend_none, detrend_mean, and detrend_linear, but you can use a custom function as well. You can also use a string to choose one of the functions: 'none' calls detrend_none. 'mean' calls detrend_mean. 'linear' calls detrend_linear. scale_by_freqbool, default: True Whether the resulting density values should be scaled by the scaling frequency, which gives density in units of Hz^-1. This allows for integration over the returned frequency values. The default is True for MATLAB compatibility. noverlapint, default: 0 (no overlap) The number of points of overlap between segments. Returns Pxx1-D array The values for the power spectrum \(P_{xx}\) (real valued) freqs1-D array The frequencies corresponding to the elements in Pxx See also specgram specgram differs in the default overlap; in not returning the mean of the segment periodograms; and in returning the times of the segments. magnitude_spectrum returns the magnitude spectrum. csd returns the spectral density between two signals. References Bendat & Piersol -- Random Data: Analysis and Measurement Procedures, John Wiley & Sons (1986) matplotlib.mlab.specgram(x, NFFT=None, Fs=None, detrend=None, window=None, noverlap=None, pad_to=None, sides=None, scale_by_freq=None, mode=None)[source] Compute a spectrogram. Compute and plot a spectrogram of data in x. Data are split into NFFT length segments and the spectrum of each section is computed. The windowing function window is applied to each segment, and the amount of overlap of each segment is specified with noverlap. Parameters xarray-like 1-D array or sequence. Fsfloat, default: 2 The sampling frequency (samples per time unit). It is used to calculate the Fourier frequencies, freqs, in cycles per time unit. windowcallable or ndarray, default: window_hanning A function or a vector of length NFFT. To create window vectors see window_hanning, window_none, numpy.blackman, numpy.hamming, numpy.bartlett, scipy.signal, scipy.signal.get_window, etc. If a function is passed as the argument, it must take a data segment as an argument and return the windowed version of the segment. sides{'default', 'onesided', 'twosided'}, optional Which sides of the spectrum to return. 'default' is one-sided for real data and two-sided for complex data. 'onesided' forces the return of a one-sided spectrum, while 'twosided' forces two-sided. pad_toint, optional The number of points to which the data segment is padded when performing the FFT. This can be different from NFFT, which specifies the number of data points used. While not increasing the actual resolution of the spectrum (the minimum distance between resolvable peaks), this can give more points in the plot, allowing for more detail. This corresponds to the n parameter in the call to fft(). The default is None, which sets pad_to equal to NFFT NFFTint, default: 256 The number of data points used in each block for the FFT. A power 2 is most efficient. This should NOT be used to get zero padding, or the scaling of the result will be incorrect; use pad_to for this instead. detrend{'none', 'mean', 'linear'} or callable, default: 'none' The function applied to each segment before fft-ing, designed to remove the mean or linear trend. Unlike in MATLAB, where the detrend parameter is a vector, in Matplotlib it is a function. The mlab module defines detrend_none, detrend_mean, and detrend_linear, but you can use a custom function as well. You can also use a string to choose one of the functions: 'none' calls detrend_none. 'mean' calls detrend_mean. 'linear' calls detrend_linear. scale_by_freqbool, default: True Whether the resulting density values should be scaled by the scaling frequency, which gives density in units of Hz^-1. This allows for integration over the returned frequency values. The default is True for MATLAB compatibility. noverlapint, default: 128 The number of points of overlap between blocks. modestr, default: 'psd' What sort of spectrum to use: 'psd' Returns the power spectral density. 'complex' Returns the complex-valued frequency spectrum. 'magnitude' Returns the magnitude spectrum. 'angle' Returns the phase spectrum without unwrapping. 'phase' Returns the phase spectrum with unwrapping. Returns spectrumarray-like 2D array, columns are the periodograms of successive segments. freqsarray-like 1-D array, frequencies corresponding to the rows in spectrum. tarray-like 1-D array, the times corresponding to midpoints of segments (i.e the columns in spectrum). See also psd differs in the overlap and in the return values. complex_spectrum similar, but with complex valued frequencies. magnitude_spectrum similar single segment when mode is 'magnitude'. angle_spectrum similar to single segment when mode is 'angle'. phase_spectrum similar to single segment when mode is 'phase'. Notes detrend and scale_by_freq only apply when mode is set to 'psd'. matplotlib.mlab.stride_windows(x, n, noverlap=None, axis=0)[source] Get all windows of x with length n as a single array, using strides to avoid data duplication. Warning It is not safe to write to the output array. Multiple elements may point to the same piece of memory, so modifying one value may change others. Parameters x1D array or sequence Array or sequence containing the data. nint The number of data points in each window. noverlapint, default: 0 (no overlap) The overlap between adjacent windows. axisint The axis along which the windows will run. References stackoverflow: Rolling window for 1D arrays in Numpy? stackoverflow: Using strides for an efficient moving average filter matplotlib.mlab.window_hanning(x)[source] Return x times the hanning window of len(x). See also window_none Another window algorithm. matplotlib.mlab.window_none(x)[source] No window function; simply return x. See also window_hanning Another window algorithm.
matplotlib.mlab_api
matplotlib.mlab.angle_spectrum(x, Fs=None, window=None, pad_to=None, sides=None) Compute the angle of the frequency spectrum (wrapped phase spectrum) of x. Data is padded to a length of pad_to and the windowing function window is applied to the signal. Parameters x1-D array or sequence Array or sequence containing the data Fsfloat, default: 2 The sampling frequency (samples per time unit). It is used to calculate the Fourier frequencies, freqs, in cycles per time unit. windowcallable or ndarray, default: window_hanning A function or a vector of length NFFT. To create window vectors see window_hanning, window_none, numpy.blackman, numpy.hamming, numpy.bartlett, scipy.signal, scipy.signal.get_window, etc. If a function is passed as the argument, it must take a data segment as an argument and return the windowed version of the segment. sides{'default', 'onesided', 'twosided'}, optional Which sides of the spectrum to return. 'default' is one-sided for real data and two-sided for complex data. 'onesided' forces the return of a one-sided spectrum, while 'twosided' forces two-sided. pad_toint, optional The number of points to which the data segment is padded when performing the FFT. While not increasing the actual resolution of the spectrum (the minimum distance between resolvable peaks), this can give more points in the plot, allowing for more detail. This corresponds to the n parameter in the call to fft(). The default is None, which sets pad_to equal to the length of the input signal (i.e. no padding). Returns spectrum1-D array The angle of the frequency spectrum (wrapped phase spectrum). freqs1-D array The frequencies corresponding to the elements in spectrum. See also psd Returns the power spectral density. complex_spectrum Returns the complex-valued frequency spectrum. magnitude_spectrum Returns the absolute value of the complex_spectrum. angle_spectrum Returns the angle of the complex_spectrum. phase_spectrum Returns the phase (unwrapped angle) of the complex_spectrum. specgram Can return the complex spectrum of segments within the signal.
matplotlib.mlab_api#matplotlib.mlab.angle_spectrum
matplotlib.mlab.cohere(x, y, NFFT=256, Fs=2, detrend=<function detrend_none>, window=<function window_hanning>, noverlap=0, pad_to=None, sides='default', scale_by_freq=None)[source] The coherence between x and y. Coherence is the normalized cross spectral density: \[C_{xy} = \frac{|P_{xy}|^2}{P_{xx}P_{yy}}\] Parameters x, y Array or sequence containing the data Fsfloat, default: 2 The sampling frequency (samples per time unit). It is used to calculate the Fourier frequencies, freqs, in cycles per time unit. windowcallable or ndarray, default: window_hanning A function or a vector of length NFFT. To create window vectors see window_hanning, window_none, numpy.blackman, numpy.hamming, numpy.bartlett, scipy.signal, scipy.signal.get_window, etc. If a function is passed as the argument, it must take a data segment as an argument and return the windowed version of the segment. sides{'default', 'onesided', 'twosided'}, optional Which sides of the spectrum to return. 'default' is one-sided for real data and two-sided for complex data. 'onesided' forces the return of a one-sided spectrum, while 'twosided' forces two-sided. pad_toint, optional The number of points to which the data segment is padded when performing the FFT. This can be different from NFFT, which specifies the number of data points used. While not increasing the actual resolution of the spectrum (the minimum distance between resolvable peaks), this can give more points in the plot, allowing for more detail. This corresponds to the n parameter in the call to fft(). The default is None, which sets pad_to equal to NFFT NFFTint, default: 256 The number of data points used in each block for the FFT. A power 2 is most efficient. This should NOT be used to get zero padding, or the scaling of the result will be incorrect; use pad_to for this instead. detrend{'none', 'mean', 'linear'} or callable, default: 'none' The function applied to each segment before fft-ing, designed to remove the mean or linear trend. Unlike in MATLAB, where the detrend parameter is a vector, in Matplotlib it is a function. The mlab module defines detrend_none, detrend_mean, and detrend_linear, but you can use a custom function as well. You can also use a string to choose one of the functions: 'none' calls detrend_none. 'mean' calls detrend_mean. 'linear' calls detrend_linear. scale_by_freqbool, default: True Whether the resulting density values should be scaled by the scaling frequency, which gives density in units of Hz^-1. This allows for integration over the returned frequency values. The default is True for MATLAB compatibility. noverlapint, default: 0 (no overlap) The number of points of overlap between segments. Returns Cxy1-D array The coherence vector. freqs1-D array The frequencies for the elements in Cxy. See also psd(), csd() For information about the methods used to compute \(P_{xy}\), \(P_{xx}\) and \(P_{yy}\).
matplotlib.mlab_api#matplotlib.mlab.cohere
matplotlib.mlab.complex_spectrum(x, Fs=None, window=None, pad_to=None, sides=None) Compute the complex-valued frequency spectrum of x. Data is padded to a length of pad_to and the windowing function window is applied to the signal. Parameters x1-D array or sequence Array or sequence containing the data Fsfloat, default: 2 The sampling frequency (samples per time unit). It is used to calculate the Fourier frequencies, freqs, in cycles per time unit. windowcallable or ndarray, default: window_hanning A function or a vector of length NFFT. To create window vectors see window_hanning, window_none, numpy.blackman, numpy.hamming, numpy.bartlett, scipy.signal, scipy.signal.get_window, etc. If a function is passed as the argument, it must take a data segment as an argument and return the windowed version of the segment. sides{'default', 'onesided', 'twosided'}, optional Which sides of the spectrum to return. 'default' is one-sided for real data and two-sided for complex data. 'onesided' forces the return of a one-sided spectrum, while 'twosided' forces two-sided. pad_toint, optional The number of points to which the data segment is padded when performing the FFT. While not increasing the actual resolution of the spectrum (the minimum distance between resolvable peaks), this can give more points in the plot, allowing for more detail. This corresponds to the n parameter in the call to fft(). The default is None, which sets pad_to equal to the length of the input signal (i.e. no padding). Returns spectrum1-D array The complex-valued frequency spectrum. freqs1-D array The frequencies corresponding to the elements in spectrum. See also psd Returns the power spectral density. complex_spectrum Returns the complex-valued frequency spectrum. magnitude_spectrum Returns the absolute value of the complex_spectrum. angle_spectrum Returns the angle of the complex_spectrum. phase_spectrum Returns the phase (unwrapped angle) of the complex_spectrum. specgram Can return the complex spectrum of segments within the signal.
matplotlib.mlab_api#matplotlib.mlab.complex_spectrum
matplotlib.mlab.csd(x, y, NFFT=None, Fs=None, detrend=None, window=None, noverlap=None, pad_to=None, sides=None, scale_by_freq=None)[source] Compute the cross-spectral density. The cross spectral density \(P_{xy}\) by Welch's average periodogram method. The vectors x and y are divided into NFFT length segments. Each segment is detrended by function detrend and windowed by function window. noverlap gives the length of the overlap between segments. The product of the direct FFTs of x and y are averaged over each segment to compute \(P_{xy}\), with a scaling to correct for power loss due to windowing. If len(x) < NFFT or len(y) < NFFT, they will be zero padded to NFFT. Parameters x, y1-D arrays or sequences Arrays or sequences containing the data Fsfloat, default: 2 The sampling frequency (samples per time unit). It is used to calculate the Fourier frequencies, freqs, in cycles per time unit. windowcallable or ndarray, default: window_hanning A function or a vector of length NFFT. To create window vectors see window_hanning, window_none, numpy.blackman, numpy.hamming, numpy.bartlett, scipy.signal, scipy.signal.get_window, etc. If a function is passed as the argument, it must take a data segment as an argument and return the windowed version of the segment. sides{'default', 'onesided', 'twosided'}, optional Which sides of the spectrum to return. 'default' is one-sided for real data and two-sided for complex data. 'onesided' forces the return of a one-sided spectrum, while 'twosided' forces two-sided. pad_toint, optional The number of points to which the data segment is padded when performing the FFT. This can be different from NFFT, which specifies the number of data points used. While not increasing the actual resolution of the spectrum (the minimum distance between resolvable peaks), this can give more points in the plot, allowing for more detail. This corresponds to the n parameter in the call to fft(). The default is None, which sets pad_to equal to NFFT NFFTint, default: 256 The number of data points used in each block for the FFT. A power 2 is most efficient. This should NOT be used to get zero padding, or the scaling of the result will be incorrect; use pad_to for this instead. detrend{'none', 'mean', 'linear'} or callable, default: 'none' The function applied to each segment before fft-ing, designed to remove the mean or linear trend. Unlike in MATLAB, where the detrend parameter is a vector, in Matplotlib it is a function. The mlab module defines detrend_none, detrend_mean, and detrend_linear, but you can use a custom function as well. You can also use a string to choose one of the functions: 'none' calls detrend_none. 'mean' calls detrend_mean. 'linear' calls detrend_linear. scale_by_freqbool, default: True Whether the resulting density values should be scaled by the scaling frequency, which gives density in units of Hz^-1. This allows for integration over the returned frequency values. The default is True for MATLAB compatibility. noverlapint, default: 0 (no overlap) The number of points of overlap between segments. Returns Pxy1-D array The values for the cross spectrum \(P_{xy}\) before scaling (real valued) freqs1-D array The frequencies corresponding to the elements in Pxy See also psd equivalent to setting y = x. References Bendat & Piersol -- Random Data: Analysis and Measurement Procedures, John Wiley & Sons (1986)
matplotlib.mlab_api#matplotlib.mlab.csd
matplotlib.mlab.detrend(x, key=None, axis=None)[source] Return x with its trend removed. Parameters xarray or sequence Array or sequence containing the data. key{'default', 'constant', 'mean', 'linear', 'none'} or function The detrending algorithm to use. 'default', 'mean', and 'constant' are the same as detrend_mean. 'linear' is the same as detrend_linear. 'none' is the same as detrend_none. The default is 'mean'. See the corresponding functions for more details regarding the algorithms. Can also be a function that carries out the detrend operation. axisint The axis along which to do the detrending. See also detrend_mean Implementation of the 'mean' algorithm. detrend_linear Implementation of the 'linear' algorithm. detrend_none Implementation of the 'none' algorithm.
matplotlib.mlab_api#matplotlib.mlab.detrend
matplotlib.mlab.detrend_linear(y)[source] Return x minus best fit line; 'linear' detrending. Parameters y0-D or 1-D array or sequence Array or sequence containing the data See also detrend_mean Another detrend algorithm. detrend_none Another detrend algorithm. detrend A wrapper around all the detrend algorithms.
matplotlib.mlab_api#matplotlib.mlab.detrend_linear
matplotlib.mlab.detrend_mean(x, axis=None)[source] Return x minus the mean(x). Parameters xarray or sequence Array or sequence containing the data Can have any dimensionality axisint The axis along which to take the mean. See numpy.mean for a description of this argument. See also detrend_linear Another detrend algorithm. detrend_none Another detrend algorithm. detrend A wrapper around all the detrend algorithms.
matplotlib.mlab_api#matplotlib.mlab.detrend_mean
matplotlib.mlab.detrend_none(x, axis=None)[source] Return x: no detrending. Parameters xany object An object containing the data axisint This parameter is ignored. It is included for compatibility with detrend_mean See also detrend_mean Another detrend algorithm. detrend_linear Another detrend algorithm. detrend A wrapper around all the detrend algorithms.
matplotlib.mlab_api#matplotlib.mlab.detrend_none
classmatplotlib.mlab.GaussianKDE(dataset, bw_method=None)[source] Bases: object Representation of a kernel-density estimate using Gaussian kernels. Parameters datasetarray-like Datapoints to estimate from. In case of univariate data this is a 1-D array, otherwise a 2D array with shape (# of dims, # of data). bw_methodstr, scalar or callable, optional The method used to calculate the estimator bandwidth. This can be 'scott', 'silverman', a scalar constant or a callable. If a scalar, this will be used directly as kde.factor. If a callable, it should take a GaussianKDE instance as only parameter and return a scalar. If None (default), 'scott' is used. Attributes datasetndarray The dataset with which gaussian_kde was initialized. dimint Number of dimensions. num_dpint Number of datapoints. factorfloat The bandwidth factor, obtained from kde.covariance_factor, with which the covariance matrix is multiplied. covariancendarray The covariance matrix of dataset, scaled by the calculated bandwidth (kde.factor). inv_covndarray The inverse of covariance. Methods kde.evaluate(points) (ndarray) Evaluate the estimated pdf on a provided set of points. kde(points) (ndarray) Same as kde.evaluate(points) covariance_factor()[source] evaluate(points)[source] Evaluate the estimated pdf on a set of points. Parameters points(# of dimensions, # of points)-array Alternatively, a (# of dimensions,) vector can be passed in and treated as a single point. Returns (# of points,)-array The values at each point. Raises ValueErrorif the dimensionality of the input points is different than the dimensionality of the KDE. scotts_factor()[source] silverman_factor()[source]
matplotlib.mlab_api#matplotlib.mlab.GaussianKDE
covariance_factor()[source]
matplotlib.mlab_api#matplotlib.mlab.GaussianKDE.covariance_factor
evaluate(points)[source] Evaluate the estimated pdf on a set of points. Parameters points(# of dimensions, # of points)-array Alternatively, a (# of dimensions,) vector can be passed in and treated as a single point. Returns (# of points,)-array The values at each point. Raises ValueErrorif the dimensionality of the input points is different than the dimensionality of the KDE.
matplotlib.mlab_api#matplotlib.mlab.GaussianKDE.evaluate
scotts_factor()[source]
matplotlib.mlab_api#matplotlib.mlab.GaussianKDE.scotts_factor
silverman_factor()[source]
matplotlib.mlab_api#matplotlib.mlab.GaussianKDE.silverman_factor
matplotlib.mlab.magnitude_spectrum(x, Fs=None, window=None, pad_to=None, sides=None) Compute the magnitude (absolute value) of the frequency spectrum of x. Data is padded to a length of pad_to and the windowing function window is applied to the signal. Parameters x1-D array or sequence Array or sequence containing the data Fsfloat, default: 2 The sampling frequency (samples per time unit). It is used to calculate the Fourier frequencies, freqs, in cycles per time unit. windowcallable or ndarray, default: window_hanning A function or a vector of length NFFT. To create window vectors see window_hanning, window_none, numpy.blackman, numpy.hamming, numpy.bartlett, scipy.signal, scipy.signal.get_window, etc. If a function is passed as the argument, it must take a data segment as an argument and return the windowed version of the segment. sides{'default', 'onesided', 'twosided'}, optional Which sides of the spectrum to return. 'default' is one-sided for real data and two-sided for complex data. 'onesided' forces the return of a one-sided spectrum, while 'twosided' forces two-sided. pad_toint, optional The number of points to which the data segment is padded when performing the FFT. While not increasing the actual resolution of the spectrum (the minimum distance between resolvable peaks), this can give more points in the plot, allowing for more detail. This corresponds to the n parameter in the call to fft(). The default is None, which sets pad_to equal to the length of the input signal (i.e. no padding). Returns spectrum1-D array The magnitude (absolute value) of the frequency spectrum. freqs1-D array The frequencies corresponding to the elements in spectrum. See also psd Returns the power spectral density. complex_spectrum Returns the complex-valued frequency spectrum. magnitude_spectrum Returns the absolute value of the complex_spectrum. angle_spectrum Returns the angle of the complex_spectrum. phase_spectrum Returns the phase (unwrapped angle) of the complex_spectrum. specgram Can return the complex spectrum of segments within the signal.
matplotlib.mlab_api#matplotlib.mlab.magnitude_spectrum
matplotlib.mlab.phase_spectrum(x, Fs=None, window=None, pad_to=None, sides=None) Compute the phase of the frequency spectrum (unwrapped phase spectrum) of x. Data is padded to a length of pad_to and the windowing function window is applied to the signal. Parameters x1-D array or sequence Array or sequence containing the data Fsfloat, default: 2 The sampling frequency (samples per time unit). It is used to calculate the Fourier frequencies, freqs, in cycles per time unit. windowcallable or ndarray, default: window_hanning A function or a vector of length NFFT. To create window vectors see window_hanning, window_none, numpy.blackman, numpy.hamming, numpy.bartlett, scipy.signal, scipy.signal.get_window, etc. If a function is passed as the argument, it must take a data segment as an argument and return the windowed version of the segment. sides{'default', 'onesided', 'twosided'}, optional Which sides of the spectrum to return. 'default' is one-sided for real data and two-sided for complex data. 'onesided' forces the return of a one-sided spectrum, while 'twosided' forces two-sided. pad_toint, optional The number of points to which the data segment is padded when performing the FFT. While not increasing the actual resolution of the spectrum (the minimum distance between resolvable peaks), this can give more points in the plot, allowing for more detail. This corresponds to the n parameter in the call to fft(). The default is None, which sets pad_to equal to the length of the input signal (i.e. no padding). Returns spectrum1-D array The phase of the frequency spectrum (unwrapped phase spectrum). freqs1-D array The frequencies corresponding to the elements in spectrum. See also psd Returns the power spectral density. complex_spectrum Returns the complex-valued frequency spectrum. magnitude_spectrum Returns the absolute value of the complex_spectrum. angle_spectrum Returns the angle of the complex_spectrum. phase_spectrum Returns the phase (unwrapped angle) of the complex_spectrum. specgram Can return the complex spectrum of segments within the signal.
matplotlib.mlab_api#matplotlib.mlab.phase_spectrum
matplotlib.mlab.psd(x, NFFT=None, Fs=None, detrend=None, window=None, noverlap=None, pad_to=None, sides=None, scale_by_freq=None)[source] Compute the power spectral density. The power spectral density \(P_{xx}\) by Welch's average periodogram method. The vector x is divided into NFFT length segments. Each segment is detrended by function detrend and windowed by function window. noverlap gives the length of the overlap between segments. The \(|\mathrm{fft}(i)|^2\) of each segment \(i\) are averaged to compute \(P_{xx}\). If len(x) < NFFT, it will be zero padded to NFFT. Parameters x1-D array or sequence Array or sequence containing the data Fsfloat, default: 2 The sampling frequency (samples per time unit). It is used to calculate the Fourier frequencies, freqs, in cycles per time unit. windowcallable or ndarray, default: window_hanning A function or a vector of length NFFT. To create window vectors see window_hanning, window_none, numpy.blackman, numpy.hamming, numpy.bartlett, scipy.signal, scipy.signal.get_window, etc. If a function is passed as the argument, it must take a data segment as an argument and return the windowed version of the segment. sides{'default', 'onesided', 'twosided'}, optional Which sides of the spectrum to return. 'default' is one-sided for real data and two-sided for complex data. 'onesided' forces the return of a one-sided spectrum, while 'twosided' forces two-sided. pad_toint, optional The number of points to which the data segment is padded when performing the FFT. This can be different from NFFT, which specifies the number of data points used. While not increasing the actual resolution of the spectrum (the minimum distance between resolvable peaks), this can give more points in the plot, allowing for more detail. This corresponds to the n parameter in the call to fft(). The default is None, which sets pad_to equal to NFFT NFFTint, default: 256 The number of data points used in each block for the FFT. A power 2 is most efficient. This should NOT be used to get zero padding, or the scaling of the result will be incorrect; use pad_to for this instead. detrend{'none', 'mean', 'linear'} or callable, default: 'none' The function applied to each segment before fft-ing, designed to remove the mean or linear trend. Unlike in MATLAB, where the detrend parameter is a vector, in Matplotlib it is a function. The mlab module defines detrend_none, detrend_mean, and detrend_linear, but you can use a custom function as well. You can also use a string to choose one of the functions: 'none' calls detrend_none. 'mean' calls detrend_mean. 'linear' calls detrend_linear. scale_by_freqbool, default: True Whether the resulting density values should be scaled by the scaling frequency, which gives density in units of Hz^-1. This allows for integration over the returned frequency values. The default is True for MATLAB compatibility. noverlapint, default: 0 (no overlap) The number of points of overlap between segments. Returns Pxx1-D array The values for the power spectrum \(P_{xx}\) (real valued) freqs1-D array The frequencies corresponding to the elements in Pxx See also specgram specgram differs in the default overlap; in not returning the mean of the segment periodograms; and in returning the times of the segments. magnitude_spectrum returns the magnitude spectrum. csd returns the spectral density between two signals. References Bendat & Piersol -- Random Data: Analysis and Measurement Procedures, John Wiley & Sons (1986)
matplotlib.mlab_api#matplotlib.mlab.psd
matplotlib.mlab.specgram(x, NFFT=None, Fs=None, detrend=None, window=None, noverlap=None, pad_to=None, sides=None, scale_by_freq=None, mode=None)[source] Compute a spectrogram. Compute and plot a spectrogram of data in x. Data are split into NFFT length segments and the spectrum of each section is computed. The windowing function window is applied to each segment, and the amount of overlap of each segment is specified with noverlap. Parameters xarray-like 1-D array or sequence. Fsfloat, default: 2 The sampling frequency (samples per time unit). It is used to calculate the Fourier frequencies, freqs, in cycles per time unit. windowcallable or ndarray, default: window_hanning A function or a vector of length NFFT. To create window vectors see window_hanning, window_none, numpy.blackman, numpy.hamming, numpy.bartlett, scipy.signal, scipy.signal.get_window, etc. If a function is passed as the argument, it must take a data segment as an argument and return the windowed version of the segment. sides{'default', 'onesided', 'twosided'}, optional Which sides of the spectrum to return. 'default' is one-sided for real data and two-sided for complex data. 'onesided' forces the return of a one-sided spectrum, while 'twosided' forces two-sided. pad_toint, optional The number of points to which the data segment is padded when performing the FFT. This can be different from NFFT, which specifies the number of data points used. While not increasing the actual resolution of the spectrum (the minimum distance between resolvable peaks), this can give more points in the plot, allowing for more detail. This corresponds to the n parameter in the call to fft(). The default is None, which sets pad_to equal to NFFT NFFTint, default: 256 The number of data points used in each block for the FFT. A power 2 is most efficient. This should NOT be used to get zero padding, or the scaling of the result will be incorrect; use pad_to for this instead. detrend{'none', 'mean', 'linear'} or callable, default: 'none' The function applied to each segment before fft-ing, designed to remove the mean or linear trend. Unlike in MATLAB, where the detrend parameter is a vector, in Matplotlib it is a function. The mlab module defines detrend_none, detrend_mean, and detrend_linear, but you can use a custom function as well. You can also use a string to choose one of the functions: 'none' calls detrend_none. 'mean' calls detrend_mean. 'linear' calls detrend_linear. scale_by_freqbool, default: True Whether the resulting density values should be scaled by the scaling frequency, which gives density in units of Hz^-1. This allows for integration over the returned frequency values. The default is True for MATLAB compatibility. noverlapint, default: 128 The number of points of overlap between blocks. modestr, default: 'psd' What sort of spectrum to use: 'psd' Returns the power spectral density. 'complex' Returns the complex-valued frequency spectrum. 'magnitude' Returns the magnitude spectrum. 'angle' Returns the phase spectrum without unwrapping. 'phase' Returns the phase spectrum with unwrapping. Returns spectrumarray-like 2D array, columns are the periodograms of successive segments. freqsarray-like 1-D array, frequencies corresponding to the rows in spectrum. tarray-like 1-D array, the times corresponding to midpoints of segments (i.e the columns in spectrum). See also psd differs in the overlap and in the return values. complex_spectrum similar, but with complex valued frequencies. magnitude_spectrum similar single segment when mode is 'magnitude'. angle_spectrum similar to single segment when mode is 'angle'. phase_spectrum similar to single segment when mode is 'phase'. Notes detrend and scale_by_freq only apply when mode is set to 'psd'.
matplotlib.mlab_api#matplotlib.mlab.specgram
matplotlib.mlab.stride_windows(x, n, noverlap=None, axis=0)[source] Get all windows of x with length n as a single array, using strides to avoid data duplication. Warning It is not safe to write to the output array. Multiple elements may point to the same piece of memory, so modifying one value may change others. Parameters x1D array or sequence Array or sequence containing the data. nint The number of data points in each window. noverlapint, default: 0 (no overlap) The overlap between adjacent windows. axisint The axis along which the windows will run. References stackoverflow: Rolling window for 1D arrays in Numpy? stackoverflow: Using strides for an efficient moving average filter
matplotlib.mlab_api#matplotlib.mlab.stride_windows
matplotlib.mlab.window_hanning(x)[source] Return x times the hanning window of len(x). See also window_none Another window algorithm.
matplotlib.mlab_api#matplotlib.mlab.window_hanning
matplotlib.mlab.window_none(x)[source] No window function; simply return x. See also window_hanning Another window algorithm.
matplotlib.mlab_api#matplotlib.mlab.window_none
mpl_toolkits.mplot3d The mplot3d toolkit adds simple 3D plotting capabilities (scatter, surface, line, mesh, etc.) to Matplotlib by supplying an Axes object that can create a 2D projection of a 3D scene. The resulting graph will have the same look and feel as regular 2D plots. Not the fastest or most feature complete 3D library out there, but it ships with Matplotlib and thus may be a lighter weight solution for some use cases. See the mplot3d tutorial for more information. The interactive backends also provide the ability to rotate and zoom the 3D scene. One can rotate the 3D scene by simply clicking-and-dragging the scene. Zooming is done by right-clicking the scene and dragging the mouse up and down (unlike 2D plots, the toolbar zoom button is not used). mplot3d FAQ How is mplot3d different from Mayavi? My 3D plot doesn't look right at certain viewing angles I don't like how the 3D plot is laid out, how do I change that? Note pyplot cannot be used to add content to 3D plots, because its function signatures are strictly 2D and cannot handle the additional information needed for 3D. Instead, use the explicit API by calling the respective methods on the Axes3D object. axes3d Note 3D plotting in Matplotlib is still not as mature as the 2D case. Please report any functions that do not behave as expected as a bug. In addition, help and patches would be greatly appreciated! axes3d.Axes3D(fig[, rect, azim, elev, ...]) 3D axes object. axis3d Note See mpl_toolkits.mplot3d.axis3d._axinfo for a dictionary containing constants that may be modified for controlling the look and feel of mplot3d axes (e.g., label spacing, font colors and panel colors). Historically, axis3d has suffered from having hard-coded constants that precluded user adjustments, and this dictionary was implemented in version 1.1 as a stop-gap measure. axis3d.Axis(adir, v_intervalx, d_intervalx, ...) An Axis class for the 3D plots. art3d art3d.Line3D(xs, ys, zs, *args, **kwargs) 3D line object. art3d.Line3DCollection(segments, *args[, zorder]) A collection of 3D lines. art3d.Patch3D(*args[, zs, zdir]) 3D patch object. art3d.Patch3DCollection(*args[, zs, zdir, ...]) A collection of 3D patches. art3d.Path3DCollection(*args[, zs, zdir, ...]) A collection of 3D paths. art3d.PathPatch3D(path, *[, zs, zdir]) 3D PathPatch object. art3d.Poly3DCollection(verts, *args[, zsort]) A collection of 3D polygons. art3d.Text3D([x, y, z, text, zdir]) Text object with 3D position and direction. art3d.get_dir_vector(zdir) Return a direction vector. art3d.juggle_axes(xs, ys, zs, zdir) Reorder coordinates so that 2D xs, ys can be plotted in the plane orthogonal to zdir. art3d.line_2d_to_3d(line[, zs, zdir]) Convert a 2D line to 3D. art3d.line_collection_2d_to_3d(col[, zs, zdir]) Convert a LineCollection to a Line3DCollection object. art3d.patch_2d_to_3d(patch[, z, zdir]) Convert a Patch to a Patch3D object. art3d.patch_collection_2d_to_3d(col[, zs, ...]) Convert a PatchCollection into a Patch3DCollection object (or a PathCollection into a Path3DCollection object). art3d.pathpatch_2d_to_3d(pathpatch[, z, zdir]) Convert a PathPatch to a PathPatch3D object. art3d.poly_collection_2d_to_3d(col[, zs, zdir]) Convert a PolyCollection to a Poly3DCollection object. art3d.rotate_axes(xs, ys, zs, zdir) Reorder coordinates so that the axes are rotated with zdir along the original z axis. art3d.text_2d_to_3d(obj[, z, zdir]) Convert a Text to a Text3D object. proj3d proj3d.inv_transform(xs, ys, zs, M) proj3d.persp_transformation(zfront, zback) proj3d.proj_points(points, M) proj3d.proj_trans_points(points, M) proj3d.proj_transform(xs, ys, zs, M) Transform the points by the projection matrix proj3d.proj_transform_clip(xs, ys, zs, M) Transform the points by the projection matrix and return the clipping result returns txs, tys, tzs, tis proj3d.rot_x(V, alpha) proj3d.transform(xs, ys, zs, M) Transform the points by the projection matrix proj3d.view_transformation(E, R, V) proj3d.world_transformation(xmin, xmax, ...) Produce a matrix that scales homogeneous coords in the specified ranges to [0, 1], or [0, pb_aspect[i]] if the plotbox aspect ratio is specified.
matplotlib.toolkits.mplot3d
mpl_toolkits.mplot3d.art3d.get_dir_vector mpl_toolkits.mplot3d.art3d.get_dir_vector(zdir)[source] Return a direction vector. Parameters zdir{'x', 'y', 'z', None, 3-tuple} The direction. Possible values are: 'x': equivalent to (1, 0, 0) 'y': equivalent to (0, 1, 0) 'z': equivalent to (0, 0, 1) None: equivalent to (0, 0, 0) an iterable (x, y, z) is converted to a NumPy array, if not already Returns x, y, zarray-like The direction vector.
matplotlib._as_gen.mpl_toolkits.mplot3d.art3d.get_dir_vector
mpl_toolkits.mplot3d.art3d.juggle_axes mpl_toolkits.mplot3d.art3d.juggle_axes(xs, ys, zs, zdir)[source] Reorder coordinates so that 2D xs, ys can be plotted in the plane orthogonal to zdir. zdir is normally x, y or z. However, if zdir starts with a '-' it is interpreted as a compensation for rotate_axes.
matplotlib._as_gen.mpl_toolkits.mplot3d.art3d.juggle_axes
mpl_toolkits.mplot3d.art3d.Line3D classmpl_toolkits.mplot3d.art3d.Line3D(xs, ys, zs, *args, **kwargs)[source] Bases: matplotlib.lines.Line2D 3D line object. Keyword arguments are passed onto Line2D(). draw(renderer)[source] Draw the Artist (and its children) using the given renderer. This has no effect if the artist is not visible (Artist.get_visible returns False). Parameters rendererRendererBase subclass. Notes This method is overridden in the Artist subclasses. get_data_3d()[source] Get the current data Returns verts3dlength-3 tuple or array-like The current data as a tuple or array-like. set(*, agg_filter=<UNSET>, alpha=<UNSET>, animated=<UNSET>, antialiased=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, color=<UNSET>, dash_capstyle=<UNSET>, dash_joinstyle=<UNSET>, dashes=<UNSET>, data=<UNSET>, data_3d=<UNSET>, drawstyle=<UNSET>, fillstyle=<UNSET>, gid=<UNSET>, in_layout=<UNSET>, label=<UNSET>, linestyle=<UNSET>, linewidth=<UNSET>, marker=<UNSET>, markeredgecolor=<UNSET>, markeredgewidth=<UNSET>, markerfacecolor=<UNSET>, markerfacecoloralt=<UNSET>, markersize=<UNSET>, markevery=<UNSET>, path_effects=<UNSET>, picker=<UNSET>, pickradius=<UNSET>, rasterized=<UNSET>, sketch_params=<UNSET>, snap=<UNSET>, solid_capstyle=<UNSET>, solid_joinstyle=<UNSET>, transform=<UNSET>, url=<UNSET>, visible=<UNSET>, xdata=<UNSET>, ydata=<UNSET>, zorder=<UNSET>)[source] Set multiple properties at once. Supported properties are Property Description 3d_properties unknown 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 antialiased or aa bool clip_box Bbox clip_on bool clip_path Patch or (Path, Transform) or None color or c color dash_capstyle CapStyle or {'butt', 'projecting', 'round'} dash_joinstyle JoinStyle or {'miter', 'round', 'bevel'} dashes sequence of floats (on/off ink in points) or (None, None) data (2, N) array or two 1D arrays data_3d unknown drawstyle or ds {'default', 'steps', 'steps-pre', 'steps-mid', 'steps-post'}, default: 'default' figure Figure fillstyle {'full', 'left', 'right', 'bottom', 'top', 'none'} gid str in_layout bool label object linestyle or ls {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} linewidth or lw float marker marker style string, Path or MarkerStyle markeredgecolor or mec color markeredgewidth or mew float markerfacecolor or mfc color markerfacecoloralt or mfcalt color markersize or ms float markevery None or int or (int, int) or slice or list[int] or float or (float, float) or list[bool] path_effects AbstractPathEffect picker float or callable[[Artist, Event], tuple[bool, dict]] pickradius float rasterized bool sketch_params (scale: float, length: float, randomness: float) snap bool or None solid_capstyle CapStyle or {'butt', 'projecting', 'round'} solid_joinstyle JoinStyle or {'miter', 'round', 'bevel'} transform Transform url str visible bool xdata 1D array ydata 1D array zorder float set_3d_properties(zs=0, zdir='z')[source] set_data_3d(*args)[source] Set the x, y and z data Parameters xarray-like The x-data to be plotted. yarray-like The y-data to be plotted. zarray-like The z-data to be plotted. Notes Accepts x, y, z arguments or a single array-like (x, y, z) Examples using mpl_toolkits.mplot3d.art3d.Line3D 3D stem
matplotlib._as_gen.mpl_toolkits.mplot3d.art3d.line3d
draw(renderer)[source] Draw the Artist (and its children) using the given renderer. This has no effect if the artist is not visible (Artist.get_visible returns False). Parameters rendererRendererBase subclass. Notes This method is overridden in the Artist subclasses.
matplotlib._as_gen.mpl_toolkits.mplot3d.art3d.line3d#mpl_toolkits.mplot3d.art3d.Line3D.draw
get_data_3d()[source] Get the current data Returns verts3dlength-3 tuple or array-like The current data as a tuple or array-like.
matplotlib._as_gen.mpl_toolkits.mplot3d.art3d.line3d#mpl_toolkits.mplot3d.art3d.Line3D.get_data_3d
set(*, agg_filter=<UNSET>, alpha=<UNSET>, animated=<UNSET>, antialiased=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, color=<UNSET>, dash_capstyle=<UNSET>, dash_joinstyle=<UNSET>, dashes=<UNSET>, data=<UNSET>, data_3d=<UNSET>, drawstyle=<UNSET>, fillstyle=<UNSET>, gid=<UNSET>, in_layout=<UNSET>, label=<UNSET>, linestyle=<UNSET>, linewidth=<UNSET>, marker=<UNSET>, markeredgecolor=<UNSET>, markeredgewidth=<UNSET>, markerfacecolor=<UNSET>, markerfacecoloralt=<UNSET>, markersize=<UNSET>, markevery=<UNSET>, path_effects=<UNSET>, picker=<UNSET>, pickradius=<UNSET>, rasterized=<UNSET>, sketch_params=<UNSET>, snap=<UNSET>, solid_capstyle=<UNSET>, solid_joinstyle=<UNSET>, transform=<UNSET>, url=<UNSET>, visible=<UNSET>, xdata=<UNSET>, ydata=<UNSET>, zorder=<UNSET>)[source] Set multiple properties at once. Supported properties are Property Description 3d_properties unknown 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 antialiased or aa bool clip_box Bbox clip_on bool clip_path Patch or (Path, Transform) or None color or c color dash_capstyle CapStyle or {'butt', 'projecting', 'round'} dash_joinstyle JoinStyle or {'miter', 'round', 'bevel'} dashes sequence of floats (on/off ink in points) or (None, None) data (2, N) array or two 1D arrays data_3d unknown drawstyle or ds {'default', 'steps', 'steps-pre', 'steps-mid', 'steps-post'}, default: 'default' figure Figure fillstyle {'full', 'left', 'right', 'bottom', 'top', 'none'} gid str in_layout bool label object linestyle or ls {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} linewidth or lw float marker marker style string, Path or MarkerStyle markeredgecolor or mec color markeredgewidth or mew float markerfacecolor or mfc color markerfacecoloralt or mfcalt color markersize or ms float markevery None or int or (int, int) or slice or list[int] or float or (float, float) or list[bool] path_effects AbstractPathEffect picker float or callable[[Artist, Event], tuple[bool, dict]] pickradius float rasterized bool sketch_params (scale: float, length: float, randomness: float) snap bool or None solid_capstyle CapStyle or {'butt', 'projecting', 'round'} solid_joinstyle JoinStyle or {'miter', 'round', 'bevel'} transform Transform url str visible bool xdata 1D array ydata 1D array zorder float
matplotlib._as_gen.mpl_toolkits.mplot3d.art3d.line3d#mpl_toolkits.mplot3d.art3d.Line3D.set
set_3d_properties(zs=0, zdir='z')[source]
matplotlib._as_gen.mpl_toolkits.mplot3d.art3d.line3d#mpl_toolkits.mplot3d.art3d.Line3D.set_3d_properties
set_data_3d(*args)[source] Set the x, y and z data Parameters xarray-like The x-data to be plotted. yarray-like The y-data to be plotted. zarray-like The z-data to be plotted. Notes Accepts x, y, z arguments or a single array-like (x, y, z)
matplotlib._as_gen.mpl_toolkits.mplot3d.art3d.line3d#mpl_toolkits.mplot3d.art3d.Line3D.set_data_3d
mpl_toolkits.mplot3d.art3d.Line3DCollection classmpl_toolkits.mplot3d.art3d.Line3DCollection(segments, *args, zorder=2, **kwargs)[source] Bases: matplotlib.collections.LineCollection A collection of 3D lines. Parameters segmentslist of array-like A sequence of (line0, line1, line2), where: linen = (x0, y0), (x1, y1), ... (xm, ym) or the equivalent numpy array with two columns. Each line can have a different number of segments. linewidthsfloat or list of float, default: rcParams["lines.linewidth"] (default: 1.5) The width of each line in points. colorscolor or list of color, default: rcParams["lines.color"] (default: 'C0') A sequence of RGBA tuples (e.g., arbitrary color strings, etc, not allowed). antialiasedsbool or list of bool, default: rcParams["lines.antialiased"] (default: True) Whether to use antialiasing for each line. zorderint, default: 2 zorder of the lines once drawn. facecolorscolor or list of color, default: 'none' When setting facecolors, each line is interpreted as a boundary for an area, implicitly closing the path from the last point to the first point. The enclosed area is filled with facecolor. In order to manually specify what should count as the "interior" of each line, please use PathCollection instead, where the "interior" can be specified by appropriate usage of CLOSEPOLY. **kwargs Forwarded to Collection. do_3d_projection(renderer=<deprecated parameter>)[source] Project the points according to renderer matrix. draw(renderer, project=<deprecated parameter>)[source] Draw the Artist (and its children) using the given renderer. This has no effect if the artist is not visible (Artist.get_visible returns False). Parameters rendererRendererBase subclass. Notes This method is overridden in the Artist subclasses. 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>, colors=<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>, paths=<UNSET>, picker=<UNSET>, pickradius=<UNSET>, rasterized=<UNSET>, segments=<UNSET>, sketch_params=<UNSET>, snap=<UNSET>, sort_zpos=<UNSET>, transform=<UNSET>, url=<UNSET>, urls=<UNSET>, verts=<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 colors colors color or list of colors 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 paths unknown picker None or bool or float or callable pickradius float rasterized bool segments unknown sketch_params (scale: float, length: float, randomness: float) snap bool or None sort_zpos unknown transform Transform url str urls list of str or None verts unknown visible bool zorder float set_segments(segments)[source] Set 3D segments. set_sort_zpos(val)[source] Set the position to use for z-sorting. Examples using mpl_toolkits.mplot3d.art3d.Line3DCollection 3D stem
matplotlib._as_gen.mpl_toolkits.mplot3d.art3d.line3dcollection
do_3d_projection(renderer=<deprecated parameter>)[source] Project the points according to renderer matrix.
matplotlib._as_gen.mpl_toolkits.mplot3d.art3d.line3dcollection#mpl_toolkits.mplot3d.art3d.Line3DCollection.do_3d_projection
draw(renderer, project=<deprecated parameter>)[source] Draw the Artist (and its children) using the given renderer. This has no effect if the artist is not visible (Artist.get_visible returns False). Parameters rendererRendererBase subclass. Notes This method is overridden in the Artist subclasses.
matplotlib._as_gen.mpl_toolkits.mplot3d.art3d.line3dcollection#mpl_toolkits.mplot3d.art3d.Line3DCollection.draw
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>, colors=<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>, paths=<UNSET>, picker=<UNSET>, pickradius=<UNSET>, rasterized=<UNSET>, segments=<UNSET>, sketch_params=<UNSET>, snap=<UNSET>, sort_zpos=<UNSET>, transform=<UNSET>, url=<UNSET>, urls=<UNSET>, verts=<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 colors colors color or list of colors 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 paths unknown picker None or bool or float or callable pickradius float rasterized bool segments unknown sketch_params (scale: float, length: float, randomness: float) snap bool or None sort_zpos unknown transform Transform url str urls list of str or None verts unknown visible bool zorder float
matplotlib._as_gen.mpl_toolkits.mplot3d.art3d.line3dcollection#mpl_toolkits.mplot3d.art3d.Line3DCollection.set
set_segments(segments)[source] Set 3D segments.
matplotlib._as_gen.mpl_toolkits.mplot3d.art3d.line3dcollection#mpl_toolkits.mplot3d.art3d.Line3DCollection.set_segments
set_sort_zpos(val)[source] Set the position to use for z-sorting.
matplotlib._as_gen.mpl_toolkits.mplot3d.art3d.line3dcollection#mpl_toolkits.mplot3d.art3d.Line3DCollection.set_sort_zpos
mpl_toolkits.mplot3d.art3d.line_2d_to_3d mpl_toolkits.mplot3d.art3d.line_2d_to_3d(line, zs=0, zdir='z')[source] Convert a 2D line to 3D.
matplotlib._as_gen.mpl_toolkits.mplot3d.art3d.line_2d_to_3d
mpl_toolkits.mplot3d.art3d.line_collection_2d_to_3d mpl_toolkits.mplot3d.art3d.line_collection_2d_to_3d(col, zs=0, zdir='z')[source] Convert a LineCollection to a Line3DCollection object.
matplotlib._as_gen.mpl_toolkits.mplot3d.art3d.line_collection_2d_to_3d
mpl_toolkits.mplot3d.art3d.Patch3D classmpl_toolkits.mplot3d.art3d.Patch3D(*args, zs=(), zdir='z', **kwargs)[source] Bases: matplotlib.patches.Patch 3D patch object. The following kwarg properties are supported 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 unknown animated bool antialiased or aa bool or None capstyle CapStyle or {'butt', 'projecting', 'round'} clip_box Bbox clip_on bool clip_path Patch or (Path, Transform) or None color color edgecolor or ec color or None facecolor or fc color or None figure Figure fill bool gid str hatch {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '*'} in_layout bool joinstyle JoinStyle or {'miter', 'round', 'bevel'} label object linestyle or ls {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} linewidth or lw float or None path_effects AbstractPathEffect picker None or bool or float or callable rasterized bool sketch_params (scale: float, length: float, randomness: float) snap bool or None transform Transform url str visible bool zorder float do_3d_projection(renderer=<deprecated parameter>)[source] get_path()[source] Return the path of this patch. set(*, agg_filter=<UNSET>, alpha=<UNSET>, animated=<UNSET>, antialiased=<UNSET>, capstyle=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, color=<UNSET>, edgecolor=<UNSET>, facecolor=<UNSET>, fill=<UNSET>, gid=<UNSET>, hatch=<UNSET>, in_layout=<UNSET>, joinstyle=<UNSET>, label=<UNSET>, linestyle=<UNSET>, linewidth=<UNSET>, path_effects=<UNSET>, picker=<UNSET>, rasterized=<UNSET>, sketch_params=<UNSET>, snap=<UNSET>, transform=<UNSET>, url=<UNSET>, visible=<UNSET>, zorder=<UNSET>)[source] Set multiple properties at once. Supported properties are Property Description 3d_properties unknown 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 antialiased or aa bool or None capstyle CapStyle or {'butt', 'projecting', 'round'} clip_box Bbox clip_on bool clip_path Patch or (Path, Transform) or None color color edgecolor or ec color or None facecolor or fc color or None figure Figure fill bool gid str hatch {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '*'} in_layout bool joinstyle JoinStyle or {'miter', 'round', 'bevel'} label object linestyle or ls {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} linewidth or lw float or None path_effects AbstractPathEffect picker None or bool or float or callable rasterized bool sketch_params (scale: float, length: float, randomness: float) snap bool or None transform Transform url str visible bool zorder float set_3d_properties(verts, zs=0, zdir='z')[source]
matplotlib._as_gen.mpl_toolkits.mplot3d.art3d.patch3d
do_3d_projection(renderer=<deprecated parameter>)[source]
matplotlib._as_gen.mpl_toolkits.mplot3d.art3d.patch3d#mpl_toolkits.mplot3d.art3d.Patch3D.do_3d_projection
get_path()[source] Return the path of this patch.
matplotlib._as_gen.mpl_toolkits.mplot3d.art3d.patch3d#mpl_toolkits.mplot3d.art3d.Patch3D.get_path
set(*, agg_filter=<UNSET>, alpha=<UNSET>, animated=<UNSET>, antialiased=<UNSET>, capstyle=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, color=<UNSET>, edgecolor=<UNSET>, facecolor=<UNSET>, fill=<UNSET>, gid=<UNSET>, hatch=<UNSET>, in_layout=<UNSET>, joinstyle=<UNSET>, label=<UNSET>, linestyle=<UNSET>, linewidth=<UNSET>, path_effects=<UNSET>, picker=<UNSET>, rasterized=<UNSET>, sketch_params=<UNSET>, snap=<UNSET>, transform=<UNSET>, url=<UNSET>, visible=<UNSET>, zorder=<UNSET>)[source] Set multiple properties at once. Supported properties are Property Description 3d_properties unknown 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 antialiased or aa bool or None capstyle CapStyle or {'butt', 'projecting', 'round'} clip_box Bbox clip_on bool clip_path Patch or (Path, Transform) or None color color edgecolor or ec color or None facecolor or fc color or None figure Figure fill bool gid str hatch {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '*'} in_layout bool joinstyle JoinStyle or {'miter', 'round', 'bevel'} label object linestyle or ls {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} linewidth or lw float or None path_effects AbstractPathEffect picker None or bool or float or callable rasterized bool sketch_params (scale: float, length: float, randomness: float) snap bool or None transform Transform url str visible bool zorder float
matplotlib._as_gen.mpl_toolkits.mplot3d.art3d.patch3d#mpl_toolkits.mplot3d.art3d.Patch3D.set
set_3d_properties(verts, zs=0, zdir='z')[source]
matplotlib._as_gen.mpl_toolkits.mplot3d.art3d.patch3d#mpl_toolkits.mplot3d.art3d.Patch3D.set_3d_properties
mpl_toolkits.mplot3d.art3d.Patch3DCollection classmpl_toolkits.mplot3d.art3d.Patch3DCollection(*args, zs=0, zdir='z', depthshade=True, **kwargs)[source] Bases: matplotlib.collections.PatchCollection A collection of 3D patches. Create a collection of flat 3D patches with its normal vector pointed in zdir direction, and located at zs on the zdir axis. 'zs' can be a scalar or an array-like of the same length as the number of patches in the collection. Constructor arguments are the same as for PatchCollection. In addition, keywords zs=0 and zdir='z' are available. Also, the keyword argument depthshade is available to indicate whether or not to shade the patches in order to give the appearance of depth (default is True). This is typically desired in scatter plots. do_3d_projection(renderer=<deprecated parameter>)[source] get_depthshade()[source] get_edgecolor()[source] get_facecolor()[source] 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>, depthshade=<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>, paths=<UNSET>, picker=<UNSET>, pickradius=<UNSET>, rasterized=<UNSET>, sketch_params=<UNSET>, snap=<UNSET>, sort_zpos=<UNSET>, transform=<UNSET>, url=<UNSET>, urls=<UNSET>, visible=<UNSET>, zorder=<UNSET>)[source] Set multiple properties at once. Supported properties are Property Description 3d_properties unknown 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 depthshade bool 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 paths unknown picker None or bool or float or callable pickradius float rasterized bool sketch_params (scale: float, length: float, randomness: float) snap bool or None sort_zpos unknown transform Transform url str urls list of str or None visible bool zorder float set_3d_properties(zs, zdir)[source] set_depthshade(depthshade)[source] Set whether depth shading is performed on collection members. Parameters depthshadebool Whether to shade the patches in order to give the appearance of depth. set_sort_zpos(val)[source] Set the position to use for z-sorting.
matplotlib._as_gen.mpl_toolkits.mplot3d.art3d.patch3dcollection
do_3d_projection(renderer=<deprecated parameter>)[source]
matplotlib._as_gen.mpl_toolkits.mplot3d.art3d.patch3dcollection#mpl_toolkits.mplot3d.art3d.Patch3DCollection.do_3d_projection
get_depthshade()[source]
matplotlib._as_gen.mpl_toolkits.mplot3d.art3d.patch3dcollection#mpl_toolkits.mplot3d.art3d.Patch3DCollection.get_depthshade
get_edgecolor()[source]
matplotlib._as_gen.mpl_toolkits.mplot3d.art3d.patch3dcollection#mpl_toolkits.mplot3d.art3d.Patch3DCollection.get_edgecolor
get_facecolor()[source]
matplotlib._as_gen.mpl_toolkits.mplot3d.art3d.patch3dcollection#mpl_toolkits.mplot3d.art3d.Patch3DCollection.get_facecolor
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>, depthshade=<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>, paths=<UNSET>, picker=<UNSET>, pickradius=<UNSET>, rasterized=<UNSET>, sketch_params=<UNSET>, snap=<UNSET>, sort_zpos=<UNSET>, transform=<UNSET>, url=<UNSET>, urls=<UNSET>, visible=<UNSET>, zorder=<UNSET>)[source] Set multiple properties at once. Supported properties are Property Description 3d_properties unknown 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 depthshade bool 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 paths unknown picker None or bool or float or callable pickradius float rasterized bool sketch_params (scale: float, length: float, randomness: float) snap bool or None sort_zpos unknown transform Transform url str urls list of str or None visible bool zorder float
matplotlib._as_gen.mpl_toolkits.mplot3d.art3d.patch3dcollection#mpl_toolkits.mplot3d.art3d.Patch3DCollection.set
set_3d_properties(zs, zdir)[source]
matplotlib._as_gen.mpl_toolkits.mplot3d.art3d.patch3dcollection#mpl_toolkits.mplot3d.art3d.Patch3DCollection.set_3d_properties
set_depthshade(depthshade)[source] Set whether depth shading is performed on collection members. Parameters depthshadebool Whether to shade the patches in order to give the appearance of depth.
matplotlib._as_gen.mpl_toolkits.mplot3d.art3d.patch3dcollection#mpl_toolkits.mplot3d.art3d.Patch3DCollection.set_depthshade
set_sort_zpos(val)[source] Set the position to use for z-sorting.
matplotlib._as_gen.mpl_toolkits.mplot3d.art3d.patch3dcollection#mpl_toolkits.mplot3d.art3d.Patch3DCollection.set_sort_zpos
mpl_toolkits.mplot3d.art3d.patch_2d_to_3d mpl_toolkits.mplot3d.art3d.patch_2d_to_3d(patch, z=0, zdir='z')[source] Convert a Patch to a Patch3D object.
matplotlib._as_gen.mpl_toolkits.mplot3d.art3d.patch_2d_to_3d
mpl_toolkits.mplot3d.art3d.patch_collection_2d_to_3d mpl_toolkits.mplot3d.art3d.patch_collection_2d_to_3d(col, zs=0, zdir='z', depthshade=True)[source] Convert a PatchCollection into a Patch3DCollection object (or a PathCollection into a Path3DCollection object). Parameters za The location or locations to place the patches in the collection along the zdir axis. Default: 0. zdir The axis in which to place the patches. Default: "z". depthshade Whether to shade the patches to give a sense of depth. Default: True.
matplotlib._as_gen.mpl_toolkits.mplot3d.art3d.patch_collection_2d_to_3d
mpl_toolkits.mplot3d.art3d.Path3DCollection classmpl_toolkits.mplot3d.art3d.Path3DCollection(*args, zs=0, zdir='z', depthshade=True, **kwargs)[source] Bases: matplotlib.collections.PathCollection A collection of 3D paths. Create a collection of flat 3D paths with its normal vector pointed in zdir direction, and located at zs on the zdir axis. 'zs' can be a scalar or an array-like of the same length as the number of paths in the collection. Constructor arguments are the same as for PathCollection. In addition, keywords zs=0 and zdir='z' are available. Also, the keyword argument depthshade is available to indicate whether or not to shade the patches in order to give the appearance of depth (default is True). This is typically desired in scatter plots. do_3d_projection(renderer=<deprecated parameter>)[source] draw(renderer)[source] Draw the Artist (and its children) using the given renderer. This has no effect if the artist is not visible (Artist.get_visible returns False). Parameters rendererRendererBase subclass. Notes This method is overridden in the Artist subclasses. get_depthshade()[source] get_edgecolor()[source] get_facecolor()[source] 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>, depthshade=<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>, paths=<UNSET>, picker=<UNSET>, pickradius=<UNSET>, rasterized=<UNSET>, sizes=<UNSET>, sketch_params=<UNSET>, snap=<UNSET>, sort_zpos=<UNSET>, transform=<UNSET>, url=<UNSET>, urls=<UNSET>, visible=<UNSET>, zorder=<UNSET>)[source] Set multiple properties at once. Supported properties are Property Description 3d_properties unknown 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 depthshade bool 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 unknown norm Normalize or None offset_transform Transform offsets (N, 2) or (2,) array-like path_effects AbstractPathEffect paths unknown picker None or bool or float or callable pickradius float rasterized bool sizes unknown sketch_params (scale: float, length: float, randomness: float) snap bool or None sort_zpos unknown transform Transform url str urls list of str or None visible bool zorder float set_3d_properties(zs, zdir)[source] set_depthshade(depthshade)[source] Set whether depth shading is performed on collection members. Parameters depthshadebool Whether to shade the patches in order to give the appearance of depth. 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_sizes(sizes, dpi=72.0)[source] Set the sizes of each member of the collection. Parameters sizesndarray or None The size to set for each element of the collection. The value is the 'area' of the element. dpifloat, default: 72 The dpi of the canvas. set_sort_zpos(val)[source] Set the position to use for z-sorting.
matplotlib._as_gen.mpl_toolkits.mplot3d.art3d.path3dcollection
do_3d_projection(renderer=<deprecated parameter>)[source]
matplotlib._as_gen.mpl_toolkits.mplot3d.art3d.path3dcollection#mpl_toolkits.mplot3d.art3d.Path3DCollection.do_3d_projection
draw(renderer)[source] Draw the Artist (and its children) using the given renderer. This has no effect if the artist is not visible (Artist.get_visible returns False). Parameters rendererRendererBase subclass. Notes This method is overridden in the Artist subclasses.
matplotlib._as_gen.mpl_toolkits.mplot3d.art3d.path3dcollection#mpl_toolkits.mplot3d.art3d.Path3DCollection.draw
get_depthshade()[source]
matplotlib._as_gen.mpl_toolkits.mplot3d.art3d.path3dcollection#mpl_toolkits.mplot3d.art3d.Path3DCollection.get_depthshade
get_edgecolor()[source]
matplotlib._as_gen.mpl_toolkits.mplot3d.art3d.path3dcollection#mpl_toolkits.mplot3d.art3d.Path3DCollection.get_edgecolor
get_facecolor()[source]
matplotlib._as_gen.mpl_toolkits.mplot3d.art3d.path3dcollection#mpl_toolkits.mplot3d.art3d.Path3DCollection.get_facecolor
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>, depthshade=<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>, paths=<UNSET>, picker=<UNSET>, pickradius=<UNSET>, rasterized=<UNSET>, sizes=<UNSET>, sketch_params=<UNSET>, snap=<UNSET>, sort_zpos=<UNSET>, transform=<UNSET>, url=<UNSET>, urls=<UNSET>, visible=<UNSET>, zorder=<UNSET>)[source] Set multiple properties at once. Supported properties are Property Description 3d_properties unknown 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 depthshade bool 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 unknown norm Normalize or None offset_transform Transform offsets (N, 2) or (2,) array-like path_effects AbstractPathEffect paths unknown picker None or bool or float or callable pickradius float rasterized bool sizes unknown sketch_params (scale: float, length: float, randomness: float) snap bool or None sort_zpos unknown transform Transform url str urls list of str or None visible bool zorder float
matplotlib._as_gen.mpl_toolkits.mplot3d.art3d.path3dcollection#mpl_toolkits.mplot3d.art3d.Path3DCollection.set
set_3d_properties(zs, zdir)[source]
matplotlib._as_gen.mpl_toolkits.mplot3d.art3d.path3dcollection#mpl_toolkits.mplot3d.art3d.Path3DCollection.set_3d_properties
set_depthshade(depthshade)[source] Set whether depth shading is performed on collection members. Parameters depthshadebool Whether to shade the patches in order to give the appearance of depth.
matplotlib._as_gen.mpl_toolkits.mplot3d.art3d.path3dcollection#mpl_toolkits.mplot3d.art3d.Path3DCollection.set_depthshade
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
matplotlib._as_gen.mpl_toolkits.mplot3d.art3d.path3dcollection#mpl_toolkits.mplot3d.art3d.Path3DCollection.set_linewidth
set_sizes(sizes, dpi=72.0)[source] Set the sizes of each member of the collection. Parameters sizesndarray or None The size to set for each element of the collection. The value is the 'area' of the element. dpifloat, default: 72 The dpi of the canvas.
matplotlib._as_gen.mpl_toolkits.mplot3d.art3d.path3dcollection#mpl_toolkits.mplot3d.art3d.Path3DCollection.set_sizes
set_sort_zpos(val)[source] Set the position to use for z-sorting.
matplotlib._as_gen.mpl_toolkits.mplot3d.art3d.path3dcollection#mpl_toolkits.mplot3d.art3d.Path3DCollection.set_sort_zpos
mpl_toolkits.mplot3d.art3d.PathPatch3D classmpl_toolkits.mplot3d.art3d.PathPatch3D(path, *, zs=(), zdir='z', **kwargs)[source] Bases: mpl_toolkits.mplot3d.art3d.Patch3D 3D PathPatch object. The following kwarg properties are supported 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 unknown animated bool antialiased or aa bool or None capstyle CapStyle or {'butt', 'projecting', 'round'} clip_box Bbox clip_on bool clip_path Patch or (Path, Transform) or None color color edgecolor or ec color or None facecolor or fc color or None figure Figure fill bool gid str hatch {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '*'} in_layout bool joinstyle JoinStyle or {'miter', 'round', 'bevel'} label object linestyle or ls {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} linewidth or lw float or None path_effects AbstractPathEffect picker None or bool or float or callable rasterized bool sketch_params (scale: float, length: float, randomness: float) snap bool or None transform Transform url str visible bool zorder float do_3d_projection(renderer=<deprecated parameter>)[source] set(*, agg_filter=<UNSET>, alpha=<UNSET>, animated=<UNSET>, antialiased=<UNSET>, capstyle=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, color=<UNSET>, edgecolor=<UNSET>, facecolor=<UNSET>, fill=<UNSET>, gid=<UNSET>, hatch=<UNSET>, in_layout=<UNSET>, joinstyle=<UNSET>, label=<UNSET>, linestyle=<UNSET>, linewidth=<UNSET>, path_effects=<UNSET>, picker=<UNSET>, rasterized=<UNSET>, sketch_params=<UNSET>, snap=<UNSET>, transform=<UNSET>, url=<UNSET>, visible=<UNSET>, zorder=<UNSET>)[source] Set multiple properties at once. Supported properties are Property Description 3d_properties unknown 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 antialiased or aa bool or None capstyle CapStyle or {'butt', 'projecting', 'round'} clip_box Bbox clip_on bool clip_path Patch or (Path, Transform) or None color color edgecolor or ec color or None facecolor or fc color or None figure Figure fill bool gid str hatch {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '*'} in_layout bool joinstyle JoinStyle or {'miter', 'round', 'bevel'} label object linestyle or ls {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} linewidth or lw float or None path_effects AbstractPathEffect picker None or bool or float or callable rasterized bool sketch_params (scale: float, length: float, randomness: float) snap bool or None transform Transform url str visible bool zorder float set_3d_properties(path, zs=0, zdir='z')[source] Examples using mpl_toolkits.mplot3d.art3d.PathPatch3D Draw flat objects in 3D plot
matplotlib._as_gen.mpl_toolkits.mplot3d.art3d.pathpatch3d
do_3d_projection(renderer=<deprecated parameter>)[source]
matplotlib._as_gen.mpl_toolkits.mplot3d.art3d.pathpatch3d#mpl_toolkits.mplot3d.art3d.PathPatch3D.do_3d_projection
set(*, agg_filter=<UNSET>, alpha=<UNSET>, animated=<UNSET>, antialiased=<UNSET>, capstyle=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, color=<UNSET>, edgecolor=<UNSET>, facecolor=<UNSET>, fill=<UNSET>, gid=<UNSET>, hatch=<UNSET>, in_layout=<UNSET>, joinstyle=<UNSET>, label=<UNSET>, linestyle=<UNSET>, linewidth=<UNSET>, path_effects=<UNSET>, picker=<UNSET>, rasterized=<UNSET>, sketch_params=<UNSET>, snap=<UNSET>, transform=<UNSET>, url=<UNSET>, visible=<UNSET>, zorder=<UNSET>)[source] Set multiple properties at once. Supported properties are Property Description 3d_properties unknown 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 antialiased or aa bool or None capstyle CapStyle or {'butt', 'projecting', 'round'} clip_box Bbox clip_on bool clip_path Patch or (Path, Transform) or None color color edgecolor or ec color or None facecolor or fc color or None figure Figure fill bool gid str hatch {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '*'} in_layout bool joinstyle JoinStyle or {'miter', 'round', 'bevel'} label object linestyle or ls {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} linewidth or lw float or None path_effects AbstractPathEffect picker None or bool or float or callable rasterized bool sketch_params (scale: float, length: float, randomness: float) snap bool or None transform Transform url str visible bool zorder float
matplotlib._as_gen.mpl_toolkits.mplot3d.art3d.pathpatch3d#mpl_toolkits.mplot3d.art3d.PathPatch3D.set
set_3d_properties(path, zs=0, zdir='z')[source]
matplotlib._as_gen.mpl_toolkits.mplot3d.art3d.pathpatch3d#mpl_toolkits.mplot3d.art3d.PathPatch3D.set_3d_properties
mpl_toolkits.mplot3d.art3d.pathpatch_2d_to_3d mpl_toolkits.mplot3d.art3d.pathpatch_2d_to_3d(pathpatch, z=0, zdir='z')[source] Convert a PathPatch to a PathPatch3D object. Examples using mpl_toolkits.mplot3d.art3d.pathpatch_2d_to_3d Draw flat objects in 3D plot
matplotlib._as_gen.mpl_toolkits.mplot3d.art3d.pathpatch_2d_to_3d
mpl_toolkits.mplot3d.art3d.Poly3DCollection classmpl_toolkits.mplot3d.art3d.Poly3DCollection(verts, *args, zsort='average', **kwargs)[source] Bases: matplotlib.collections.PolyCollection A collection of 3D polygons. Note Filling of 3D polygons There is no simple definition of the enclosed surface of a 3D polygon unless the polygon is planar. In practice, Matplotlib fills the 2D projection of the polygon. This gives a correct filling appearance only for planar polygons. For all other polygons, you'll find orientations in which the edges of the polygon intersect in the projection. This will lead to an incorrect visualization of the 3D area. If you need filled areas, it is recommended to create them via plot_trisurf, which creates a triangulation and thus generates consistent surfaces. Parameters vertslist of (N, 3) array-like Each element describes a polygon as a sequence of N_i points (x, y, z). zsort{'average', 'min', 'max'}, default: 'average' The calculation method for the z-order. See set_zsort for details. *args, **kwargs All other parameters are forwarded to PolyCollection. Notes Note that this class does a bit of magic with the _facecolors and _edgecolors properties. do_3d_projection(renderer=<deprecated parameter>)[source] Perform the 3D projection for this object. get_edgecolor()[source] get_facecolor()[source] get_vector(segments3d)[source] Optimize points for projection. 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>, paths=<UNSET>, picker=<UNSET>, pickradius=<UNSET>, rasterized=<UNSET>, sizes=<UNSET>, sketch_params=<UNSET>, snap=<UNSET>, sort_zpos=<UNSET>, transform=<UNSET>, url=<UNSET>, urls=<UNSET>, verts=<UNSET>, verts_and_codes=<UNSET>, visible=<UNSET>, zorder=<UNSET>, zsort=<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 unknown 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 unknown facecolor or facecolors or fc unknown 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 paths list of array-like 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 sort_zpos unknown transform Transform url str urls list of str or None verts unknown verts_and_codes unknown visible bool zorder float zsort {'average', 'min', 'max'} set_3d_properties()[source] 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_edgecolor(colors)[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_facecolor(colors)[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_sort_zpos(val)[source] Set the position to use for z-sorting. set_verts(verts, closed=True)[source] Set 3D vertices. set_verts_and_codes(verts, codes)[source] Set 3D vertices with path codes. set_zsort(zsort)[source] Set the calculation method for the z-order. Parameters zsort{'average', 'min', 'max'} The function applied on the z-coordinates of the vertices in the viewer's coordinate system, to determine the z-order. Examples using mpl_toolkits.mplot3d.art3d.Poly3DCollection Frontpage 3D example Custom hillshading in a 3D surface plot 2D and 3D Axes in same Figure Generate polygons to fill under 3D line graph 3D plots as subplots 3D surface (colormap) 3D surface (checkerboard)
matplotlib._as_gen.mpl_toolkits.mplot3d.art3d.poly3dcollection
do_3d_projection(renderer=<deprecated parameter>)[source] Perform the 3D projection for this object.
matplotlib._as_gen.mpl_toolkits.mplot3d.art3d.poly3dcollection#mpl_toolkits.mplot3d.art3d.Poly3DCollection.do_3d_projection
get_edgecolor()[source]
matplotlib._as_gen.mpl_toolkits.mplot3d.art3d.poly3dcollection#mpl_toolkits.mplot3d.art3d.Poly3DCollection.get_edgecolor
get_facecolor()[source]
matplotlib._as_gen.mpl_toolkits.mplot3d.art3d.poly3dcollection#mpl_toolkits.mplot3d.art3d.Poly3DCollection.get_facecolor
get_vector(segments3d)[source] Optimize points for projection.
matplotlib._as_gen.mpl_toolkits.mplot3d.art3d.poly3dcollection#mpl_toolkits.mplot3d.art3d.Poly3DCollection.get_vector
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>, paths=<UNSET>, picker=<UNSET>, pickradius=<UNSET>, rasterized=<UNSET>, sizes=<UNSET>, sketch_params=<UNSET>, snap=<UNSET>, sort_zpos=<UNSET>, transform=<UNSET>, url=<UNSET>, urls=<UNSET>, verts=<UNSET>, verts_and_codes=<UNSET>, visible=<UNSET>, zorder=<UNSET>, zsort=<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 unknown 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 unknown facecolor or facecolors or fc unknown 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 paths list of array-like 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 sort_zpos unknown transform Transform url str urls list of str or None verts unknown verts_and_codes unknown visible bool zorder float zsort {'average', 'min', 'max'}
matplotlib._as_gen.mpl_toolkits.mplot3d.art3d.poly3dcollection#mpl_toolkits.mplot3d.art3d.Poly3DCollection.set
set_3d_properties()[source]
matplotlib._as_gen.mpl_toolkits.mplot3d.art3d.poly3dcollection#mpl_toolkits.mplot3d.art3d.Poly3DCollection.set_3d_properties
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.
matplotlib._as_gen.mpl_toolkits.mplot3d.art3d.poly3dcollection#mpl_toolkits.mplot3d.art3d.Poly3DCollection.set_alpha
set_edgecolor(colors)[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.
matplotlib._as_gen.mpl_toolkits.mplot3d.art3d.poly3dcollection#mpl_toolkits.mplot3d.art3d.Poly3DCollection.set_edgecolor
set_facecolor(colors)[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
matplotlib._as_gen.mpl_toolkits.mplot3d.art3d.poly3dcollection#mpl_toolkits.mplot3d.art3d.Poly3DCollection.set_facecolor
set_sort_zpos(val)[source] Set the position to use for z-sorting.
matplotlib._as_gen.mpl_toolkits.mplot3d.art3d.poly3dcollection#mpl_toolkits.mplot3d.art3d.Poly3DCollection.set_sort_zpos
set_verts(verts, closed=True)[source] Set 3D vertices.
matplotlib._as_gen.mpl_toolkits.mplot3d.art3d.poly3dcollection#mpl_toolkits.mplot3d.art3d.Poly3DCollection.set_verts
set_verts_and_codes(verts, codes)[source] Set 3D vertices with path codes.
matplotlib._as_gen.mpl_toolkits.mplot3d.art3d.poly3dcollection#mpl_toolkits.mplot3d.art3d.Poly3DCollection.set_verts_and_codes
set_zsort(zsort)[source] Set the calculation method for the z-order. Parameters zsort{'average', 'min', 'max'} The function applied on the z-coordinates of the vertices in the viewer's coordinate system, to determine the z-order.
matplotlib._as_gen.mpl_toolkits.mplot3d.art3d.poly3dcollection#mpl_toolkits.mplot3d.art3d.Poly3DCollection.set_zsort
mpl_toolkits.mplot3d.art3d.poly_collection_2d_to_3d mpl_toolkits.mplot3d.art3d.poly_collection_2d_to_3d(col, zs=0, zdir='z')[source] Convert a PolyCollection to a Poly3DCollection object.
matplotlib._as_gen.mpl_toolkits.mplot3d.art3d.poly_collection_2d_to_3d
mpl_toolkits.mplot3d.art3d.rotate_axes mpl_toolkits.mplot3d.art3d.rotate_axes(xs, ys, zs, zdir)[source] Reorder coordinates so that the axes are rotated with zdir along the original z axis. Prepending the axis with a '-' does the inverse transform, so zdir can be x, -x, y, -y, z or -z
matplotlib._as_gen.mpl_toolkits.mplot3d.art3d.rotate_axes
mpl_toolkits.mplot3d.art3d.Text3D classmpl_toolkits.mplot3d.art3d.Text3D(x=0, y=0, z=0, text='', zdir='z', **kwargs)[source] Bases: matplotlib.text.Text Text object with 3D position and direction. Parameters x, y, z The position of the text. textstr The text string to display. zdir{'x', 'y', 'z', None, 3-tuple} The direction of the text. See get_dir_vector for a description of the values. Other Parameters **kwargs All other parameters are passed on to Text. Create a Text instance at x, y with string text. Valid keyword arguments 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 backgroundcolor color bbox dict with properties for patches.FancyBboxPatch clip_box unknown clip_on unknown clip_path unknown color or c color figure Figure fontfamily or family {FONTNAME, 'serif', 'sans-serif', 'cursive', 'fantasy', 'monospace'} fontproperties or font or font_properties font_manager.FontProperties or str or pathlib.Path fontsize or size float or {'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'} fontstretch or stretch {a numeric value in range 0-1000, 'ultra-condensed', 'extra-condensed', 'condensed', 'semi-condensed', 'normal', 'semi-expanded', 'expanded', 'extra-expanded', 'ultra-expanded'} fontstyle or style {'normal', 'italic', 'oblique'} fontvariant or variant {'normal', 'small-caps'} fontweight or weight {a numeric value in range 0-1000, 'ultralight', 'light', 'normal', 'regular', 'book', 'medium', 'roman', 'semibold', 'demibold', 'demi', 'bold', 'heavy', 'extra bold', 'black'} gid str horizontalalignment or ha {'center', 'right', 'left'} in_layout bool label object linespacing float (multiple of font size) math_fontfamily str multialignment or ma {'left', 'right', 'center'} parse_math bool path_effects AbstractPathEffect picker None or bool or float or callable position (float, float) rasterized bool rotation float or {'vertical', 'horizontal'} rotation_mode {None, 'default', 'anchor'} sketch_params (scale: float, length: float, randomness: float) snap bool or None text object transform Transform transform_rotates_text bool url str usetex bool or None verticalalignment or va {'center', 'top', 'bottom', 'baseline', 'center_baseline'} visible bool wrap bool x float y float zorder float draw(renderer)[source] Draw the Artist (and its children) using the given renderer. This has no effect if the artist is not visible (Artist.get_visible returns False). Parameters rendererRendererBase subclass. Notes This method is overridden in the Artist subclasses. get_position_3d()[source] Return the (x, y, z) position of the text. get_tightbbox(renderer)[source] Like Artist.get_window_extent, but includes any clipping. Parameters rendererRendererBase subclass renderer that will be used to draw the figures (i.e. fig.canvas.get_renderer()) Returns Bbox The enclosing bounding box (in figure pixel coordinates). set(*, agg_filter=<UNSET>, alpha=<UNSET>, animated=<UNSET>, backgroundcolor=<UNSET>, bbox=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, color=<UNSET>, fontfamily=<UNSET>, fontproperties=<UNSET>, fontsize=<UNSET>, fontstretch=<UNSET>, fontstyle=<UNSET>, fontvariant=<UNSET>, fontweight=<UNSET>, gid=<UNSET>, horizontalalignment=<UNSET>, in_layout=<UNSET>, label=<UNSET>, linespacing=<UNSET>, math_fontfamily=<UNSET>, multialignment=<UNSET>, parse_math=<UNSET>, path_effects=<UNSET>, picker=<UNSET>, position=<UNSET>, position_3d=<UNSET>, rasterized=<UNSET>, rotation=<UNSET>, rotation_mode=<UNSET>, sketch_params=<UNSET>, snap=<UNSET>, text=<UNSET>, transform=<UNSET>, transform_rotates_text=<UNSET>, url=<UNSET>, usetex=<UNSET>, verticalalignment=<UNSET>, visible=<UNSET>, wrap=<UNSET>, x=<UNSET>, y=<UNSET>, z=<UNSET>, zorder=<UNSET>)[source] Set multiple properties at once. Supported properties are Property Description 3d_properties unknown 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 backgroundcolor color bbox dict with properties for patches.FancyBboxPatch clip_box Bbox clip_on bool clip_path Patch or (Path, Transform) or None color or c color figure Figure fontfamily or family {FONTNAME, 'serif', 'sans-serif', 'cursive', 'fantasy', 'monospace'} fontproperties or font or font_properties font_manager.FontProperties or str or pathlib.Path fontsize or size float or {'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'} fontstretch or stretch {a numeric value in range 0-1000, 'ultra-condensed', 'extra-condensed', 'condensed', 'semi-condensed', 'normal', 'semi-expanded', 'expanded', 'extra-expanded', 'ultra-expanded'} fontstyle or style {'normal', 'italic', 'oblique'} fontvariant or variant {'normal', 'small-caps'} fontweight or weight {a numeric value in range 0-1000, 'ultralight', 'light', 'normal', 'regular', 'book', 'medium', 'roman', 'semibold', 'demibold', 'demi', 'bold', 'heavy', 'extra bold', 'black'} gid str horizontalalignment or ha {'center', 'right', 'left'} in_layout bool label object linespacing float (multiple of font size) math_fontfamily str multialignment or ma {'left', 'right', 'center'} parse_math bool path_effects AbstractPathEffect picker None or bool or float or callable position (float, float) position_3d (float, float, float) rasterized bool rotation float or {'vertical', 'horizontal'} rotation_mode {None, 'default', 'anchor'} sketch_params (scale: float, length: float, randomness: float) snap bool or None text object transform Transform transform_rotates_text bool url str usetex bool or None verticalalignment or va {'center', 'top', 'bottom', 'baseline', 'center_baseline'} visible bool wrap bool x float y float z float zorder float set_3d_properties(z=0, zdir='z')[source] set_position_3d(xyz, zdir=None)[source] Set the (x, y, z) position of the text. Parameters xyz(float, float, float) The position in 3D space. zdir{'x', 'y', 'z', None, 3-tuple} The direction of the text. If unspecified, the zdir will not be changed. set_z(z)[source] Set the z position of the text. Parameters zfloat
matplotlib._as_gen.mpl_toolkits.mplot3d.art3d.text3d
draw(renderer)[source] Draw the Artist (and its children) using the given renderer. This has no effect if the artist is not visible (Artist.get_visible returns False). Parameters rendererRendererBase subclass. Notes This method is overridden in the Artist subclasses.
matplotlib._as_gen.mpl_toolkits.mplot3d.art3d.text3d#mpl_toolkits.mplot3d.art3d.Text3D.draw
get_position_3d()[source] Return the (x, y, z) position of the text.
matplotlib._as_gen.mpl_toolkits.mplot3d.art3d.text3d#mpl_toolkits.mplot3d.art3d.Text3D.get_position_3d
get_tightbbox(renderer)[source] Like Artist.get_window_extent, but includes any clipping. Parameters rendererRendererBase subclass renderer that will be used to draw the figures (i.e. fig.canvas.get_renderer()) Returns Bbox The enclosing bounding box (in figure pixel coordinates).
matplotlib._as_gen.mpl_toolkits.mplot3d.art3d.text3d#mpl_toolkits.mplot3d.art3d.Text3D.get_tightbbox
set(*, agg_filter=<UNSET>, alpha=<UNSET>, animated=<UNSET>, backgroundcolor=<UNSET>, bbox=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, color=<UNSET>, fontfamily=<UNSET>, fontproperties=<UNSET>, fontsize=<UNSET>, fontstretch=<UNSET>, fontstyle=<UNSET>, fontvariant=<UNSET>, fontweight=<UNSET>, gid=<UNSET>, horizontalalignment=<UNSET>, in_layout=<UNSET>, label=<UNSET>, linespacing=<UNSET>, math_fontfamily=<UNSET>, multialignment=<UNSET>, parse_math=<UNSET>, path_effects=<UNSET>, picker=<UNSET>, position=<UNSET>, position_3d=<UNSET>, rasterized=<UNSET>, rotation=<UNSET>, rotation_mode=<UNSET>, sketch_params=<UNSET>, snap=<UNSET>, text=<UNSET>, transform=<UNSET>, transform_rotates_text=<UNSET>, url=<UNSET>, usetex=<UNSET>, verticalalignment=<UNSET>, visible=<UNSET>, wrap=<UNSET>, x=<UNSET>, y=<UNSET>, z=<UNSET>, zorder=<UNSET>)[source] Set multiple properties at once. Supported properties are Property Description 3d_properties unknown 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 backgroundcolor color bbox dict with properties for patches.FancyBboxPatch clip_box Bbox clip_on bool clip_path Patch or (Path, Transform) or None color or c color figure Figure fontfamily or family {FONTNAME, 'serif', 'sans-serif', 'cursive', 'fantasy', 'monospace'} fontproperties or font or font_properties font_manager.FontProperties or str or pathlib.Path fontsize or size float or {'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'} fontstretch or stretch {a numeric value in range 0-1000, 'ultra-condensed', 'extra-condensed', 'condensed', 'semi-condensed', 'normal', 'semi-expanded', 'expanded', 'extra-expanded', 'ultra-expanded'} fontstyle or style {'normal', 'italic', 'oblique'} fontvariant or variant {'normal', 'small-caps'} fontweight or weight {a numeric value in range 0-1000, 'ultralight', 'light', 'normal', 'regular', 'book', 'medium', 'roman', 'semibold', 'demibold', 'demi', 'bold', 'heavy', 'extra bold', 'black'} gid str horizontalalignment or ha {'center', 'right', 'left'} in_layout bool label object linespacing float (multiple of font size) math_fontfamily str multialignment or ma {'left', 'right', 'center'} parse_math bool path_effects AbstractPathEffect picker None or bool or float or callable position (float, float) position_3d (float, float, float) rasterized bool rotation float or {'vertical', 'horizontal'} rotation_mode {None, 'default', 'anchor'} sketch_params (scale: float, length: float, randomness: float) snap bool or None text object transform Transform transform_rotates_text bool url str usetex bool or None verticalalignment or va {'center', 'top', 'bottom', 'baseline', 'center_baseline'} visible bool wrap bool x float y float z float zorder float
matplotlib._as_gen.mpl_toolkits.mplot3d.art3d.text3d#mpl_toolkits.mplot3d.art3d.Text3D.set