@@ -84,9 +84,15 @@ def get_tick_iterators(self, axes):
84
84
return iter_major, iter_minor
85
85
"""
86
86
87
+ def __init__ (self , nth_coord ):
88
+ self .nth_coord = nth_coord
89
+
87
90
def update_lim (self , axes ):
88
91
pass
89
92
93
+ def get_nth_coord (self ):
94
+ return self .nth_coord
95
+
90
96
def _to_xy (self , values , const ):
91
97
"""
92
98
Create a (*values.shape, 2)-shape array representing (x, y) pairs.
@@ -115,17 +121,13 @@ class _FixedAxisArtistHelperBase(_AxisArtistHelperBase):
115
121
@_api .delete_parameter ("3.9" , "nth_coord" )
116
122
def __init__ (self , loc , nth_coord = None ):
117
123
"""``nth_coord = 0``: x-axis; ``nth_coord = 1``: y-axis."""
118
- self . nth_coord = _api .check_getitem (
119
- {"bottom" : 0 , "top" : 0 , "left" : 1 , "right" : 1 }, loc = loc )
124
+ super (). __init__ ( _api .check_getitem (
125
+ {"bottom" : 0 , "top" : 0 , "left" : 1 , "right" : 1 }, loc = loc ))
120
126
self ._loc = loc
121
127
self ._pos = {"bottom" : 0 , "top" : 1 , "left" : 0 , "right" : 1 }[loc ]
122
- super ().__init__ ()
123
128
# axis line in transAxes
124
129
self ._path = Path (self ._to_xy ((0 , 1 ), const = self ._pos ))
125
130
126
- def get_nth_coord (self ):
127
- return self .nth_coord
128
-
129
131
# LINE
130
132
131
133
def get_line (self , axes ):
@@ -158,12 +160,8 @@ def get_tick_transform(self, axes):
158
160
159
161
class _FloatingAxisArtistHelperBase (_AxisArtistHelperBase ):
160
162
def __init__ (self , nth_coord , value ):
161
- self .nth_coord = nth_coord
162
163
self ._value = value
163
- super ().__init__ ()
164
-
165
- def get_nth_coord (self ):
166
- return self .nth_coord
164
+ super ().__init__ (nth_coord )
167
165
168
166
def get_line (self , axes ):
169
167
raise RuntimeError ("get_line method should be defined by the derived class" )
0 commit comments