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
Return the path of this patch.
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 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


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.
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 whether depth shading is performed on collection members.
Whether to shade the patches in order to give the appearance of depth.
Set the position to use for z-sorting.


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 whether depth shading is performed on collection members.
Whether to shade the patches in order to give the appearance of depth.


Convert a PatchCollection into a Patch3DCollection object (or a PathCollection into a Path3DCollection object).
The location or locations to place the patches in the collection along the zdir axis. Default: 0.
The axis in which to place the patches. Default: "z".
Whether to shade the patches to give a sense of depth. Default: True.


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.
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).
This method is overridden in the Artist subclasses.
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 whether depth shading is performed on collection members.
Whether to shade the patches in order to give the appearance of depth.
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
Set the sizes of each member of the collection.
The size to set for each element of the collection. The value is the 'area' of the element.
The dpi of the canvas.
Set the position to use for z-sorting.


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).
This method is overridden in the Artist subclasses.


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 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


Set the sizes of each member of the collection.
The size to set for each element of the collection. The value is the 'area' of the element.
The dpi of the canvas.


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
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
Draw flat objects in 3D plot


Convert a PathPatch to a PathPatch3D object.
Draw flat objects in 3D plot


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.
Each element describes a polygon as a sequence of N_i points (x, y, z).
The calculation method for the z-order. See set_zsort for details.
All other parameters are forwarded to PolyCollection.
Note that this class does a bit of magic with the _facecolors and _edgecolors properties.
Perform the 3D projection for this object.
Optimize points for projection.
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 the alpha value used for blending - not supported on all backends.
All values must be within the 0-1 range, inclusive. Masked values and nans are not supported.
Set the edgecolor(s) of the collection.
The collection edgecolor(s). If a sequence, the patches cycle through it. If 'face', match the facecolor.
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.
Set the position to use for z-sorting.
Set 3D vertices.
Set 3D vertices with path codes.
Set the calculation method for the z-order.
The function applied on the z-coordinates of the vertices in the viewer's coordinate system, to determine the z-order.
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)


Perform the 3D projection for this object.


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 the alpha value used for blending - not supported on all backends.
All values must be within the 0-1 range, inclusive. Masked values and nans are not supported.


Set the edgecolor(s) of the collection.
The collection edgecolor(s). If a sequence, the patches cycle through it. If 'face', match the facecolor.


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.


Set the calculation method for the z-order.
The function applied on the z-coordinates of the vertices in the viewer's coordinate system, to determine the z-order.


Convert a PolyCollection to a Poly3DCollection object.


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


Bases: matplotlib.text.Text
Text object with 3D position and direction.
The position of the text.
The text string to display.
The direction of the text. See get_dir_vector for a description of the values.
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 the Artist (and its children) using the given renderer.
This has no effect if the artist is not visible (Artist.get_visible returns False).
This method is overridden in the Artist subclasses.
Return the (x, y, z) position of the text.
Like Artist.get_window_extent, but includes any clipping.
renderer that will be used to draw the figures (i.e. fig.canvas.get_renderer())
The enclosing bounding box (in figure pixel coordinates).
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 the (x, y, z) position of the text.
The position in 3D space.
The direction of the text. If unspecified, the zdir will not be changed.
Set the z position of the text.


Return the (x, y, z) position of the text.


Like Artist.get_window_extent, but includes any clipping.
renderer that will be used to draw the figures (i.e. fig.canvas.get_renderer())
The enclosing bounding box (in figure pixel coordinates).


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 the (x, y, z) position of the text.
The position in 3D space.
The direction of the text. If unspecified, the zdir will not be changed.


Bases: matplotlib.axes._axes.Axes
3D axes object.
The parent figure.
The (left, bottom, width, height) axes position.
Azimuthal viewing angle.
Elevation viewing angle.
Other axes to share z-limits with.
The projection type, default 'persp'.
If True, the draw order is computed based on the average position of the Artists along the view direction. Set to False if you want to manually control the order in which Artists are drawn on top of each other using their zorder attribute. This can be used for fine-tuning if the automatic order does not produce the desired result. Note however, that a manual zorder will only be correct for a limited view angle. If the figure is rotated by the user, it will look wrong from certain angles.
Prior to Matplotlib 3.4 Axes3D would add themselves to their host Figure on init. Other Axes class do not do this.
This behavior is deprecated in 3.4, the default will change to False in 3.5. The keyword will be undocumented and a non-False value will be an error in 3.6.
Other optional keyword arguments:
Property
Description
adjustable
{'box', 'datalim'}
agg_filter
a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array
alpha
scalar or None
anchor
(float, float) or {'C', 'SW', 'S', 'SE', 'E', 'NE', ...}
animated
bool
aspect
{'auto'}
autoscale_on
unknown
autoscalex_on
bool
autoscaley_on
bool
autoscalez_on
bool
axes_locator
Callable[[Axes, Renderer], Bbox]
axisbelow
bool or 'line'
box_aspect
3-tuple of floats or None
clip_box
Bbox
clip_on
bool
clip_path
Patch or (Path, Transform) or None
facecolor or fc
color
figure
Figure
frame_on
bool
gid
str
in_layout
bool
label
object
navigate
bool
navigate_mode
unknown
path_effects
AbstractPathEffect
picker
None or bool or float or callable
position
[left, bottom, width, height] or Bbox
proj_type
{'persp', 'ortho'}
prop_cycle
unknown
rasterization_zorder
float or None
rasterized
bool
sketch_params
(scale: float, length: float, randomness: float)
snap
bool or None
title
unknown
transform
Transform
url
str
visible
bool
xbound
unknown
xlabel
str
xlim3d or xlim
unknown
xmargin
unknown
xscale
{"linear"}
xticklabels
unknown
xticks
unknown
ybound
unknown
ylabel
str
ylim3d or ylim
unknown
ymargin
unknown
yscale
{"linear"}
yticklabels
unknown
yticks
unknown
zbound
unknown
zlabel
unknown
zlim3d or zlim
unknown
zmargin
unknown
zorder
float
zscale
{"linear"}
zticklabels
unknown
zticks
unknown
Add a 3D collection object to the plot.
2D collection types are converted to a 3D version by modifying the object and adding z coordinate information.
Supported are:
Adjust the Axes for a specified data aspect ratio.
Depending on get_adjustable this will modify either the Axes box (position) or the view limits. In the former case, get_anchor will affect the position.
See also
For a description of aspect ratio handling.
Set how the Axes adjusts to achieve the required aspect ratio.
Set the position in case of extra space.
This is called automatically when each Axes is drawn. You may need to call it yourself if you need to update the Axes position and/or view limits before the Figure is drawn.
Convenience method for simple axis view autoscaling. See matplotlib.axes.Axes.autoscale() for full explanation. Note that this function behaves the same, but for all three axes. Therefore, 'z' can be passed for axis, and 'both' applies to all three axes.
Autoscale the view limits using the data limits. See matplotlib.axes.Axes.autoscale_view() for documentation. Note that this function applies to the 3D axes, and as such adds the scalez to the function arguments.
Add 2D bar(s).
The x coordinates of the left sides of the bars.
The height of the bars.
Z coordinate of bars; if a single value is specified, it will be used for all bars.
When plotting 2D data, the direction to use as z ('x', 'y' or 'z').
If given, all parameters also accept a string s, which is interpreted as data[s] (unless this raises an exception).
Other arguments are forwarded to matplotlib.axes.Axes.bar.
Generate a 3D barplot.
This method creates three dimensional barplot where the width, depth, height, and color of the bars can all be uniquely set.
The coordinates of the anchor point of the bars.
The width, depth, and height of the bars, respectively.
The color of the bars can be specified globally or individually. This parameter can be:
When coloring the faces of the boxes specifically, this is the order of the coloring:
The z-axis sorting scheme passed onto Poly3DCollection
When true, this shades the dark sides of the bars (relative to the plot's source of light).
The lightsource to use when shade is True.
If given, all parameters also accept a string s, which is interpreted as data[s] (unless this raises an exception).
Any additional keyword arguments are passed onto Poly3DCollection.
A collection of three dimensional polygons representing the bars.
Return whether this axes supports the pan/zoom button functionality.
3D axes objects do not use the pan/zoom button.
Return whether this axes supports the zoom box button functionality.
3D axes objects do not use the zoom box button.
Clear the Axes.
Currently not implemented for 3D axes, and returns None.
Create a 3D contour plot.
Input data. See contour for acceptable data shapes.
Whether to extend contour in 3D.
Step size for extending contour.
The direction to use.
If specified, plot a projection of the contour lines at this position in a plane normal to zdir.
If given, all parameters also accept a string s, which is interpreted as data[s] (unless this raises an exception).
Other arguments are forwarded to matplotlib.axes.Axes.contour.
Create a 3D contour plot.
Input data. See contour for acceptable data shapes.
Whether to extend contour in 3D.
Step size for extending contour.
The direction to use.
If specified, plot a projection of the contour lines at this position in a plane normal to zdir.
If given, all parameters also accept a string s, which is interpreted as data[s] (unless this raises an exception).
Other arguments are forwarded to matplotlib.axes.Axes.contour.
Create a 3D filled contour plot.
Input data. See contourf for acceptable data shapes.
The direction to use.
If specified, plot a projection of the contour lines at this position in a plane normal to zdir.
If given, all parameters also accept a string s, which is interpreted as data[s] (unless this raises an exception).
Other arguments are forwarded to matplotlib.axes.Axes.contourf.
Create a 3D filled contour plot.
Input data. See contourf for acceptable data shapes.
The direction to use.
If specified, plot a projection of the contour lines at this position in a plane normal to zdir.
If given, all parameters also accept a string s, which is interpreted as data[s] (unless this raises an exception).
Other arguments are forwarded to matplotlib.axes.Axes.contourf.
For artists in an axes, if the zaxis has units support, convert z using zaxis unit type
Disable mouse buttons for 3D rotation and zooming.
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).
This method is overridden in the Artist subclasses.
Plot lines and/or markers with errorbars around them.
x/y/z define the data locations, and xerr/yerr/zerr define the errorbar sizes. By default, this draws the data markers/lines as well the errorbars. Use fmt='none' to draw errorbars only.
The data positions.
The errorbar sizes:
Note that all error arrays should have positive values.
The format for the data points / data lines. See plot for details.
Use 'none' (case insensitive) to plot errorbars without any data markers.
The color of the errorbar lines. If None, use the color of the line connecting the markers.
The linewidth of the errorbar lines. If None, the linewidth of the current style is used.
The length of the error bar caps in points.
An alias to the keyword argument markeredgewidth (a.k.a. mew). This setting is a more sensible name for the property that controls the thickness of the error bar cap in points. For backwards compatibility, if mew or markeredgewidth are given, then they will over-ride capthick. This may change in future releases.
If True, will plot the errorbars above the plot symbols. Default is below.
These arguments can be used to indicate that a value gives only lower limits. In that case a caret symbol is used to indicate this. lims-arguments may be scalars, or array-likes of the same length as the errors. To use limits with inverted axes, set_xlim or set_ylim must be called before errorbar(). Note the tricky parameter names: setting e.g. ylolims to True means that the y-value is a lower limit of the True value, so, only an upward-pointing arrow will be drawn!
Same as above, but for controlling the upper limits.
draws error bars on a subset of the data. errorevery =N draws error bars on the points (x[::N], y[::N], z[::N]). errorevery =(start, N) draws error bars on the points (x[start::N], y[start::N], z[start::N]). e.g. errorevery=(6, 3) adds error bars to the data at (x[6], x[9], x[12], x[15], ...). Used to avoid overlapping error bars when two series share x-axis values.
List of Line3DCollection instances each containing an errorbar line.
List of Line3D instances each containing a capline object.
List of Line3D instances each containing a marker with an upper or lower limit.
If given, the following parameters also accept a string s, which is interpreted as data[s] (unless this raises an exception):
x, y, z, xerr, yerr, zerr
All other keyword arguments for styling errorbar lines are passed Line3DCollection.
(Source code, png, pdf)
Given the 2D view coordinates attempt to guess a 3D coordinate. Looks for the nearest edge to the point and then assumes that the point is at the same z location as the nearest point on the edge.
Return z string formatted. This function will use the fmt_zdata attribute if it is callable, else will fall back on the zaxis major formatter
Return True if each axis is autoscaled, False otherwise.
Return whether the z-axis is autoscaled.
Get whether the 3D axes panels are drawn.
Create the projection matrix from the current viewing position.
Return the tight bounding box of the axes, including axis and their decorators (xlabel, title, etc).
Artists that have artist.set_in_layout(False) are not included in the bbox.
renderer that will be used to draw the figures (i.e. fig.canvas.get_renderer())
List of artists to include in the tight bounding box. If None (default), then all artist children of the Axes are included in the tight bounding box.
If call_axes_locator is False, it does not call the _axes_locator attribute, which is necessary to get the correct bounding box. call_axes_locator=False can be used if the caller is only interested in the relative size of the tightbbox compared to the Axes bbox.
The bounding box will not include the x-extent of the title and the xlabel, or the y-extent of the ylabel.
Bounding box in figure pixel coordinates.
See also
Get 3D world limits.
Alias for get_xlim3d.
Return the x-axis view limits.
The current x-axis limits in data coordinates.
See also
The x-axis may be inverted, in which case the left value will be greater than the right value.
Alias for get_ylim3d.
Return the y-axis view limits.
The current y-axis limits in data coordinates.
See also
The y-axis may be inverted, in which case the bottom value will be greater than the top value.
Return the ZAxis (Axis) instance.
Return the lower and upper z-axis bounds, in increasing order.
Return the zaxis' grid lines as a list of Line2Ds.
Get the z-label text string.
Alias for get_zlim3d.
Get 3D z limits.
Return the zaxis' major tick labels, as a list of Text.
Return the zaxis' minor tick labels, as a list of Text.
Get the zaxis' tick labels.
Whether to return the minor or the major ticklabels.
Overrides minor.
Selects which ticklabels to return
The tick label strings are not populated until a draw method has been called.
See also: draw and draw.
Return the zaxis' tick lines as a list of Line2Ds.
Return the zaxis' tick locations in data coordinates.
Set / unset 3D grid.
Note
Currently, this function does not behave the same as matplotlib.axes.Axes.grid(), but it is intended to eventually support that behavior.
Invert the z-axis.
Convenience method for controlling tick locators.
See matplotlib.axes.Axes.locator_params() for full documentation. Note that this is for Axes3D objects, therefore, setting axis to 'both' will result in the parameters being set for all three axes. Also, axis can also take a value of 'z' to apply parameters to the z axis.
Convenience method to set or retrieve autoscaling margins.
Call signatures:
returns xmargin, ymargin, zmargin
All forms above set the xmargin, ymargin and zmargin parameters. All keyword parameters are optional. A single positional argument specifies xmargin, ymargin and zmargin. Passing both positional and keyword arguments for xmargin, ymargin, and/or zmargin is invalid.
The tight parameter is passed to autoscale_view(), which is executed after a margin is changed; the default here is True, on the assumption that when margins are specified, no additional padding to match tick marks is usually desired. Setting tight to None will preserve the previous setting.
Specifying any margin changes only the autoscaling; for example, if xmargin is not None, then xmargin times the X data interval will be added to each end of that interval before it is used in autoscaling.
Set the mouse buttons for 3D rotation and zooming.
The mouse button or buttons to use for 3D rotation of the axes.
The mouse button or buttons to use to zoom the 3D axes.
Plot 2D or 3D data.
x coordinates of vertices.
y coordinates of vertices.
z coordinates of vertices; either one for all points or one for each point.
When plotting 2D data, the direction to use as z ('x', 'y' or 'z').
Other arguments are forwarded to matplotlib.axes.Axes.plot.
Plot 2D or 3D data.
x coordinates of vertices.
y coordinates of vertices.
z coordinates of vertices; either one for all points or one for each point.
When plotting 2D data, the direction to use as z ('x', 'y' or 'z').
Other arguments are forwarded to matplotlib.axes.Axes.plot.
Create a surface plot.
By default it will be colored in shades of a solid color, but it also supports colormapping by supplying the cmap argument.
Note
The rcount and ccount kwargs, which both default to 50, determine the maximum number of samples used in each direction. If the input data is larger, it will be downsampled (by slicing) to these numbers of points.
Note
To maximize rendering speed consider setting rstride and cstride to divisors of the number of rows minus 1 and columns minus 1 respectively. For example, given 51 rows rstride can be any of the divisors of 50.
Similarly, a setting of rstride and cstride equal to 1 (or rcount and ccount equal the number of rows and columns) can use the optimized path.
Data values.
Maximum number of samples used in each direction. If the input data is larger, it will be downsampled (by slicing) to these numbers of points. Defaults to 50.
Downsampling stride in each direction. These arguments are mutually exclusive with rcount and ccount. If only one of rstride or cstride is set, the other defaults to 10.
'classic' mode uses a default of rstride = cstride = 10 instead of the new default of rcount = ccount = 50.
Color of the surface patches.
Colormap of the surface patches.
Colors of each individual patch.
Normalization for the colormap.
Bounds for the normalization.
Whether to shade the facecolors. Shading is always disabled when cmap is specified.
The lightsource to use when shade is True.
Other arguments are forwarded to Poly3DCollection.
Plot a triangulated surface.
The (optional) triangulation can be specified in one of two ways; either:
where triangulation is a Triangulation object, or:
in which case a Triangulation object will be created. See Triangulation for a explanation of these possibilities.
The remaining arguments are:
where Z is the array of values to contour, one per point in the triangulation.
Data values as 1D arrays.
Color of the surface patches.
A colormap for the surface patches.
An instance of Normalize to map values to colors.
Minimum and maximum value to map.
Whether to shade the facecolors. Shading is always disabled when cmap is specified.
The lightsource to use when shade is True.
All other arguments are passed on to Poly3DCollection
(Source code, png, pdf)
(Source code, png, pdf)
Plot a 3D wireframe.
Note
The rcount and ccount kwargs, which both default to 50, determine the maximum number of samples used in each direction. If the input data is larger, it will be downsampled (by slicing) to these numbers of points.
Data values.
Maximum number of samples used in each direction. If the input data is larger, it will be downsampled (by slicing) to these numbers of points. Setting a count to zero causes the data to be not sampled in the corresponding direction, producing a 3D line plot rather than a wireframe plot. Defaults to 50.
Downsampling stride in each direction. These arguments are mutually exclusive with rcount and ccount. If only one of rstride or cstride is set, the other defaults to 1. Setting a stride to zero causes the data to be not sampled in the corresponding direction, producing a 3D line plot rather than a wireframe plot.
'classic' mode uses a default of rstride = cstride = 1 instead of the new default of rcount = ccount = 50.
Other arguments are forwarded to Line3DCollection.
Plot a 3D field of arrows.
The arguments could be array-like or scalars, so long as they they can be broadcast together. The arguments can also be masked arrays. If an element in any of argument is masked, then that corresponding quiver element will not be plotted.
The x, y and z coordinates of the arrow locations (default is tail of arrow; see pivot kwarg).
The x, y and z components of the arrow vectors.
The length of each quiver.
The ratio of the arrow head with respect to the quiver.
The part of the arrow that is at the grid point; the arrow rotates about this point, hence the name pivot.
Whether all arrows are normalized to have the same length, or keep the lengths defined by u, v, and w.
If given, all parameters also accept a string s, which is interpreted as data[s] (unless this raises an exception).
Any additional keyword arguments are delegated to LineCollection
Plot a 3D field of arrows.
The arguments could be array-like or scalars, so long as they they can be broadcast together. The arguments can also be masked arrays. If an element in any of argument is masked, then that corresponding quiver element will not be plotted.
The x, y and z coordinates of the arrow locations (default is tail of arrow; see pivot kwarg).
The x, y and z components of the arrow vectors.
The length of each quiver.
The ratio of the arrow head with respect to the quiver.
The part of the arrow that is at the grid point; the arrow rotates about this point, hence the name pivot.
Whether all arrows are normalized to have the same length, or keep the lengths defined by u, v, and w.
If given, all parameters also accept a string s, which is interpreted as data[s] (unless this raises an exception).
Any additional keyword arguments are delegated to LineCollection
Create a scatter plot.
The data positions.
The z-positions. Either an array of the same length as xs and ys or a single value to place all points in the same plane.
The axis direction for the zs. This is useful when plotting 2D data on a 3D Axes. The data must be passed as xs, ys. Setting zdir to 'y' then plots the data to the x-z-plane.
See also Plot 2D data on 3D plot.
The marker size in points**2. Either an array of the same length as xs and ys or a single value to make all markers the same size.
The marker color. Possible values:
For more details see the c argument of scatter.
Whether to shade the scatter markers to give the appearance of depth. Each call to scatter() will perform its depthshading independently.
If given, the following parameters also accept a string s, which is interpreted as data[s] (unless this raises an exception):
xs, ys, zs, s, edgecolors, c, facecolor, facecolors, color
All other arguments are passed on to scatter.
Create a scatter plot.
The data positions.
The z-positions. Either an array of the same length as xs and ys or a single value to place all points in the same plane.
The axis direction for the zs. This is useful when plotting 2D data on a 3D Axes. The data must be passed as xs, ys. Setting zdir to 'y' then plots the data to the x-z-plane.
See also Plot 2D data on 3D plot.
The marker size in points**2. Either an array of the same length as xs and ys or a single value to make all markers the same size.
The marker color. Possible values:
For more details see the c argument of scatter.
Whether to shade the scatter markers to give the appearance of depth. Each call to scatter() will perform its depthshading independently.
If given, the following parameters also accept a string s, which is interpreted as data[s] (unless this raises an exception):
xs, ys, zs, s, edgecolors, c, facecolor, facecolors, color
All other arguments are passed on to scatter.
Set multiple properties at once.
Supported properties are
Property
Description
adjustable
{'box', 'datalim'}
agg_filter
a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array
alpha
scalar or None
anchor
(float, float) or {'C', 'SW', 'S', 'SE', 'E', 'NE', ...}
animated
bool
aspect
{'auto'}
autoscale_on
unknown
autoscalex_on
bool
autoscaley_on
bool
autoscalez_on
bool
axes_locator
Callable[[Axes, Renderer], Bbox]
axisbelow
bool or 'line'
box_aspect
3-tuple of floats or None
clip_box
Bbox
clip_on
bool
clip_path
Patch or (Path, Transform) or None
facecolor or fc
color
figure
Figure
frame_on
bool
gid
str
in_layout
bool
label
object
navigate
bool
navigate_mode
unknown
path_effects
AbstractPathEffect
picker
None or bool or float or callable
position
[left, bottom, width, height] or Bbox
proj_type
{'persp', 'ortho'}
prop_cycle
unknown
rasterization_zorder
float or None
rasterized
bool
sketch_params
(scale: float, length: float, randomness: float)
snap
bool or None
title
unknown
transform
Transform
url
str
visible
bool
xbound
unknown
xlabel
str
xlim
(bottom: float, top: float)
xlim3d
unknown
xmargin
unknown
xscale
{"linear"}
xticklabels
unknown
xticks
unknown
ybound
unknown
ylabel
str
ylim
(bottom: float, top: float)
ylim3d
unknown
ymargin
unknown
yscale
{"linear"}
yticklabels
unknown
yticks
unknown
zbound
unknown
zlabel
unknown
zlim3d
unknown
zmargin
unknown
zorder
float
zscale
{"linear"}
zticklabels
unknown
zticks
unknown
Set the aspect ratios.
Axes 3D does not current support any aspect but 'auto' which fills the axes with the data limits.
To simulate having equal aspect in data space, set the ratio of your data limits to match the value of get_box_aspect. To control box aspect ratios use set_box_aspect.
Possible values:
value
description
'auto'
automatic; fill the position rectangle with data.
Currently ignored by Axes3D
If not None, this defines which parameter will be adjusted to meet the required aspect. See set_adjustable for further details.
If not None, this defines where the Axes will be drawn if there is extra space due to aspect constraints. The most common way to to specify the anchor are abbreviations of cardinal directions:
value
description
'C'
centered
'SW'
lower left corner
'S'
middle of bottom edge
'SE'
lower right corner
etc.
See set_anchor for further details.
If True, apply the settings to all shared Axes.
See also
Set whether autoscaling is applied to each axis on the next draw or call to Axes.autoscale_view.
Set whether the z-axis is autoscaled on the next draw or call to Axes.autoscale_view.
Turn the x- and y-axis off.
This affects the axis lines, ticks, ticklabels, grid and axis labels.
Turn the x- and y-axis on.
This affects the axis lines, ticks, ticklabels, grid and axis labels.
Set the axes box aspect.
The box aspect is the ratio of height to width in display units for each face of the box when viewed perpendicular to that face. This is not to be confused with the data aspect (which for Axes3D is always 'auto'). The default ratios are 4:4:3 (x:y:z).
To simulate having equal aspect in data space, set the box aspect to match your data range in each dimension.
zoom controls the overall size of the Axes3D in the figure.
Changes the physical dimensions of the Axes3D, such that the ratio of the axis lengths in display units is x:y:z.
If None, defaults to 4:4:3
Control overall size of the Axes3D in the figure.
Set whether the 3D axes panels are drawn.
Set the projection type.
Set a title for the Axes.
Set one of the three available Axes titles. The available titles are positioned above the Axes in the center, flush with the left edge, and flush with the right edge.
Text to use for the title
A dictionary controlling the appearance of the title text, the default fontdict is:
Which title to set.
Vertical Axes loation for the title (1.0 is the top). If None (the default), y is determined automatically to avoid decorators on the Axes.
The offset of the title from the top of the Axes, in points.
The matplotlib text instance representing the title
Other keyword arguments are text properties, see Text for a list of valid text properties.
Alias for set_xlim3d.
Set 3D x limits.
See matplotlib.axes.Axes.set_xlim() for full documentation.
Set padding of X data limits prior to autoscaling.
m times the data interval will be added to each end of that interval before it is used in autoscaling. For example, if your data is in the range [0, 2], a factor of m = 0.1 will result in a range [-0.2, 2.2].
Negative values -0.5 < m < 0 will result in clipping of the data range. I.e. for a data range [0, 2], a factor of m = -0.1 will result in a range [0.2, 1.8].
Set the x-axis scale.
The axis scale type to apply. 3D axes currently only support linear scales; other scales yield nonsensical results.
Keyword arguments are nominally forwarded to the scale class, but none of them is applicable for linear scales.
Alias for set_ylim3d.
Set 3D y limits.
See matplotlib.axes.Axes.set_ylim() for full documentation.
Set padding of Y data limits prior to autoscaling.
m times the data interval will be added to each end of that interval before it is used in autoscaling. For example, if your data is in the range [0, 2], a factor of m = 0.1 will result in a range [-0.2, 2.2].
Negative values -0.5 < m < 0 will result in clipping of the data range. I.e. for a data range [0, 2], a factor of m = -0.1 will result in a range [0.2, 1.8].
Set the y-axis scale.
The axis scale type to apply. 3D axes currently only support linear scales; other scales yield nonsensical results.
Keyword arguments are nominally forwarded to the scale class, but none of them is applicable for linear scales.
Set the lower and upper numerical bounds of the z-axis.
This method will honor axes inversion regardless of parameter order. It will not change the autoscaling setting (get_autoscalez_on()).
Set zlabel. See doc for set_ylabel for description.
Alias for set_zlim3d.
Set 3D z limits.
See matplotlib.axes.Axes.set_ylim() for full documentation
Set padding of Z data limits prior to autoscaling.
m times the data interval will be added to each end of that interval before it is used in autoscaling.
accepts: float in range 0 to 1
Set the z-axis scale.
The axis scale type to apply. 3D axes currently only support linear scales; other scales yield nonsensical results.
Keyword arguments are nominally forwarded to the scale class, but none of them is applicable for linear scales.
Set the zaxis' labels with list of string labels.
Warning
This method should only be used after fixing the tick positions using Axes3D.set_zticks. Otherwise, the labels may end up in unexpected positions.
The label texts.
A dictionary controlling the appearance of the ticklabels. The default fontdict is:
Whether to set the minor ticklabels rather than the major ones.
The labels.
Set the zaxis' tick locations and optionally labels.
If necessary, the view limits of the Axis are expanded so that all given ticks are visible.
List of tick locations.
List of tick labels. If not set, the labels show the data value.
If False, set the major ticks; if True, the minor ticks.
Text properties for the labels. These take effect only if you pass labels. In other cases, please use tick_params.
The mandatory expansion of the view limits is an intentional design choice to prevent the surprise of a non-visible tick. If you need other limits, you should set the limits explicitly after setting the ticks.
Create a 3D stem plot.
A stem plot draws lines perpendicular to a baseline, and places markers at the heads. By default, the baseline is defined by x and y, and stems are drawn vertically from bottom to z.
The positions of the heads of the stems. The stems are drawn along the orientation-direction from the baseline at bottom (in the orientation-coordinate) to the heads. By default, the x and y positions are used for the baseline and z for the head position, but this can be changed by orientation.
A string defining the properties of the vertical lines. Usually, this will be a color or a color and a linestyle:
Character
Line Style
'-'
solid line
'--'
dashed line
'-.'
dash-dot line
':'
dotted line
Note: While it is technically possible to specify valid formats other than color or color and linestyle (e.g. 'rx' or '-.'), this is beyond the intention of the method and will most likely not result in a reasonable plot.
A string defining the properties of the markers at the stem heads.
A format string defining the properties of the baseline.
The position of the baseline, in orientation-coordinates.
The label to use for the stems in legends.
The direction along which stems are drawn.
If given, all parameters also accept a string s, which is interpreted as data[s] (unless this raises an exception).
The container may be treated like a tuple (markerline, stemlines, baseline)
(Source code, png, pdf)
(png, pdf)
(png, pdf)
Create a 3D stem plot.
A stem plot draws lines perpendicular to a baseline, and places markers at the heads. By default, the baseline is defined by x and y, and stems are drawn vertically from bottom to z.
The positions of the heads of the stems. The stems are drawn along the orientation-direction from the baseline at bottom (in the orientation-coordinate) to the heads. By default, the x and y positions are used for the baseline and z for the head position, but this can be changed by orientation.
A string defining the properties of the vertical lines. Usually, this will be a color or a color and a linestyle:
Character
Line Style
'-'
solid line
'--'
dashed line
'-.'
dash-dot line
':'
dotted line
Note: While it is technically possible to specify valid formats other than color or color and linestyle (e.g. 'rx' or '-.'), this is beyond the intention of the method and will most likely not result in a reasonable plot.
A string defining the properties of the markers at the stem heads.
A format string defining the properties of the baseline.
The position of the baseline, in orientation-coordinates.
The label to use for the stems in legends.
The direction along which stems are drawn.
If given, all parameters also accept a string s, which is interpreted as data[s] (unless this raises an exception).
The container may be treated like a tuple (markerline, stemlines, baseline)
(Source code, png, pdf)
(png, pdf)
(png, pdf)
Add text to the plot. kwargs will be passed on to Axes.text, except for the zdir keyword, which sets the direction to be used as the z direction.
Add text to the Axes.
Add the text s to the Axes at location x, y in data coordinates.
The position to place the text. By default, this is in data coordinates. The coordinate system can be changed using the transform parameter.
The text.
A dictionary to override the default text properties. If fontdict is None, the defaults are determined by rcParams.
The created Text instance.
Other miscellaneous text parameters.
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
Individual keyword arguments can be used to override any given parameter:
The default transform specifies that text is in data coords, alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). The example below places text in the center of the Axes:
You can put a rectangular box around the text instance (e.g., to set a background color) by using the keyword bbox. bbox is a dictionary of Rectangle properties. For example:
Add text to the plot. kwargs will be passed on to Axes.text, except for the zdir keyword, which sets the direction to be used as the z direction.
Convenience method for changing the appearance of ticks and tick labels.
See matplotlib.axes.Axes.tick_params() for more complete documentation.
The only difference is that setting axis to 'both' will mean that the settings are applied to all three axes. Also, the axis parameter also accepts a value of 'z', which would mean to apply to only the z-axis.
Also, because of how Axes3D objects are drawn very differently from regular 2D axes, some of these settings may have ambiguous meaning. For simplicity, the 'z' axis will accept settings as if it was like the 'y' axis.
Note
Axes3D currently ignores some of these settings.
Create a 3D contour plot.
Note
This method currently produces incorrect output due to a longstanding bug in 3D PolyCollection rendering.
Input data. See tricontour for acceptable data shapes.
Whether to extend contour in 3D.
Step size for extending contour.
The direction to use.
If specified, plot a projection of the contour lines at this position in a plane normal to zdir.
If given, all parameters also accept a string s, which is interpreted as data[s] (unless this raises an exception).
Other arguments are forwarded to matplotlib.axes.Axes.tricontour.
Create a 3D filled contour plot.
Note
This method currently produces incorrect output due to a longstanding bug in 3D PolyCollection rendering.
Input data. See tricontourf for acceptable data shapes.
The direction to use.
If specified, plot a projection of the contour lines at this position in a plane normal to zdir.
If given, all parameters also accept a string s, which is interpreted as data[s] (unless this raises an exception).
Other arguments are forwarded to matplotlib.axes.Axes.tricontourf.
Extend the dataLim Bbox to include the given points.
If no data is set currently, the Bbox will ignore its limits and set the bound to be the bounds of the xydata (xys). Otherwise, it will compute the bounds of the union of its current data and the data in xys.
The points to include in the data limits Bbox. This can be either a list of (x, y) tuples or a Nx2 array.
Whether to update the x/y limits.
Set the elevation and azimuth of the axes in degrees (not radians).
This can be used to rotate the axes programmatically.
The elevation angle in the vertical plane in degrees. If None then the initial value as specified in the Axes3D constructor is used.
The azimuth angle in the horizontal plane in degrees. If None then the initial value as specified in the Axes3D constructor is used.
The axis to align vertically. azim rotates about this axis.
Plot a set of filled voxels
All voxels are plotted as 1x1x1 cubes on the axis, with filled[0, 0, 0] placed with its lower corner at the origin. Occluded faces are not plotted.
A 3D array of values, with truthy values indicating which voxels to fill
The coordinates of the corners of the voxels. This should broadcast to a shape one larger in every dimension than the shape of filled. These can be used to plot non-cubic voxels.
If not specified, defaults to increasing integers along each axis, like those returned by indices(). As indicated by the / in the function signature, these arguments can only be passed positionally.
The color to draw the faces and edges of the voxels. Can only be passed as keyword arguments. These parameters can be:
Whether to shade the facecolors. Shading is always disabled when cmap is specified.
The lightsource to use when shade is True.
Additional keyword arguments to pass onto Poly3DCollection.
A dictionary indexed by coordinate, where faces[i, j, k] is a Poly3DCollection of the faces drawn for the voxel filled[i, j, k]. If no faces were drawn for a given voxel, either because it was not asked to be drawn, or it is fully occluded, then (i, j, k) not in faces.
(Source code, png, pdf)
(Source code, png, pdf)
(Source code, png, pdf)
(Source code, png, pdf)
Set up axis ticks and labels to treat data along the zaxis as dates.
The timezone used to create date labels.
This function is merely provided for completeness, but 3D axes do not support dates for ticks, and so this may not work as expected.
Returns True if the z-axis is inverted.


Add a 3D collection object to the plot.
2D collection types are converted to a 3D version by modifying the object and adding z coordinate information.
Supported are:


Adjust the Axes for a specified data aspect ratio.
Depending on get_adjustable this will modify either the Axes box (position) or the view limits. In the former case, get_anchor will affect the position.
See also
For a description of aspect ratio handling.
Set how the Axes adjusts to achieve the required aspect ratio.
Set the position in case of extra space.
This is called automatically when each Axes is drawn. You may need to call it yourself if you need to update the Axes position and/or view limits before the Figure is drawn.


Convenience method for simple axis view autoscaling. See matplotlib.axes.Axes.autoscale() for full explanation. Note that this function behaves the same, but for all three axes. Therefore, 'z' can be passed for axis, and 'both' applies to all three axes.


Autoscale the view limits using the data limits. See matplotlib.axes.Axes.autoscale_view() for documentation. Note that this function applies to the 3D axes, and as such adds the scalez to the function arguments.


Add 2D bar(s).
The x coordinates of the left sides of the bars.
The height of the bars.
Z coordinate of bars; if a single value is specified, it will be used for all bars.
When plotting 2D data, the direction to use as z ('x', 'y' or 'z').
If given, all parameters also accept a string s, which is interpreted as data[s] (unless this raises an exception).
Other arguments are forwarded to matplotlib.axes.Axes.bar.


Generate a 3D barplot.
This method creates three dimensional barplot where the width, depth, height, and color of the bars can all be uniquely set.
The coordinates of the anchor point of the bars.
The width, depth, and height of the bars, respectively.
The color of the bars can be specified globally or individually. This parameter can be:
When coloring the faces of the boxes specifically, this is the order of the coloring:
The z-axis sorting scheme passed onto Poly3DCollection
When true, this shades the dark sides of the bars (relative to the plot's source of light).
The lightsource to use when shade is True.
If given, all parameters also accept a string s, which is interpreted as data[s] (unless this raises an exception).
Any additional keyword arguments are passed onto Poly3DCollection.
A collection of three dimensional polygons representing the bars.


Return whether this axes supports the pan/zoom button functionality.
3D axes objects do not use the pan/zoom button.


Return whether this axes supports the zoom box button functionality.
3D axes objects do not use the zoom box button.


Currently not implemented for 3D axes, and returns None.


Create a 3D contour plot.
Input data. See contour for acceptable data shapes.
Whether to extend contour in 3D.
Step size for extending contour.
The direction to use.
If specified, plot a projection of the contour lines at this position in a plane normal to zdir.
If given, all parameters also accept a string s, which is interpreted as data[s] (unless this raises an exception).
Other arguments are forwarded to matplotlib.axes.Axes.contour.


Create a 3D filled contour plot.
Input data. See contourf for acceptable data shapes.
The direction to use.
If specified, plot a projection of the contour lines at this position in a plane normal to zdir.
If given, all parameters also accept a string s, which is interpreted as data[s] (unless this raises an exception).
Other arguments are forwarded to matplotlib.axes.Axes.contourf.


For artists in an axes, if the zaxis has units support, convert z using zaxis unit type


Disable mouse buttons for 3D rotation and zooming.


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).
This method is overridden in the Artist subclasses.


Plot lines and/or markers with errorbars around them.
x/y/z define the data locations, and xerr/yerr/zerr define the errorbar sizes. By default, this draws the data markers/lines as well the errorbars. Use fmt='none' to draw errorbars only.
The data positions.
The errorbar sizes:
Note that all error arrays should have positive values.
The format for the data points / data lines. See plot for details.
Use 'none' (case insensitive) to plot errorbars without any data markers.
The color of the errorbar lines. If None, use the color of the line connecting the markers.
The linewidth of the errorbar lines. If None, the linewidth of the current style is used.
The length of the error bar caps in points.
An alias to the keyword argument markeredgewidth (a.k.a. mew). This setting is a more sensible name for the property that controls the thickness of the error bar cap in points. For backwards compatibility, if mew or markeredgewidth are given, then they will over-ride capthick. This may change in future releases.
If True, will plot the errorbars above the plot symbols. Default is below.
These arguments can be used to indicate that a value gives only lower limits. In that case a caret symbol is used to indicate this. lims-arguments may be scalars, or array-likes of the same length as the errors. To use limits with inverted axes, set_xlim or set_ylim must be called before errorbar(). Note the tricky parameter names: setting e.g. ylolims to True means that the y-value is a lower limit of the True value, so, only an upward-pointing arrow will be drawn!
Same as above, but for controlling the upper limits.
draws error bars on a subset of the data. errorevery =N draws error bars on the points (x[::N], y[::N], z[::N]). errorevery =(start, N) draws error bars on the points (x[start::N], y[start::N], z[start::N]). e.g. errorevery=(6, 3) adds error bars to the data at (x[6], x[9], x[12], x[15], ...). Used to avoid overlapping error bars when two series share x-axis values.
List of Line3DCollection instances each containing an errorbar line.
List of Line3D instances each containing a capline object.
List of Line3D instances each containing a marker with an upper or lower limit.
If given, the following parameters also accept a string s, which is interpreted as data[s] (unless this raises an exception):
x, y, z, xerr, yerr, zerr
All other keyword arguments for styling errorbar lines are passed Line3DCollection.
(Source code, png, pdf)


Given the 2D view coordinates attempt to guess a 3D coordinate. Looks for the nearest edge to the point and then assumes that the point is at the same z location as the nearest point on the edge.


Return z string formatted. This function will use the fmt_zdata attribute if it is callable, else will fall back on the zaxis major formatter


Return True if each axis is autoscaled, False otherwise.


Return whether the z-axis is autoscaled.


Get whether the 3D axes panels are drawn.


Create the projection matrix from the current viewing position.


Return the tight bounding box of the axes, including axis and their decorators (xlabel, title, etc).
Artists that have artist.set_in_layout(False) are not included in the bbox.
renderer that will be used to draw the figures (i.e. fig.canvas.get_renderer())
List of artists to include in the tight bounding box. If None (default), then all artist children of the Axes are included in the tight bounding box.
If call_axes_locator is False, it does not call the _axes_locator attribute, which is necessary to get the correct bounding box. call_axes_locator=False can be used if the caller is only interested in the relative size of the tightbbox compared to the Axes bbox.
The bounding box will not include the x-extent of the title and the xlabel, or the y-extent of the ylabel.
Bounding box in figure pixel coordinates.
See also


Return the x-axis view limits.
The current x-axis limits in data coordinates.
See also
The x-axis may be inverted, in which case the left value will be greater than the right value.


Return the y-axis view limits.
The current y-axis limits in data coordinates.
See also
The y-axis may be inverted, in which case the bottom value will be greater than the top value.


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


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


Return the zaxis' major tick labels, as a list of Text.


Return the zaxis' minor tick labels, as a list of Text.


Get the zaxis' tick labels.
Whether to return the minor or the major ticklabels.
Overrides minor.
Selects which ticklabels to return
The tick label strings are not populated until a draw method has been called.
See also: draw and draw.


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


Return the zaxis' tick locations in data coordinates.


Set / unset 3D grid.
Note
Currently, this function does not behave the same as matplotlib.axes.Axes.grid(), but it is intended to eventually support that behavior.


Convenience method for controlling tick locators.
See matplotlib.axes.Axes.locator_params() for full documentation. Note that this is for Axes3D objects, therefore, setting axis to 'both' will result in the parameters being set for all three axes. Also, axis can also take a value of 'z' to apply parameters to the z axis.


Convenience method to set or retrieve autoscaling margins.
Call signatures:
returns xmargin, ymargin, zmargin
All forms above set the xmargin, ymargin and zmargin parameters. All keyword parameters are optional. A single positional argument specifies xmargin, ymargin and zmargin. Passing both positional and keyword arguments for xmargin, ymargin, and/or zmargin is invalid.
The tight parameter is passed to autoscale_view(), which is executed after a margin is changed; the default here is True, on the assumption that when margins are specified, no additional padding to match tick marks is usually desired. Setting tight to None will preserve the previous setting.
Specifying any margin changes only the autoscaling; for example, if xmargin is not None, then xmargin times the X data interval will be added to each end of that interval before it is used in autoscaling.


Set the mouse buttons for 3D rotation and zooming.
The mouse button or buttons to use for 3D rotation of the axes.
The mouse button or buttons to use to zoom the 3D axes.


Plot 2D or 3D data.
x coordinates of vertices.
y coordinates of vertices.
z coordinates of vertices; either one for all points or one for each point.
When plotting 2D data, the direction to use as z ('x', 'y' or 'z').
Other arguments are forwarded to matplotlib.axes.Axes.plot.


Create a surface plot.
By default it will be colored in shades of a solid color, but it also supports colormapping by supplying the cmap argument.
Note
The rcount and ccount kwargs, which both default to 50, determine the maximum number of samples used in each direction. If the input data is larger, it will be downsampled (by slicing) to these numbers of points.
Note
To maximize rendering speed consider setting rstride and cstride to divisors of the number of rows minus 1 and columns minus 1 respectively. For example, given 51 rows rstride can be any of the divisors of 50.
Similarly, a setting of rstride and cstride equal to 1 (or rcount and ccount equal the number of rows and columns) can use the optimized path.
Data values.
Maximum number of samples used in each direction. If the input data is larger, it will be downsampled (by slicing) to these numbers of points. Defaults to 50.
Downsampling stride in each direction. These arguments are mutually exclusive with rcount and ccount. If only one of rstride or cstride is set, the other defaults to 10.
'classic' mode uses a default of rstride = cstride = 10 instead of the new default of rcount = ccount = 50.
Color of the surface patches.
Colormap of the surface patches.
Colors of each individual patch.
Normalization for the colormap.
Bounds for the normalization.
Whether to shade the facecolors. Shading is always disabled when cmap is specified.
The lightsource to use when shade is True.
Other arguments are forwarded to Poly3DCollection.


Plot a triangulated surface.
The (optional) triangulation can be specified in one of two ways; either:
where triangulation is a Triangulation object, or:
in which case a Triangulation object will be created. See Triangulation for a explanation of these possibilities.
The remaining arguments are:
where Z is the array of values to contour, one per point in the triangulation.
Data values as 1D arrays.
Color of the surface patches.
A colormap for the surface patches.
An instance of Normalize to map values to colors.
Minimum and maximum value to map.
Whether to shade the facecolors. Shading is always disabled when cmap is specified.
The lightsource to use when shade is True.
All other arguments are passed on to Poly3DCollection
(Source code, png, pdf)
(Source code, png, pdf)


Plot a 3D wireframe.
Note
The rcount and ccount kwargs, which both default to 50, determine the maximum number of samples used in each direction. If the input data is larger, it will be downsampled (by slicing) to these numbers of points.
Data values.
Maximum number of samples used in each direction. If the input data is larger, it will be downsampled (by slicing) to these numbers of points. Setting a count to zero causes the data to be not sampled in the corresponding direction, producing a 3D line plot rather than a wireframe plot. Defaults to 50.
Downsampling stride in each direction. These arguments are mutually exclusive with rcount and ccount. If only one of rstride or cstride is set, the other defaults to 1. Setting a stride to zero causes the data to be not sampled in the corresponding direction, producing a 3D line plot rather than a wireframe plot.
'classic' mode uses a default of rstride = cstride = 1 instead of the new default of rcount = ccount = 50.
Other arguments are forwarded to Line3DCollection.


Plot a 3D field of arrows.
The arguments could be array-like or scalars, so long as they they can be broadcast together. The arguments can also be masked arrays. If an element in any of argument is masked, then that corresponding quiver element will not be plotted.
The x, y and z coordinates of the arrow locations (default is tail of arrow; see pivot kwarg).
The x, y and z components of the arrow vectors.
The length of each quiver.
The ratio of the arrow head with respect to the quiver.
The part of the arrow that is at the grid point; the arrow rotates about this point, hence the name pivot.
Whether all arrows are normalized to have the same length, or keep the lengths defined by u, v, and w.
If given, all parameters also accept a string s, which is interpreted as data[s] (unless this raises an exception).
Any additional keyword arguments are delegated to LineCollection


Create a scatter plot.
The data positions.
The z-positions. Either an array of the same length as xs and ys or a single value to place all points in the same plane.
The axis direction for the zs. This is useful when plotting 2D data on a 3D Axes. The data must be passed as xs, ys. Setting zdir to 'y' then plots the data to the x-z-plane.
See also Plot 2D data on 3D plot.
The marker size in points**2. Either an array of the same length as xs and ys or a single value to make all markers the same size.
The marker color. Possible values:
For more details see the c argument of scatter.
Whether to shade the scatter markers to give the appearance of depth. Each call to scatter() will perform its depthshading independently.
If given, the following parameters also accept a string s, which is interpreted as data[s] (unless this raises an exception):
xs, ys, zs, s, edgecolors, c, facecolor, facecolors, color
All other arguments are passed on to scatter.


Set multiple properties at once.
Supported properties are
Property
Description
adjustable
{'box', 'datalim'}
agg_filter
a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array
alpha
scalar or None
anchor
(float, float) or {'C', 'SW', 'S', 'SE', 'E', 'NE', ...}
animated
bool
aspect
{'auto'}
autoscale_on
unknown
autoscalex_on
bool
autoscaley_on
bool
autoscalez_on
bool
axes_locator
Callable[[Axes, Renderer], Bbox]
axisbelow
bool or 'line'
box_aspect
3-tuple of floats or None
clip_box
Bbox
clip_on
bool
clip_path
Patch or (Path, Transform) or None
facecolor or fc
color
figure
Figure
frame_on
bool
gid
str
in_layout
bool
label
object
navigate
bool
navigate_mode
unknown
path_effects
AbstractPathEffect
picker
None or bool or float or callable
position
[left, bottom, width, height] or Bbox
proj_type
{'persp', 'ortho'}
prop_cycle
unknown
rasterization_zorder
float or None
rasterized
bool
sketch_params
(scale: float, length: float, randomness: float)
snap
bool or None
title
unknown
transform
Transform
url
str
visible
bool
xbound
unknown
xlabel
str
xlim
(bottom: float, top: float)
xlim3d
unknown
xmargin
unknown
xscale
{"linear"}
xticklabels
unknown
xticks
unknown
ybound
unknown
ylabel
str
ylim
(bottom: float, top: float)
ylim3d
unknown
ymargin
unknown
yscale
{"linear"}
yticklabels
unknown
yticks
unknown
zbound
unknown
zlabel
unknown
zlim3d
unknown
zmargin
unknown
zorder
float
zscale
{"linear"}
zticklabels
unknown
zticks
unknown


Set the aspect ratios.
Axes 3D does not current support any aspect but 'auto' which fills the axes with the data limits.
To simulate having equal aspect in data space, set the ratio of your data limits to match the value of get_box_aspect. To control box aspect ratios use set_box_aspect.
Possible values:
value
description
'auto'
automatic; fill the position rectangle with data.
Currently ignored by Axes3D
If not None, this defines which parameter will be adjusted to meet the required aspect. See set_adjustable for further details.
If not None, this defines where the Axes will be drawn if there is extra space due to aspect constraints. The most common way to to specify the anchor are abbreviations of cardinal directions:
value
description
'C'
centered
'SW'
lower left corner
'S'
middle of bottom edge
'SE'
lower right corner
etc.
See set_anchor for further details.
If True, apply the settings to all shared Axes.
See also


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


Set whether the z-axis is autoscaled on the next draw or call to Axes.autoscale_view.


Turn the x- and y-axis off.
This affects the axis lines, ticks, ticklabels, grid and axis labels.


Turn the x- and y-axis on.
This affects the axis lines, ticks, ticklabels, grid and axis labels.


Set the axes box aspect.
The box aspect is the ratio of height to width in display units for each face of the box when viewed perpendicular to that face. This is not to be confused with the data aspect (which for Axes3D is always 'auto'). The default ratios are 4:4:3 (x:y:z).
To simulate having equal aspect in data space, set the box aspect to match your data range in each dimension.
zoom controls the overall size of the Axes3D in the figure.
Changes the physical dimensions of the Axes3D, such that the ratio of the axis lengths in display units is x:y:z.
If None, defaults to 4:4:3
Control overall size of the Axes3D in the figure.


Set whether the 3D axes panels are drawn.


Set a title for the Axes.
Set one of the three available Axes titles. The available titles are positioned above the Axes in the center, flush with the left edge, and flush with the right edge.
Text to use for the title
A dictionary controlling the appearance of the title text, the default fontdict is:
Which title to set.
Vertical Axes loation for the title (1.0 is the top). If None (the default), y is determined automatically to avoid decorators on the Axes.
The offset of the title from the top of the Axes, in points.
The matplotlib text instance representing the title
Other keyword arguments are text properties, see Text for a list of valid text properties.


Set 3D x limits.
See matplotlib.axes.Axes.set_xlim() for full documentation.


Set padding of X data limits prior to autoscaling.
m times the data interval will be added to each end of that interval before it is used in autoscaling. For example, if your data is in the range [0, 2], a factor of m = 0.1 will result in a range [-0.2, 2.2].
Negative values -0.5 < m < 0 will result in clipping of the data range. I.e. for a data range [0, 2], a factor of m = -0.1 will result in a range [0.2, 1.8].


Set the x-axis scale.
The axis scale type to apply. 3D axes currently only support linear scales; other scales yield nonsensical results.
Keyword arguments are nominally forwarded to the scale class, but none of them is applicable for linear scales.


Set 3D y limits.
See matplotlib.axes.Axes.set_ylim() for full documentation.


Set padding of Y data limits prior to autoscaling.
m times the data interval will be added to each end of that interval before it is used in autoscaling. For example, if your data is in the range [0, 2], a factor of m = 0.1 will result in a range [-0.2, 2.2].
Negative values -0.5 < m < 0 will result in clipping of the data range. I.e. for a data range [0, 2], a factor of m = -0.1 will result in a range [0.2, 1.8].


Set the y-axis scale.
The axis scale type to apply. 3D axes currently only support linear scales; other scales yield nonsensical results.
Keyword arguments are nominally forwarded to the scale class, but none of them is applicable for linear scales.


Set the lower and upper numerical bounds of the z-axis.
This method will honor axes inversion regardless of parameter order. It will not change the autoscaling setting (get_autoscalez_on()).


Set zlabel. See doc for set_ylabel for description.


Set 3D z limits.
See matplotlib.axes.Axes.set_ylim() for full documentation


Set padding of Z data limits prior to autoscaling.
m times the data interval will be added to each end of that interval before it is used in autoscaling.
accepts: float in range 0 to 1


Set the z-axis scale.
The axis scale type to apply. 3D axes currently only support linear scales; other scales yield nonsensical results.
Keyword arguments are nominally forwarded to the scale class, but none of them is applicable for linear scales.


Set the zaxis' labels with list of string labels.
Warning
This method should only be used after fixing the tick positions using Axes3D.set_zticks. Otherwise, the labels may end up in unexpected positions.
The label texts.
A dictionary controlling the appearance of the ticklabels. The default fontdict is:
Whether to set the minor ticklabels rather than the major ones.
The labels.


Set the zaxis' tick locations and optionally labels.
If necessary, the view limits of the Axis are expanded so that all given ticks are visible.
List of tick locations.
List of tick labels. If not set, the labels show the data value.
If False, set the major ticks; if True, the minor ticks.
Text properties for the labels. These take effect only if you pass labels. In other cases, please use tick_params.
The mandatory expansion of the view limits is an intentional design choice to prevent the surprise of a non-visible tick. If you need other limits, you should set the limits explicitly after setting the ticks.


Create a 3D stem plot.
A stem plot draws lines perpendicular to a baseline, and places markers at the heads. By default, the baseline is defined by x and y, and stems are drawn vertically from bottom to z.
The positions of the heads of the stems. The stems are drawn along the orientation-direction from the baseline at bottom (in the orientation-coordinate) to the heads. By default, the x and y positions are used for the baseline and z for the head position, but this can be changed by orientation.
A string defining the properties of the vertical lines. Usually, this will be a color or a color and a linestyle:
Character
Line Style
'-'
solid line
'--'
dashed line
'-.'
dash-dot line
':'
dotted line
Note: While it is technically possible to specify valid formats other than color or color and linestyle (e.g. 'rx' or '-.'), this is beyond the intention of the method and will most likely not result in a reasonable plot.
A string defining the properties of the markers at the stem heads.
A format string defining the properties of the baseline.
The position of the baseline, in orientation-coordinates.
The label to use for the stems in legends.
The direction along which stems are drawn.
If given, all parameters also accept a string s, which is interpreted as data[s] (unless this raises an exception).
The container may be treated like a tuple (markerline, stemlines, baseline)
(Source code, png, pdf)
(png, pdf)
(png, pdf)


Add text to the plot. kwargs will be passed on to Axes.text, except for the zdir keyword, which sets the direction to be used as the z direction.


Add text to the Axes.
Add the text s to the Axes at location x, y in data coordinates.
The position to place the text. By default, this is in data coordinates. The coordinate system can be changed using the transform parameter.
The text.
A dictionary to override the default text properties. If fontdict is None, the defaults are determined by rcParams.
The created Text instance.
Other miscellaneous text parameters.
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
Individual keyword arguments can be used to override any given parameter:
The default transform specifies that text is in data coords, alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). The example below places text in the center of the Axes:
You can put a rectangular box around the text instance (e.g., to set a background color) by using the keyword bbox. bbox is a dictionary of Rectangle properties. For example:


Convenience method for changing the appearance of ticks and tick labels.
See matplotlib.axes.Axes.tick_params() for more complete documentation.
The only difference is that setting axis to 'both' will mean that the settings are applied to all three axes. Also, the axis parameter also accepts a value of 'z', which would mean to apply to only the z-axis.
Also, because of how Axes3D objects are drawn very differently from regular 2D axes, some of these settings may have ambiguous meaning. For simplicity, the 'z' axis will accept settings as if it was like the 'y' axis.
Note
Axes3D currently ignores some of these settings.


Create a 3D contour plot.
Note
This method currently produces incorrect output due to a longstanding bug in 3D PolyCollection rendering.
Input data. See tricontour for acceptable data shapes.
Whether to extend contour in 3D.
Step size for extending contour.
The direction to use.
If specified, plot a projection of the contour lines at this position in a plane normal to zdir.
If given, all parameters also accept a string s, which is interpreted as data[s] (unless this raises an exception).
Other arguments are forwarded to matplotlib.axes.Axes.tricontour.


Create a 3D filled contour plot.
Note
This method currently produces incorrect output due to a longstanding bug in 3D PolyCollection rendering.
Input data. See tricontourf for acceptable data shapes.
The direction to use.
If specified, plot a projection of the contour lines at this position in a plane normal to zdir.
If given, all parameters also accept a string s, which is interpreted as data[s] (unless this raises an exception).
Other arguments are forwarded to matplotlib.axes.Axes.tricontourf.


Extend the dataLim Bbox to include the given points.
If no data is set currently, the Bbox will ignore its limits and set the bound to be the bounds of the xydata (xys). Otherwise, it will compute the bounds of the union of its current data and the data in xys.
The points to include in the data limits Bbox. This can be either a list of (x, y) tuples or a Nx2 array.
Whether to update the x/y limits.


Set the elevation and azimuth of the axes in degrees (not radians).
This can be used to rotate the axes programmatically.
The elevation angle in the vertical plane in degrees. If None then the initial value as specified in the Axes3D constructor is used.
The azimuth angle in the horizontal plane in degrees. If None then the initial value as specified in the Axes3D constructor is used.
The axis to align vertically. azim rotates about this axis.


Plot a set of filled voxels
All voxels are plotted as 1x1x1 cubes on the axis, with filled[0, 0, 0] placed with its lower corner at the origin. Occluded faces are not plotted.
A 3D array of values, with truthy values indicating which voxels to fill
The coordinates of the corners of the voxels. This should broadcast to a shape one larger in every dimension than the shape of filled. These can be used to plot non-cubic voxels.
If not specified, defaults to increasing integers along each axis, like those returned by indices(). As indicated by the / in the function signature, these arguments can only be passed positionally.
The color to draw the faces and edges of the voxels. Can only be passed as keyword arguments. These parameters can be:
Whether to shade the facecolors. Shading is always disabled when cmap is specified.
The lightsource to use when shade is True.
Additional keyword arguments to pass onto Poly3DCollection.
A dictionary indexed by coordinate, where faces[i, j, k] is a Poly3DCollection of the faces drawn for the voxel filled[i, j, k]. If no faces were drawn for a given voxel, either because it was not asked to be drawn, or it is fully occluded, then (i, j, k) not in faces.
(Source code, png, pdf)
(Source code, png, pdf)
(Source code, png, pdf)
(Source code, png, pdf)


Set up axis ticks and labels to treat data along the zaxis as dates.
The timezone used to create date labels.
This function is merely provided for completeness, but 3D axes do not support dates for ticks, and so this may not work as expected.


Bases: matplotlib.axis.XAxis
An Axis class for the 3D plots.
The Axes to which the created Axis belongs.
The acceptance radius for containment tests. See also Axis.contains.
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).
This method is overridden in the Artist subclasses.
Return the list of major Ticks.
Return the list of minor Ticks.
Return a bounding box that encloses the axis. It only accounts tick labels, axis label, and offsetText.
If for_layout_only is True, then the width of the label (if this is an x-axis) or the height of the label (if this is a y-axis) is collapsed to near zero. This allows tight/constrained_layout to ignore too-long labels when doing their layout.
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
scalar or None
animated
bool
clip_box
Bbox
clip_on
bool
clip_path
Patch or (Path, Transform) or None
data_interval
unknown
figure
Figure
gid
str
in_layout
bool
inverted
unknown
label
object
label_coords
unknown
label_position
{'top', 'bottom'}
label_text
str
major_formatter
Formatter, str, or function
major_locator
Locator
minor_formatter
Formatter, str, or function
minor_locator
Locator
pane_color
unknown
pane_pos
unknown
path_effects
AbstractPathEffect
picker
None or bool or float or callable
pickradius
float
rasterized
bool
remove_overlapping_locs
unknown
rotate_label
unknown
sketch_params
(scale: float, length: float, randomness: float)
snap
bool or None
tick_params
unknown
ticklabels
sequence of str or of Texts
ticks
list of floats
ticks_position
{'top', 'bottom', 'both', 'default', 'none'}
transform
Transform
units
units tag
url
str
view_interval
unknown
visible
bool
zorder
float
Set pane color to a RGBA tuple.
Whether to rotate the axis label: True, False or None. If set to None the label will be rotated if longer than 4 chars.


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).
This method is overridden in the Artist subclasses.


Return a bounding box that encloses the axis. It only accounts tick labels, axis label, and offsetText.
If for_layout_only is True, then the width of the label (if this is an x-axis) or the height of the label (if this is a y-axis) is collapsed to near zero. This allows tight/constrained_layout to ignore too-long labels when doing their layout.