8000 fix: projection or polar · matplotlib/matplotlib@2feddad · GitHub
[go: up one dir, main page]

Skip to content

Commit 2feddad

Browse files
committed
fix: projection or polar
1 parent a71bef2 commit 2feddad

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/matplotlib/axes/_base.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4627,7 +4627,9 @@ def twinx(self, **kwargs):
46274627
For those who are 'picking' artists while using twinx, pick
46284628
events are only called for the artists in the top-most Axes.
46294629
"""
4630-
ax2 = self._make_twin_axes(sharex=self, axes_class=type(self), **kwargs)
4630+
if not {"projection", "polar", "axes_class"}.intersection(kwargs):
4631+
kwargs["axes_class"] = type(self)
4632+
ax2 = self._make_twin_axes(sharex=self, **kwargs)
46314633
ax2.yaxis.tick_right()
46324634
ax2.yaxis.set_label_position('right')
46334635
ax2.yaxis.set_offset_position('right')
@@ -4663,7 +4665,9 @@ def twiny(self, **kwargs):
46634665
For those who are 'picking' artists while using twiny, pick
46644666
events are only called for the artists in the top-most Axes.
46654667
"""
4666-
ax2 = self._make_twin_axes(sharey=self, axes_class=type(self), **kwargs)
4668+
if not {"projection", "polar", "axes_class"}.intersection(kwargs):
4669+
kwargs["axes_class"] = type(self)
4670+
ax2 = self._make_twin_axes(sharey=self, **kwargs)
46674671
ax2.xaxis.tick_top()
46684672
ax2.xaxis.set_label_position('top')
46694673
ax2.set_autoscaley_on(self.get_autoscaley_on())

0 commit comments

Comments
 (0)
0