Thanks to visit codestin.com
Credit goes to github.com

Skip to content

FIX: double z-axis draw in mplot3D #4991

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

Merged
merged 2 commits into from
Aug 26, 2015
Merged
Changes from 1 commit
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
Prev Previous commit
FIX: jumping axes
The first time the Axes3D is drawn the x,y,z axis are drawn before the
aspect has been adjusted so they are wrong (the double zaxis the
previous commit removed was actually the correct one).

This copies the relevant code up to the Axes3D level.  This is not great
as there is code-duplication, but the 'correct' solution is to make the
Axes.draw method much more pluggable which is a very large job.
  • Loading branch information
tacaswell committed Aug 26, 2015
commit d874f13d6e774456b32572eab81261c803062d12
12 changes: 12 additions & 0 deletions lib/mpl_toolkits/mplot3d/axes3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,18 @@ def draw(self, renderer):
self.axesPatch.draw(renderer)
self._frameon = False

# first, set the aspect
# this is duplicated from `axes._base._AxesBase.draw`
# but must be called before any of the artist are drawn as
# it adjusts the view limits and the size of the bounding box
# of the axes
locator = self.get_axes_locator()
if locator:
pos = locator(self, renderer)
self.apply_aspect(pos)
else:
self.apply_aspect()

# add the projection matrix to the renderer
self.M = self.get_proj()
renderer.M = self.M
Expand Down