forked from proplot-dev/proplot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdefaults.py
More file actions
1522 lines (1478 loc) · 48.7 KB
/
Copy pathdefaults.py
File metadata and controls
1522 lines (1478 loc) · 48.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/usr/bin/env python3
"""
Defaults and definitions for global settings.
"""
import functools
from matplotlib import rcParamsDefault as _rc_matplotlib_default
from . import validate
# Initial synced properties
# NOTE: Important that linewidth is less than matplotlib default of 0.8. In general
# want the axes lines to look about as thick as text.
# NOTE: Important that default values are equivalent to the *validated* values
# used in the RcParams dictionaries. Otherwise _user_settings() detects changes.
# NOTE: We could just leave some settings empty and leave it up to Configurator
# to sync them when proplot is imported... but we also sync them here so that we
# can simply compare any Configurator state to these dictionaries and use save()
# to only save the settings changed by the user.
BLACK = 'black'
CYCLE = 'colorblind'
CMAPCYC = 'twilight'
CMAPDIV = 'BuRd'
CMAPSEQ = 'Fire'
CMAPCAT = 'colorblind10'
DIVERGING = 'div'
FRAMEALPHA = 0.8 # legend and colorbar
FONTNAME = 'sans-serif'
FONTSIZE = 9.0
GRIDALPHA = 0.1
GRIDBELOW = 'line'
GRIDPAD = 3.0
GRIDRATIO = 0.5 # differentiated from major by half size reduction
GRIDSTYLE = '-'
LABELPAD = 4.0 # default is 4.0, previously was 3.0
LARGESIZE = 'med-large'
LINEWIDTH = 0.6
MARGIN = 0.05
MATHTEXT = False
SMALLSIZE = 'medium'
TICKDIR = 'out'
TICKLEN = 4.0
TICKLENRATIO = 0.5 # very noticeable length reduction
TICKMINOR = True
TICKPAD = 2.0
TICKWIDTHRATIO = 0.8 # very slight width reduction
TITLEPAD = 5.0 # default is 6.0, previously was 3.0
WHITE = 'white'
ZLINES = 2 # default zorder for lines
ZPATCHES = 1
# TeX Gyre fonts used in proplot
# NOTE: This preserves the matplotlib font priority lists after the tex gyre fonts but
# unlike matplotlib they are alphabetized. Proplot guarantees first fonts in the list
# are present so really the only purpose of the remaining entries is to give users ideas
# for other fonts to try. Plus the order used in matplotlib seemed pretty arbitrary.
FONTS_CURSIVE = [
'TeX Gyre Chorus', # Chancery lookalike
'Apple Chancery',
'Felipa',
'Sand',
'Script MT',
'Textile',
'Zapf Chancery',
'cursive',
]
FONTS_FANTASY = [
'TeX Gyre Adventor', # Avant Garde lookalike
'Avant Garde',
'Charcoal',
'Chicago',
'Comic Sans MS',
'Futura',
'Humor Sans',
'Impact',
'Optima',
'Western',
'xkcd',
'fantasy',
]
FONTS_MONOSPACE = [
'TeX Gyre Cursor', # Courier lookalike
'DejaVu Sans Mono',
'Bitstream Vera Sans Mono',
'Computer Modern Typewriter',
'Andale Mono',
'Courier New',
'Courier',
'Fixed',
'Nimbus Mono L',
'Terminal',
'monospace',
]
FONTS_SANSSERIF = [
'TeX Gyre Heros', # Helvetica lookalike
'DejaVu Sans',
'Bitstream Vera Sans',
'Computer Modern Sans Serif',
'Arial',
'Avenir',
'Fira Math',
'Fira Sans',
'Frutiger',
'Geneva',
'Gill Sans',
'Helvetica',
'Lucid',
'Lucida Grande',
'Myriad Pro',
'Noto Sans',
'Roboto',
'Source Sans Pro',
'Tahoma',
'Trebuchet MS',
'Ubuntu',
'Univers',
'Verdana',
'sans-serif',
]
FONTS_SERIF = [
'TeX Gyre Schola', # Century lookalike
'TeX Gyre Bonum', # Bookman lookalike
'TeX Gyre Termes', # Times New Roman lookalike
'TeX Gyre Pagella', # Palatino lookalike
'DejaVu Serif',
'Bitstream Vera Serif',
'Computer Modern Roman',
'Bookman',
'Century Schoolbook L',
'Charter',
'ITC Bookman',
'New Century Schoolbook',
'Nimbus Roman No9 L',
'Noto Serif',
'Palatino',
'Source Serif Pro',
'Times New Roman',
'Times',
'Utopia',
'serif',
]
# Proplot overrides of matplotlib default style
# WARNING: Critical to include every parameter here that can be changed by a
# "meta" setting so that _get_default_param returns the value imposed by *proplot*
# and so that "changed" settings detected by Configurator.save are correct.
_rc_matplotlib_override = {
'axes.axisbelow': GRIDBELOW,
'axes.formatter.use_mathtext': MATHTEXT,
'axes.grid': True, # lightweight default grid
'axes.grid.which': 'major', # major ticks only
'axes.edgecolor': BLACK,
'axes.labelcolor': BLACK,
'axes.labelpad': LABELPAD, # more compact
'axes.labelsize': SMALLSIZE,
'axes.labelweight': 'normal',
'axes.linewidth': LINEWIDTH,
'axes.titlepad': TITLEPAD, # more compact
'axes.titlesize': LARGESIZE,
'axes.titleweight': 'normal',
'axes.xmargin': MARGIN,
'axes.ymargin': MARGIN,
'errorbar.capsize': 3.0,
'figure.autolayout': False,
'figure.figsize': (4.0, 4.0), # interactive backends
'figure.dpi': 100,
'figure.facecolor': '#f4f4f4', # similar to MATLAB interface
'figure.titlesize': LARGESIZE, # differentiate from axes titles
'figure.titleweight': 'bold', # differentiate from axes titles
'font.serif': FONTS_SERIF,
'font.sans-serif': FONTS_SANSSERIF,
'font.cursive': FONTS_CURSIVE,
'font.fantasy': FONTS_FANTASY,
'font.monospace': FONTS_MONOSPACE,
'font.family': FONTNAME,
'font.size': FONTSIZE,
'grid.alpha': GRIDALPHA, # lightweight unobtrusive gridlines
'grid.color': BLACK, # lightweight unobtrusive gridlines
'grid.linestyle': GRIDSTYLE,
'grid.linewidth': LINEWIDTH,
'hatch.color': BLACK,
'hatch.linewidth': LINEWIDTH,
'image.cmap': CMAPSEQ,
'lines.linestyle': '-',
'lines.linewidth': 1.5,
'lines.markersize': 6.0,
'legend.borderaxespad': 0, # i.e. flush against edge
'legend.borderpad': 0.5, # a bit more roomy
'legend.columnspacing': 1.5, # a bit more compact (see handletextpad)
'legend.edgecolor': BLACK,
'legend.facecolor': WHITE,
'legend.fancybox': False, # i.e. BboxStyle 'square' not 'round'
'legend.fontsize': SMALLSIZE,
'legend.framealpha': FRAMEALPHA,
'legend.handleheight': 1.0, # default is 0.7
'legend.handlelength': 2.0, # default is 2.0
'legend.handletextpad': 0.5, # a bit more compact (see columnspacing)
'mathtext.default': 'it',
'mathtext.fontset': 'custom',
'mathtext.bf': 'regular:bold', # custom settings implemented above
'mathtext.cal': 'cursive',
'mathtext.it': 'regular:italic',
'mathtext.rm': 'regular',
'mathtext.sf': 'regular',
'mathtext.tt': 'monospace',
'patch.facecolor': 'C0',
'patch.linewidth': LINEWIDTH,
'savefig.bbox': None, # do not use 'tight'
'savefig.directory': '', # use the working directory
'savefig.dpi': 1000, # use academic journal recommendation
'savefig.facecolor': WHITE, # use white instead of 'auto'
'savefig.format': 'pdf', # use vector graphics
'savefig.transparent': False,
'xtick.color': BLACK,
'xtick.direction': TICKDIR,
'xtick.labelsize': SMALLSIZE,
'xtick.major.pad': TICKPAD,
'xtick.major.size': TICKLEN,
'xtick.major.width': LINEWIDTH,
'xtick.minor.pad': TICKPAD,
'xtick.minor.size': TICKLEN * TICKLENRATIO,
'xtick.minor.width': LINEWIDTH * TICKWIDTHRATIO,
'xtick.minor.visible': TICKMINOR,
'ytick.color': BLACK,
'ytick.direction': TICKDIR,
'ytick.labelsize': SMALLSIZE,
'ytick.major.pad': TICKPAD,
'ytick.major.size': TICKLEN,
'ytick.major.width': LINEWIDTH,
'ytick.minor.pad': TICKPAD,
'ytick.minor.size': TICKLEN * TICKLENRATIO,
'ytick.minor.width': LINEWIDTH * TICKWIDTHRATIO,
'ytick.minor.visible': TICKMINOR,
}
# Proplot pseudo-setting defaults, validators, and descriptions
# NOTE: Cannot have different a-b-c and title paddings because they are both controlled
# by matplotlib's _title_offset_trans transform and want to keep them aligned anyway.
_addendum_em = ' Interpreted by `~proplot.utils.units`. Numeric units are em-widths.'
_addendum_in = ' Interpreted by `~proplot.utils.units`. Numeric units are inches.'
_addendum_pt = ' Interpreted by `~proplot.utils.units`. Numeric units are points.'
_addendum_rotation = " Must be 'vertical', 'horizontal', or a float indicating degrees."
_addendum_font = (
' Must be a :ref:`relative font size <font_table>` or unit string '
'interpreted by `~proplot.utils.units`. Numeric units are points.'
)
_rc_proplot_definition = {
# Global style
'style': (
None,
validate._validate_style,
'The default `style name or stylesheet filename '
'<https://matplotlib.org/stable/gallery/style_sheets/style_sheets_reference.html>`__. ' # noqa: E501
'This can be a name listed in `matplotlib.style.available`, a name listed '
'in the `~proplot.config.use_style` :ref:`table <style_table>`, or a valid '
'filename with settings adhering to ``matplotlibrc`` syntax. Use ``None`` to '
"revert to the initial style settings after importing proplot or ``'default'`` "
'to revert to the default matplotlib settings without proplot overrides.'
),
# A-b-c labels
'abc': (
False,
validate._validate_abc,
'If ``False`` then a-b-c labels are disabled. If ``True`` the default label '
'style ``a`` is used. If string this indicates the style and must contain the '
"character ``a`` or ``A``, for example ``'a.'`` or ``'(A)'``."
),
'abc.border': (
True,
validate._validate_bool,
'Whether to draw a white border around a-b-c labels '
'when :rcraw:`abc.loc` is inside the axes.'
),
'abc.borderwidth': (
1.5,
validate._validate_pt,
'Width of the white border around a-b-c labels.'
),
'abc.bbox': (
False,
validate._validate_bool,
'Whether to draw semi-transparent bounding boxes around a-b-c labels '
'when :rcraw:`abc.loc` is inside the axes.'
),
'abc.bboxcolor': (
WHITE,
validate._validate_color,
'a-b-c label bounding box color.'
),
'abc.bboxstyle': (
'square',
validate._validate_boxstyle,
'a-b-c label bounding box style.'
),
'abc.bboxalpha': (
0.5,
validate._validate_float,
'a-b-c label bounding box opacity.'
),
'abc.bboxpad': (
None,
validate._validate_or_none(validate._validate_pt),
'Padding for the a-b-c label bounding box. By default this is scaled '
'to make the box flush against the subplot edge.' + _addendum_pt
),
'abc.color': (
BLACK,
validate._validate_color,
'a-b-c label color.'
),
'abc.loc': (
'left', # left side above the axes
functools.partial(validate._validate_loc, mode='text'),
'a-b-c label position. '
'For options see the :ref:`location table <title_table>`.'
),
'abc.size': (
LARGESIZE,
validate._validate_fontsize,
'a-b-c label font size.' + _addendum_font
),
'abc.titlepad': (
LABELPAD,
validate._validate_pt,
'Padding separating the title and a-b-c label when in the same location.'
+ _addendum_pt
),
'abc.weight': (
'bold',
validate._validate_fontweight,
'a-b-c label font weight.'
),
# Autoformatting
'autoformat': (
True,
validate._validate_bool,
'Whether to automatically apply labels from `pandas.Series`, '
'`pandas.DataFrame`, and `xarray.DataArray` objects passed to '
'plotting functions. See also :rcraw:`unitformat`.'
),
# Axes additions
'axes.alpha': (
None,
validate._validate_or_none(validate._validate_float),
'Opacity of the background axes patch.'
),
'axes.inbounds': (
True,
validate._validate_bool,
'Whether to exclude out-of-bounds data when determining the default *y* (*x*) '
'axis limits and the *x* (*y*) axis limits have been locked.'
),
'axes.margin': (
MARGIN,
validate._validate_float,
'The fractional *x* and *y* axis margins when limits are unset.'
),
# Country borders
'borders': (
False,
validate._validate_bool,
'Toggles country border lines on and off.'
),
'borders.alpha': (
None,
validate._validate_or_none(validate._validate_float),
'Opacity for country border lines.',
),
'borders.color': (
BLACK,
validate._validate_color,
'Line color for country border lines.'
),
'borders.linewidth': (
LINEWIDTH,
validate._validate_pt,
'Line width for country border lines.'
),
'borders.zorder': (
ZLINES,
validate._validate_float,
'Z-order for country border lines.'
),
# Bottom subplot labels
'bottomlabel.color': (
BLACK,
validate._validate_color,
'Font color for column labels on the bottom of the figure.'
),
'bottomlabel.pad': (
TITLEPAD,
validate._validate_pt,
'Padding between axes content and column labels on the bottom of the figure.'
+ _addendum_pt
),
'bottomlabel.rotation': (
'horizontal',
validate._validate_rotation,
'Rotation for column labels at the bottom of the figure.' + _addendum_rotation
),
'bottomlabel.size': (
LARGESIZE,
validate._validate_fontsize,
'Font size for column labels on the bottom of the figure.' + _addendum_font
),
'bottomlabel.weight': (
'bold',
validate._validate_fontweight,
'Font weight for column labels on the bottom of the figure.'
),
# Coastlines
'coast': (
False,
validate._validate_bool,
'Toggles coastline lines on and off.'
),
'coast.alpha': (
None,
validate._validate_or_none(validate._validate_float),
'Opacity for coast lines',
),
'coast.color': (
BLACK,
validate._validate_color,
'Line color for coast lines.'
),
'coast.linewidth': (
LINEWIDTH,
validate._validate_pt,
'Line width for coast lines.'
),
'coast.zorder': (
ZLINES,
validate._validate_float,
'Z-order for coast lines.'
),
# Colorbars
'colorbar.edgecolor': (
BLACK,
validate._validate_color,
'Color for the inset colorbar frame edge.'
),
'colorbar.extend': (
1.3,
validate._validate_em,
'Length of rectangular or triangular "extensions" for panel colorbars.'
+ _addendum_em
),
'colorbar.fancybox': (
False,
validate._validate_bool,
'Whether to use a "fancy" round bounding box for inset colorbar frames.'
),
'colorbar.framealpha': (
FRAMEALPHA,
validate._validate_float,
'Opacity for inset colorbar frames.'
),
'colorbar.facecolor': (
WHITE,
validate._validate_color,
'Color for the inset colorbar frame.'
),
'colorbar.frameon': (
True,
validate._validate_bool,
'Whether to draw a frame behind inset colorbars.'
),
'colorbar.grid': (
False,
validate._validate_bool,
'Whether to draw borders between each level of the colorbar.'
),
'colorbar.insetextend': (
0.9,
validate._validate_em,
'Length of rectangular or triangular "extensions" for inset colorbars.'
+ _addendum_em
),
'colorbar.insetlength': (
8,
validate._validate_em,
'Length of inset colorbars.' + _addendum_em
),
'colorbar.insetpad': (
0.7,
validate._validate_em,
'Padding between axes edge and inset colorbars.' + _addendum_em
),
'colorbar.insetwidth': (
1.2,
validate._validate_em,
'Width of inset colorbars.' + _addendum_em
),
'colorbar.length': (
1,
validate._validate_em,
'Length of outer colorbars.'
),
'colorbar.loc': (
'right',
functools.partial(validate._validate_loc, mode='colorbar'),
'Inset colorbar location. '
'For options see the :ref:`location table <colorbar_table>`.'
),
'colorbar.width': (
0.2,
validate._validate_in,
'Width of outer colorbars.' + _addendum_in
),
'colorbar.rasterized': (
False,
validate._validate_bool,
'Whether to use rasterization for colorbar solids.'
),
'colorbar.shadow': (
False,
validate._validate_bool,
'Whether to add a shadow underneath inset colorbar frames.'
),
# Color cycle additions
'cycle': (
CYCLE,
validate._validate_cmap('discrete'),
'Name of the color cycle assigned to :rcraw:`axes.prop_cycle`.'
),
# Colormap additions
'cmap': (
CMAPSEQ,
validate._validate_cmap('continuous'),
'Alias for :rcraw:`cmap.sequential` and :rcraw:`image.cmap`.'
),
'cmap.autodiverging': (
True,
validate._validate_bool,
'Whether to automatically apply a diverging colormap and '
'normalizer based on the data.'
),
'cmap.qualitative': (
CMAPCAT,
validate._validate_cmap('discrete'),
'Default colormap for qualitative datasets.'
),
'cmap.cyclic': (
CMAPCYC,
validate._validate_cmap('continuous'),
'Default colormap for cyclic datasets.'
),
'cmap.discrete': (
None,
validate._validate_or_none(validate._validate_bool),
'If ``True``, `~proplot.colors.DiscreteNorm` is used for every colormap plot. '
'If ``False``, it is never used. If ``None``, it is used for all plot types '
'except `imshow`, `matshow`, `spy`, `hexbin`, and `hist2d`.'
),
'cmap.diverging': (
CMAPDIV,
validate._validate_cmap('continuous'),
'Default colormap for diverging datasets.'
),
'cmap.inbounds': (
True,
validate._validate_bool,
'If ``True`` and the *x* and *y* axis limits are fixed, only in-bounds data '
'is considered when determining the default colormap `vmin` and `vmax`.'
),
'cmap.levels': (
11,
validate._validate_int,
'Default number of `~proplot.colors.DiscreteNorm` levels for plotting '
'commands that use colormaps.'
),
'cmap.listedthresh': (
64,
validate._validate_int,
'Native `~matplotlib.colors.ListedColormap`\\ s with more colors than '
'this are converted to `~proplot.colors.ContinuousColormap` rather than '
'`~proplot.colors.DiscreteColormap`. This helps translate continuous '
'colormaps from external projects.'
),
'cmap.lut': (
256,
validate._validate_int,
'Number of colors in the colormap lookup table. '
'Alias for :rcraw:`image.lut`.'
),
'cmap.robust': (
False,
validate._validate_bool,
'If ``True``, the default colormap `vmin` and `vmax` are chosen using the '
'2nd to 98th percentiles rather than the minimum and maximum.'
),
'cmap.sequential': (
CMAPSEQ,
validate._validate_cmap('continuous'),
'Default colormap for sequential datasets. Alias for :rcraw:`image.cmap`.'
),
# Special setting
'edgefix': (
True,
validate._validate_bool,
'Whether to fix issues with "white lines" appearing between patches '
'in saved vector graphics and with vector graphic backends. Applies '
'to colorbar levels and bar, area, pcolor, and contour plots.'
),
# Font settings
'font.name': (
FONTNAME,
validate._validate_fontname,
'Alias for :rcraw:`font.family`.'
),
'font.small': (
SMALLSIZE,
validate._validate_fontsize,
'Alias for :rcraw:`font.smallsize`.'
),
'font.smallsize': (
SMALLSIZE,
validate._validate_fontsize,
'Meta setting that changes the label-like sizes ``axes.labelsize``, '
'``legend.fontsize``, ``tick.labelsize``, and ``grid.labelsize``. Default is '
"``'medium'`` (equivalent to :rcraw:`font.size`)." + _addendum_font
),
'font.large': (
LARGESIZE,
validate._validate_fontsize,
'Alias for :rcraw:`font.largesize`.'
),
'font.largesize': (
LARGESIZE,
validate._validate_fontsize,
'Meta setting that changes the title-like sizes ``abc.size``, ``title.size``, '
'``suptitle.size``, ``leftlabel.size``, ``rightlabel.size``, etc. Default is '
"``'med-large'`` (i.e. 1.1 times :rcraw:`font.size`)." + _addendum_font
),
# Formatter settings
'formatter.timerotation': (
'vertical',
validate._validate_rotation,
'Rotation for *x* axis datetime tick labels.' + _addendum_rotation
),
'formatter.zerotrim': (
True,
validate._validate_bool,
'Whether to trim trailing decimal zeros on tick labels.'
),
'formatter.limits': (
[-5, 6], # must be list or else validated
validate._validate['axes.formatter.limits'],
'Alias for :rcraw:`axes.formatter.limits`.'
),
'formatter.min_exponent': (
0,
validate._validate['axes.formatter.min_exponent'],
'Alias for :rcraw:`axes.formatter.min_exponent`.'
),
'formatter.offset_threshold': (
4,
validate._validate['axes.formatter.offset_threshold'],
'Alias for :rcraw:`axes.formatter.offset_threshold`.'
),
'formatter.use_locale': (
False,
validate._validate_bool,
'Alias for :rcraw:`axes.formatter.use_locale`.'
),
'formatter.use_mathtext': (
MATHTEXT,
validate._validate_bool,
'Alias for :rcraw:`axes.formatter.use_mathtext`.'
),
'formatter.use_offset': (
True,
validate._validate_bool,
'Alias for :rcraw:`axes.formatter.useOffset`.'
),
# Geographic axes settings
'geo.backend': (
'cartopy',
validate._validate_belongs('cartopy', 'basemap'),
'The backend used for `~proplot.axes.GeoAxes`. Must be '
"either 'cartopy' or 'basemap'."
),
'geo.extent': (
'globe',
validate._validate_belongs('globe', 'auto'),
"If ``'globe'``, the extent of cartopy `~proplot.axes.GeoAxes` is always "
"global. If ``'auto'``, the extent is automatically adjusted based on "
"plotted content. Default is ``'globe'``."
),
'geo.round': (
True,
validate._validate_bool,
"If ``True`` (the default), polar `~proplot.axes.GeoAxes` like ``'npstere'`` "
"and ``'spstere'`` are bounded with circles rather than squares."
),
# Gridlines
# NOTE: Here 'grid' and 'gridminor' or *not* aliases for native 'axes.grid' and
# invented 'axes.gridminor' because native 'axes.grid' controls both major *and*
# minor gridlines. Must handle it independently from these settings.
'grid': (
True,
validate._validate_bool,
'Toggle major gridlines on and off.'
),
'grid.below': (
GRIDBELOW, # like axes.axisbelow
validate._validate_belongs(False, 'line', True),
'Alias for :rcraw:`axes.axisbelow`. If ``True``, draw gridlines below '
"everything. If ``True``, draw them above everything. If ``'line'``, "
'draw them above patches but below lines and markers.'
),
'grid.checkoverlap': (
True,
validate._validate_bool,
'Whether to have cartopy automatically check for and remove overlapping '
'`~proplot.axes.GeoAxes` gridline labels.'
),
'grid.dmslabels': (
True,
validate._validate_bool,
'Whether to use degrees-minutes-seconds rather than decimals for '
'cartopy `~proplot.axes.GeoAxes` gridlines.'
),
'grid.geolabels': (
True,
validate._validate_bool,
"Whether to include the ``'geo'`` spine in cartopy >= 0.20 when otherwise "
'toggling left, right, bottom, or top `~proplot.axes.GeoAxes` gridline labels.'
),
'grid.inlinelabels': (
False,
validate._validate_bool,
'Whether to add inline labels for cartopy `~proplot.axes.GeoAxes` gridlines.'
),
'grid.labels': (
False,
validate._validate_bool,
'Whether to add outer labels for `~proplot.axes.GeoAxes` gridlines.'
),
'grid.labelcolor': (
BLACK,
validate._validate_color,
'Font color for `~proplot.axes.GeoAxes` gridline labels.'
),
'grid.labelpad': (
GRIDPAD,
validate._validate_pt,
'Padding between the map boundary and cartopy `~proplot.axes.GeoAxes` '
'gridline labels.' + _addendum_pt
),
'grid.labelsize': (
SMALLSIZE,
validate._validate_fontsize,
'Font size for `~proplot.axes.GeoAxes` gridline labels.' + _addendum_font
),
'grid.labelweight': (
'normal',
validate._validate_fontweight,
'Font weight for `~proplot.axes.GeoAxes` gridline labels.'
),
'grid.nsteps': (
250,
validate._validate_int,
'Number of points used to draw cartopy `~proplot.axes.GeoAxes` gridlines.'
),
'grid.pad': (
GRIDPAD,
validate._validate_pt,
'Alias for :rcraw:`grid.labelpad`.'
),
'grid.rotatelabels': (
False, # False limits projections where labels are available
validate._validate_bool,
'Whether to rotate cartopy `~proplot.axes.GeoAxes` gridline labels.'
),
'grid.style': (
'-',
validate._validate_linestyle,
'Major gridline style. Alias for :rcraw:`grid.linestyle`.'
),
'grid.width': (
LINEWIDTH,
validate._validate_pt,
'Major gridline width. Alias for :rcraw:`grid.linewidth`.'
),
'grid.widthratio': (
GRIDRATIO,
validate._validate_float,
'Ratio of minor gridline width to major gridline width.'
),
# Minor gridlines
'gridminor': (
False,
validate._validate_bool,
'Toggle minor gridlines on and off.'
),
'gridminor.alpha': (
GRIDALPHA,
validate._validate_float,
'Minor gridline opacity.'
),
'gridminor.color': (
BLACK,
validate._validate_color,
'Minor gridline color.'
),
'gridminor.linestyle': (
GRIDSTYLE,
validate._validate_linestyle,
'Minor gridline style.'
),
'gridminor.linewidth': (
GRIDRATIO * LINEWIDTH,
validate._validate_pt,
'Minor gridline width.'
),
'gridminor.style': (
GRIDSTYLE,
validate._validate_linestyle,
'Minor gridline style. Alias for :rcraw:`gridminor.linestyle`.'
),
'gridminor.width': (
GRIDRATIO * LINEWIDTH,
validate._validate_pt,
'Minor gridline width. Alias for :rcraw:`gridminor.linewidth`.'
),
# Backend stuff
'inlineformat': (
'retina',
validate._validate_belongs('svg', 'pdf', 'retina', 'png', 'jpeg'),
'The inline backend figure format. Valid formats include '
"``'svg'``, ``'pdf'``, ``'retina'``, ``'png'``, and ``jpeg``."
),
# Inner borders
'innerborders': (
False,
validate._validate_bool,
'Toggles internal political border lines (e.g. states and provinces) '
'on and off.'
),
'innerborders.alpha': (
None,
validate._validate_or_none(validate._validate_float),
'Opacity for internal political border lines',
),
'innerborders.color': (
BLACK,
validate._validate_color,
'Line color for internal political border lines.'
),
'innerborders.linewidth': (
LINEWIDTH,
validate._validate_pt,
'Line width for internal political border lines.'
),
'innerborders.zorder': (
ZLINES,
validate._validate_float,
'Z-order for internal political border lines.'
),
# Axis label settings
'label.color': (
BLACK,
validate._validate_color,
'Alias for :rcraw:`axes.labelcolor`.'
),
'label.pad': (
LABELPAD,
validate._validate_pt,
'Alias for :rcraw:`axes.labelpad`.'
+ _addendum_pt
),
'label.size': (
SMALLSIZE,
validate._validate_fontsize,
'Alias for :rcraw:`axes.labelsize`.' + _addendum_font
),
'label.weight': (
'normal',
validate._validate_fontweight,
'Alias for :rcraw:`axes.labelweight`.'
),
# Lake patches
'lakes': (
False,
validate._validate_bool,
'Toggles lake patches on and off.'
),
'lakes.alpha': (
None,
validate._validate_or_none(validate._validate_float),
'Opacity for lake patches',
),
'lakes.color': (
WHITE,
validate._validate_color,
'Face color for lake patches.'
),
'lakes.zorder': (
ZPATCHES,
validate._validate_float,
'Z-order for lake patches.'
),
# Land patches
'land': (
False,
validate._validate_bool,
'Toggles land patches on and off.'
),
'land.alpha': (
None,
validate._validate_or_none(validate._validate_float),
'Opacity for land patches',
),
'land.color': (
BLACK,
validate._validate_color,
'Face color for land patches.'
),
'land.zorder': (
ZPATCHES,
validate._validate_float,
'Z-order for land patches.'
),
# Left subplot labels
'leftlabel.color': (
BLACK,
validate._validate_color,
'Font color for row labels on the left-hand side.'
),
'leftlabel.pad': (
TITLEPAD,
validate._validate_pt,
'Padding between axes content and row labels on the left-hand side.'
+ _addendum_pt
),
'leftlabel.rotation': (
'vertical',
validate._validate_rotation,
'Rotation for row labels on the left-hand side.' + _addendum_rotation
),
'leftlabel.size': (
LARGESIZE,
validate._validate_fontsize,
'Font size for row labels on the left-hand side.' + _addendum_font
),
'leftlabel.weight': (
'bold',
validate._validate_fontweight,
'Font weight for row labels on the left-hand side.'
),
# Meta settings
'margin': (
MARGIN,
validate._validate_float,
'The fractional *x* and *y* axis data margins when limits are unset. '
'Alias for :rcraw:`axes.margin`.'
),
'meta.edgecolor': (
BLACK,
validate._validate_color,
'Color of axis spines, tick marks, tick labels, and labels.'
),
'meta.color': (
BLACK,
validate._validate_color,
'Color of axis spines, tick marks, tick labels, and labels. '
'Alias for :rcraw:`meta.edgecolor`.'
),
'meta.linewidth': (
LINEWIDTH,
validate._validate_pt,
'Thickness of axis spines and major tick lines.'
),
'meta.width': (
LINEWIDTH,