Skip to content
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

FIX: double z-axis draw in mplot3D #4991

Merged
merged 2 commits into from Aug 26, 2015

Conversation

tacaswell
Copy link
Member

When we moved Axes.draw to use Axes.get_children to get the initial
list of artists to draw the zaxis was now in this list (where as it was
not previously). The 3D axes use _axison = False as Axes3D manages
the drawing of the axis objects (which must happen before any of the
artists). In Axes.draw there is a special case to remove the x and y
axis from the draw list if not _axison.

This change is to add a _get_axis_list method to the Axes base class
and override this in the Axes3D. This list is looped over to remove
all of the axis objects that when the axises should not be shown.

Closes #4971

attn @WeatherGod @jenshnielsen

When we moved `Axes.draw` to use `Axes.get_children` to get the initial
list of artists to draw the zaxis was now in this list (where as it was
not previously).  The 3D axes use `_axison = False` as `Axes3D` manages
the drawing of the axis objects (which must happen before any of the
artists). In `Axes.draw` there is a special case to remove the x and y
axis from the draw list if `not _axison`.

This change is to add a `_get_axis_list` method to the `Axes` base class
and override this in the `Axes3D`.  This list is looped over to remove
all of the `axis` objects that when the axises should not be shown.

Closes matplotlib#4971
@tacaswell tacaswell added this to the next point release milestone Aug 26, 2015
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.
@WeatherGod
Copy link
Member

Wow, I hadn't fully appreciated the implications of _axison and how things get drawn (or not). This might explain some of my confusion I was encountering as I attempted to fix the log-scaling problem (I had different behaviors for x/y axis and z axis). The differing behaviors kept leading me down dead ends. Maybe I can revisit the problem now? (Note: still would be a huge effort and should not hold up any releases, of course).

WeatherGod added a commit that referenced this pull request Aug 26, 2015
FIX: double z-axis draw in mplot3D
@WeatherGod WeatherGod merged commit eb42cfc into matplotlib:master Aug 26, 2015
@jenshnielsen
Copy link
Member

Thanks

@tacaswell tacaswell deleted the fix_double_zaxis branch August 26, 2015 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants