Skip to content

Commit bae8511

Browse files
committed
Add 'rotation' label keywords, make horizontal labels default
1 parent 7c43ee9 commit bae8511

File tree

2 files changed

+43
-23
lines changed

2 files changed

+43
-23
lines changed

proplot/axes/base.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -706,9 +706,10 @@ def _update_super(self, suptitle, **kwargs):
706706
for side, labels in kwargs.items():
707707
kw = {} if ignore else rc.fill(
708708
{
709+
'color': side + 'label.color',
710+
'rotation': side + 'label.rotation',
709711
'fontsize': side + 'label.size',
710712
'weight': side + 'label.weight',
711-
'color': side + 'label.color',
712713
'fontfamily': 'font.family'
713714
},
714715
context=True,

proplot/internals/rcsetup.py

Lines changed: 41 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -342,8 +342,7 @@
342342
),
343343
'formatter.timerotation': (
344344
90,
345-
'Float, indicates the default *x* axis tick label rotation '
346-
'for datetime tick labels.'
345+
'Float, indicates the rotation in degrees for *x* axis datetime tick labels.'
347346
),
348347
'formatter.zerotrim': (
349348
True,
@@ -403,6 +402,16 @@
403402
'black',
404403
'Font color for column labels on the bottom of the figure.'
405404
),
405+
'bottomlabel.pad': (
406+
'0.3em',
407+
'Padding between axes content and column labels on the bottom of the figure. '
408+
+ _addendum_units
409+
),
410+
'bottomlabel.rotation': (
411+
0,
412+
'Float, indicates the rotation in degrees for column labels '
413+
'at the bottom of the figure.'
414+
),
406415
'bottomlabel.size': (
407416
TITLESIZE,
408417
'Font size for column labels on the bottom of the figure.'
@@ -411,11 +420,6 @@
411420
'bold',
412421
'Font weight for column labels on the bottom of the figure.'
413422
),
414-
'bottomlabel.pad': (
415-
'0.3em',
416-
'Padding between axes content and column labels on the bottom of the figure. '
417-
+ _addendum_units
418-
),
419423

420424
# Special cartopy settings
421425
'cartopy.autoextent': (
@@ -696,6 +700,16 @@
696700
'black',
697701
'Font color for row labels on the left-hand side.'
698702
),
703+
'leftlabel.pad': (
704+
'0.6em',
705+
'Padding between axes content and row labels on the left-hand side. '
706+
+ _addendum_units
707+
),
708+
'leftlabel.rotation': (
709+
90,
710+
'Float, indicates the rotation in degrees for row labels '
711+
'on the left-hand side.'
712+
),
699713
'leftlabel.size': (
700714
TITLESIZE,
701715
'Font size for row labels on the left-hand side.'
@@ -704,11 +718,6 @@
704718
'bold',
705719
'Font weight for row labels on the left-hand side.'
706720
),
707-
'leftlabel.pad': (
708-
'0.6em',
709-
'Padding between axes content and row labels on the left-hand side. '
710-
+ _addendum_units
711-
),
712721

713722
# Edge width bulk setting
714723
'linewidth': (
@@ -765,6 +774,16 @@
765774
'black',
766775
'Font color for row labels on the right-hand side.'
767776
),
777+
'rightlabel.pad': (
778+
'0.6em',
779+
'Padding between axes content and row labels on the right-hand side. '
780+
+ _addendum_units
781+
),
782+
'rightlabel.rotation': (
783+
90,
784+
'Float, indicates the rotation in degrees for row labels '
785+
'on the right-hand side.'
786+
),
768787
'rightlabel.size': (
769788
TITLESIZE,
770789
'Font size for row labels on the right-hand side.'
@@ -773,11 +792,6 @@
773792
'bold',
774793
'Font weight for row labels on the right-hand side.'
775794
),
776-
'rightlabel.pad': (
777-
'0.6em',
778-
'Padding between axes content and row labels on the right-hand side. '
779-
+ _addendum_units
780-
),
781795

782796
# River lines
783797
'rivers': (
@@ -985,6 +999,16 @@
985999
'black',
9861000
'Font color for column labels on the top of the figure.'
9871001
),
1002+
'toplabel.pad': (
1003+
'0.3em',
1004+
'Padding between axes content and column labels on the top of the figure. '
1005+
+ _addendum_units
1006+
),
1007+
'toplabel.rotation': (
1008+
0,
1009+
'Float, indicates the rotation in degrees for column labels '
1010+
'at the top of the figure.'
1011+
),
9881012
'toplabel.size': (
9891013
TITLESIZE,
9901014
'Font size for column labels on the top of the figure.'
@@ -993,11 +1017,6 @@
9931017
'bold',
9941018
'Font weight for column labels on the top of the figure.'
9951019
),
996-
'toplabel.pad': (
997-
'0.3em',
998-
'Padding between axes content and column labels on the top of the figure. '
999-
+ _addendum_units
1000-
),
10011020
}
10021021

10031022
# Child settings -- changing the parent changes all the children, but changing

0 commit comments

Comments
 (0)