Skip to content

Commit c194881

Browse files
committed
fix: projection or polar
1 parent 033c4f8 commit c194881

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
@@ -4621,7 +4621,9 @@ def twinx(self, **kwargs):
46214621
For those who are 'picking' artists while using twinx, pick
46224622
events are only called for the artists in the top-most Axes.
46234623
"""
4624-
ax2 = self._make_twin_axes(sharex=self, axes_class=type(self), **kwargs)
4624+
if not {"projection", "polar", "axes_class"}.intersection(kwargs):
4625+
kwargs["axes_class"] = type(self)
4626+
ax2 = self._make_twin_axes(sharex=self, **kwargs)
46254627
ax2.yaxis.tick_right()
46264628
ax2.yaxis.set_label_position('right')
46274629
ax2.yaxis.set_offset_position('right')
@@ -4657,7 +4659,9 @@ def twiny(self, **kwargs):
46574659
For those who are 'picking' artists while using twiny, pick
46584660
events are only called for the artists in the top-most Axes.
46594661
"""
4660-
ax2 = self._make_twin_axes(sharey=self, axes_class=type(self), **kwargs)
4662+
if not {"projection", "polar", "axes_class"}.intersection(kwargs):
4663+
kwargs["axes_class"] = type(self)
4664+
ax2 = self._make_twin_axes(sharey=self, **kwargs)
46614665
ax2.xaxis.tick_top()
46624666
ax2.xaxis.set_label_position('top')
46634667
ax2.set_autoscaley_on(self.get_autoscaley_on())

0 commit comments

Comments
 (0)