mpl_toolkits.mplot3d.art3d.Patch3DCollection#

class mpl_toolkits.mplot3d.art3d.Patch3DCollection(*args, zs=0, zdir='z', depthshade=True, **kwargs)[source]#

Bases: 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 to shade the patches in order to give the appearance of depth (default is True). This is typically desired in scatter plots.

do_3d_projection()[source]#
get_depthshade()[source]#
get_edgecolor()[source]#
get_facecolor()[source]#
set(*, agg_filter=<UNSET>, alpha=<UNSET>, animated=<UNSET>, antialiased=<UNSET>, array=<UNSET>, capstyle=<UNSET>, clim=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, cmap=<UNSET>, color=<UNSET>, depthshade=<UNSET>, edgecolor=<UNSET>, facecolor=<UNSET>, gid=<UNSET>, hatch=<UNSET>, in_layout=<UNSET>, joinstyle=<UNSET>, label=<UNSET>, linestyle=<UNSET>, linewidth=<UNSET>, mouseover=<UNSET>, norm=<UNSET>, offset_transform=<UNSET>, offsets=<UNSET>, path_effects=<UNSET>, paths=<UNSET>, picker=<UNSET>, pickradius=<UNSET>, rasterized=<UNSET>, sketch_params=<UNSET>, snap=<UNSET>, sort_zpos=<UNSET>, transform=<UNSET>, url=<UNSET>, urls=<UNSET>, visible=<UNSET>, zorder=<UNSET>)[source]#

Set multiple properties at once.

Supported properties are

Property

Description

3d_properties

float or array of floats

agg_filter

a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image

alpha

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

mouseover

bool

norm

Normalize or str or None

offset_transform or transOffset

unknown

offsets

(N, 2) or (2,) array-like

path_effects

AbstractPathEffect

paths

unknown

picker

None or bool or float or callable

pickradius

unknown

rasterized

bool

sketch_params

(scale: float, length: float, randomness: float)

snap

bool or None

sort_zpos

unknown

transform

Transform

url

str

urls

list of str or None

visible

bool

zorder

float

set_3d_properties(zs, zdir)[source]#

Set the z positions and direction of the patches.

Parameters:
zsfloat or array of floats

The location or locations to place the patches in the collection along the zdir axis.

zdir{'x', 'y', 'z'}

Plane to plot patches orthogonal to. All patches must have the same direction. See get_dir_vector for a description of the values.

set_depthshade(depthshade)[source]#

Set whether depth shading is performed on collection members.

Parameters:
depthshadebool

Whether to shade the patches in order to give the appearance of depth.

set_sort_zpos(val)[source]#

Set the position to use for z-sorting.