erlab.plotting.plot3d

Extensions to mplot3d.

Functions

pathpatch_translate(pathpatch, delta)

Translate a converted 3D path patch in place.

set_3d_properties(self, verts[, zs, zdir])

Store two-dimensional vertices in a three-dimensional direction.

to_3d(pathpatch[, z, zdir, delta])

Convert a two-dimensional path patch to a translated 3D patch.

Classes

FancyArrow3D(x, y, z, dx, dy, dz, **kwargs)

A Matplotlib arrow defined by a point and a vector in three dimensions.

FancyArrowPatch3D(posA, posB, *args, **kwargs)

A Matplotlib arrow patch between two points in three dimensions.

class erlab.plotting.plot3d.FancyArrow3D(x, y, z, dx, dy, dz, **kwargs)[source]

Bases: FancyArrow

A Matplotlib arrow defined by a point and a vector in three dimensions.

Parameters:
  • x – Coordinates of the arrow tail in data coordinates.

  • y – Coordinates of the arrow tail in data coordinates.

  • z – Coordinates of the arrow tail in data coordinates.

  • dx – Components of the arrow vector in data-coordinate units.

  • dy – Components of the arrow vector in data-coordinate units.

  • dz – Components of the arrow vector in data-coordinate units.

  • **kwargs – Additional keyword arguments passed to matplotlib.patches.FancyArrow.

Notes

Add the arrow to a three-dimensional Matplotlib axes. Its two-dimensional path is updated from the current projection when Matplotlib draws it.

do_3d_projection(renderer=None)[source]
set(*, agg_filter=<UNSET>, alpha=<UNSET>, animated=<UNSET>, antialiased=<UNSET>, capstyle=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, closed=<UNSET>, color=<UNSET>, data=<UNSET>, edgecolor=<UNSET>, edgegapcolor=<UNSET>, facecolor=<UNSET>, fill=<UNSET>, gid=<UNSET>, hatch=<UNSET>, hatch_linewidth=<UNSET>, hatchcolor=<UNSET>, in_layout=<UNSET>, joinstyle=<UNSET>, label=<UNSET>, linestyle=<UNSET>, linewidth=<UNSET>, mouseover=<UNSET>, path_effects=<UNSET>, picker=<UNSET>, rasterized=<UNSET>, sketch_params=<UNSET>, snap=<UNSET>, transform=<UNSET>, url=<UNSET>, visible=<UNSET>, xy=<UNSET>, zorder=<UNSET>)[source]
class erlab.plotting.plot3d.FancyArrowPatch3D(posA, posB, *args, **kwargs)[source]

Bases: FancyArrowPatch

A Matplotlib arrow patch between two points in three dimensions.

Parameters:

Notes

Add the patch to a three-dimensional Matplotlib axes. Its two-dimensional path is updated from the current projection when Matplotlib draws it.

do_3d_projection(renderer=None)[source]
set(*, agg_filter=<UNSET>, alpha=<UNSET>, animated=<UNSET>, antialiased=<UNSET>, arrowstyle=<UNSET>, capstyle=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, color=<UNSET>, connectionstyle=<UNSET>, edgecolor=<UNSET>, edgegapcolor=<UNSET>, facecolor=<UNSET>, fill=<UNSET>, gid=<UNSET>, hatch=<UNSET>, hatch_linewidth=<UNSET>, hatchcolor=<UNSET>, in_layout=<UNSET>, joinstyle=<UNSET>, label=<UNSET>, linestyle=<UNSET>, linewidth=<UNSET>, mouseover=<UNSET>, mutation_aspect=<UNSET>, mutation_scale=<UNSET>, patchA=<UNSET>, patchB=<UNSET>, path_effects=<UNSET>, picker=<UNSET>, positions=<UNSET>, rasterized=<UNSET>, sketch_params=<UNSET>, snap=<UNSET>, transform=<UNSET>, url=<UNSET>, visible=<UNSET>, zorder=<UNSET>)[source]
erlab.plotting.plot3d.set_3d_properties(self, verts, zs=0, zdir='z')[source]

Store two-dimensional vertices in a three-dimensional direction.

Parameters:
  • self – Patch-like object on which to store the transformed vertices.

  • verts – Sequence of two-dimensional vertices.

  • zs (default: 0) – Scalar or one value per vertex along zdir.

  • zdir (default: 'z') – Direction normal to the original vertices, as accepted by Matplotlib’s 3D conversion utilities.

Notes

This low-level helper modifies self._segment3d in place.

erlab.plotting.plot3d.pathpatch_translate(pathpatch, delta)[source]

Translate a converted 3D path patch in place.

Parameters:
  • pathpatch – Three-dimensional path patch produced by Matplotlib’s path-patch conversion.

  • delta – Three-component translation in data-coordinate units.

erlab.plotting.plot3d.to_3d(pathpatch, z=0.0, zdir='z', delta=(0, 0, 0))[source]

Convert a two-dimensional path patch to a translated 3D patch.

Parameters:
  • pathpatch – Matplotlib path patch attached to a three-dimensional axes. The patch is converted in place.

  • z (default: 0.0) – Position along zdir, in data-coordinate units.

  • zdir (default: 'z') – Direction normal to the original two-dimensional patch. It accepts the values supported by mpl_toolkits.mplot3d.art3d.pathpatch_2d_to_3d().

  • delta (default: (0, 0, 0)) – Three-component translation applied after conversion, in data-coordinate units.

Returns:

mpl_toolkits.mplot3d.art3d.Patch3D – The same patch object after in-place conversion and translation.

Raises:

ValueError – If pathpatch is not attached to a three-dimensional axes.