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 bug in PathPatch
  • Loading branch information
AlexandreAbraham committed Sep 20, 2016
commit bb948bb619b990003670b1afc22c80045e6a14ac
3 changes: 2 additions & 1 deletion lib/mpl_toolkits/mplot3d/art3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ def set_3d_properties(self, path, zs=0, zdir='z'):

def do_3d_projection(self, renderer):
# pad ones
s = np.vstack(self._segments3d, np.ones(self._segments3d.shape[1]))
s = np.vstack(self._segment3d, np.ones(self._segment3d.shape[1]))
Copy link
Member
@Kojoley Kojoley Sep 20, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

np.vstack accepts only one argument.
You have here s = np.vstack([self._segment3d, np.ones(self._segment3d.shape[1])]) in a similar method above.

If do_3d_projection method is the same in multiple places except the single line I think it is better not to copy-paste it, but extract it to a general private method of Patch3D class.

vxyzis = proj3d.proj_transform_vec_clip(s, renderer.M)
self._path2d = mpath.Path(vxyzis[0:2].T, self._code3d)
# FIXME: coloring
Expand Down Expand Up @@ -349,6 +349,7 @@ def pathpatch_2d_to_3d(pathpatch, z=0, zdir='z'):
pathpatch.__class__ = PathPatch3D
pathpatch.set_3d_properties(mpath, z, zdir)


class Patch3DCollection(PatchCollection):
'''
A collection of 3D patches.
Expand Down
0