8000 Optimize 3D display by AlexandreAbraham · Pull Request #6085 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Optimize 3D display #6085

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
Prev Previous commit
Next Next commit
Fix some failures
  • Loading branch information
AlexandreAbraham committed Jun 8, 2016
commit c4de0478db70fc22110128357421b0182bc2c2fd
4 changes: 2 additions & 2 deletions lib/mpl_toolkits/mplot3d/art3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ def do_3d_projection(self, renderer):
xys = np.reshape(xys.T, shape)
segments_2d = xys[:, :, 0:2]
LineCollection.set_segments(self, segments_2d)
minz = np.min(xys[:, :, 2])
minz = np.min(xys[:, :, 2]) if xys.size > 0 else 1e9
return minz

def draw(self, renderer, project=False):
Expand Down Expand Up @@ -262,7 +262,7 @@ def __init__(self, *args, **kwargs):

def set_3d_properties(self, verts, zs=0, zdir='z'):
verts = np.hstack([verts, np.ones((len(verts), 1)) * zs])
self._segment3d = juggle_axes_vec(verts, zdir)
self._segment3d = juggle_axes_vec(verts.T, zdir)
self._facecolor3d = Patch.get_facecolor(self)

def get_path(self):
Expand Down
6 changes: 3 additions & 3 deletions lib/mpl_toolkits/mplot3d/axes3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -2340,11 +2340,11 @@ def bar(self, left, height, zs=0, zdir='z', *args, **kwargs):
if 'alpha' in kwargs:
p.set_alpha(kwargs['alpha'])

verts = np.hstack([verts, np.asarray(verts_zs)[:, np.newaxis]])
verts = np.vstack([list(zip(*verts)), verts_zs])

xs, ys, verts_zs = art3d.juggle_axes_vec(verts.T, zdir)
xs, ys, verts_zs = art3d.juggle_axes_vec(verts, zdir)
self.auto_scale_xyz(xs, ys, verts_zs, had_data)

return patches

def bar3d(self, x, y, z, dx, dy, dz, color=None,
Expand Down
0