8000 Allow rasterization for 3D plots by ImportanceOfBeingErnest · Pull Request #10013 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Allow rasterization for 3D plots #10013

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions lib/mpl_toolkits/mplot3d/art3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from matplotlib.patches import Patch
from matplotlib.colors import Normalize
from matplotlib.cbook import iterable
from matplotlib.artist import allow_rasterization

import warnings
import numpy as np
Expand Down Expand Up @@ -82,6 +83,7 @@ def set_3d_properties(self, z=0, zdir='z'):
self._dir_vec = get_dir_vector(zdir)
self.stale = True

@allow_rasterization
def draw(self, renderer):
proj = proj3d.proj_trans_points([self._position3d, \
self._position3d + self._dir_vec], renderer.M)
Expand Down Expand Up @@ -130,6 +132,7 @@ def set_3d_properties(self, zs=0, zdir='z'):
self._verts3d = juggle_axes(xs, ys, zs, zdir)
self.stale = True

@allow_rasterization
def draw(self, renderer):
xs3d, ys3d, zs3d = self._verts3d
xs, ys, zs = proj3d.proj_transform(xs3d, ys3d, zs3d, renderer.M)
Expand Down Expand Up @@ -235,6 +238,7 @@ def do_3d_projection(self, renderer):
minz = min(minz, min(zs))
return minz

@allow_rasterization
def draw(self, renderer, project=False):
if project:
self.do_3d_projection(renderer)
Expand Down Expand Up @@ -280,6 +284,7 @@ def do_3d_projection(self, renderer):
self._facecolor2d = self._facecolor3d
return min(vzs)

@allow_rasterization
655C def draw(self, renderer):
Patch.draw(self, renderer)

Expand Down Expand Up @@ -706,6 +711,7 @@ def get_edgecolors(self):
return self._edgecolors2d
get_edgecolor = get_edgecolors

@allow_rasterization
def draw(self, renderer):
return Collection.draw(self, renderer)

Expand Down
0