Skip to content

Commit e33828f

Browse files
Move transform type checks and improve docs
1 parent ae7bc50 commit e33828f

File tree

2 files changed

+3
-14
lines changed

2 files changed

+3
-14
lines changed

lib/matplotlib/axes/_axes.py

+3-8
Original file line numberDiff line numberDiff line change
@@ -597,12 +597,9 @@ def invert(x):
597597
if not (location in ['top', 'bottom'] or isinstance(location, Real)):
598598
raise ValueError('secondary_xaxis location must be either '
599599
'a float or "top"/"bottom"')
600-
if not (isinstance(transform, mtransforms.Transform) or transform is None):
601-
raise ValueError('transform must be either an mtransforms.Transform '
602-
'or None')
603600

604601
secondary_ax = SecondaryAxis(self, 'x', location, functions,
605-
transform, **kwargs)
602+
transform, **kwargs)
606603
self.add_child_axes(secondary_ax)
607604
return secondary_ax
608605

@@ -649,11 +646,9 @@ def secondary_yaxis(self, location, *, functions=None, transform=None, **kwargs)
649646
if not (location in ['left', 'right'] or isinstance(location, Real)):
650647
raise ValueError('secondary_xaxis location must be either '
651648
'a float or "left"/"right"')
652-
if not (isinstance(transform, mtransforms.Transform) or transform is None):
653-
raise ValueError('transform must be either an mtransforms.Transform '
654-
'or None')
649+
655650
secondary_ax = SecondaryAxis(self, 'y', location, functions,
656-
transform, **kwargs)
651+
transform, **kwargs)
657652
self.add_child_axes(secondary_ax)
658653
return secondary_ax
659654

lib/matplotlib/axes/_secondary_axes.py

-6
Original file line numberDiff line numberDiff line change
@@ -285,12 +285,6 @@ def set_color(self, color):
285285
parent axes to put the new axes, 0.0 being the bottom (or left)
286286
and 1.0 being the top (or right).
287287
288-
transform : `.Transform`, optional
289-
An optional transform that can be passed. *location* will be
290-
placed relative to this transform (in the direction of the axis)
291-
rather than the parent's axis. i.e. a secondary x-axis will
292-
use the provided y transform and the x transform of the parent.
293-
294288
functions : 2-tuple of func, or Transform with an inverse
295289
296290
If a 2-tuple of functions, the user specifies the transform

0 commit comments

Comments
 (0)