Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ace57bc

Browse files
committed
dynamic mapping configuration for issue #28772
1 parent 3a0bc88 commit ace57bc

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed

lib/matplotlib/axis.py

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1099,15 +1099,27 @@ def _translate_tick_params(kw, reverse=False):
10991099
'length': 'size',
11001100
'direction': 'tickdir',
11011101
'rotation': 'labelrotation',
1102-
'left': 'tick1On',
1103-
'bottom': 'tick1On',
1104-
'right': 'tick2On',
1105-
'top': 'tick2On',
1106-
'labelleft': 'label1On',
1107-
'labelbottom': 'label1On',
1108-
'labelright': 'label2On',
1109-
'labeltop': 'label2On',
11101102
}
1103+
1104+
# axis specific mappings
1105+
axis_mappings = {
1106+
'x': {
1107+
'top': 'tick20n',
1108+
'bottom': 'tick10n',
1109+
'labelbottom': 'label10n',
1110+
'labeltop': 'label20n',
1111+
},
1112+
'y': {
1113+
'left': 'tick10n',
1114+
'right': 'tick20n',
1115+
'labelleft': 'label10n',
1116+
'labelright': 'label20n',
1117+
}
1118+
}
1119+
1120+
# merge shared keymap pais with axis specific map
1121+
keymap.update(axis_mappings.get(self.axis_name, {}))
1122+
11111123
if reverse:
11121124
kwtrans = {
11131125
oldkey: kw_.pop(newkey)

0 commit comments

Comments
 (0)