Skip to content

Commit d32c650

Browse files
committed
Fix 'see also', use 'other params' more, misc doc cleanup
1 parent 6e9f39b commit d32c650

7 files changed

Lines changed: 256 additions & 176 deletions

File tree

proplot/axes.py

Lines changed: 51 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -134,15 +134,15 @@ def __init__(self, *args, number=None, main=False, **kwargs):
134134
main : bool, optional
135135
Used internally, indicates whether this is a "main axes" rather
136136
than a twin, panel, or inset axes.
137+
138+
Other parameters
139+
----------------
137140
*args, **kwargs
138141
Passed to `~matplotlib.axes.Axes`.
139142
140143
See also
141144
--------
142-
:py:obj:`matplotlib.axes.Axes`,
143-
:py:obj:`XYAxes`,
144-
:py:obj:`PolarAxes`,
145-
:py:obj:`ProjAxes`
145+
matplotlib.axes.Axes, XYAxes, PolarAxes, ProjAxes
146146
"""
147147
super().__init__(*args, **kwargs)
148148

@@ -766,10 +766,8 @@ def format(
766766
767767
See also
768768
--------
769-
`~proplot.rctools.rc_configurator.context`,
770-
`XYAxes.format`,
771-
`ProjAxes.format`,
772-
`PolarAxes.format`
769+
~proplot.rctools.rc_configurator.context,
770+
XYAxes.format, ProjAxes.format, PolarAxes.format
773771
"""
774772
# Figure patch (for some reason needs to be re-asserted even if
775773
# declared before figure is drawn)
@@ -855,6 +853,7 @@ def sanitize_kw(kw, loc):
855853
'borderwidth': 'abc.borderwidth',
856854
'fontfamily': 'font.family',
857855
}, context=True)
856+
858857
# Label format
859858
abcstyle = rc.get('abc.style', context=True) # 1st run, or changed
860859
if abcstyle and self.number is not None:
@@ -869,11 +868,13 @@ def sanitize_kw(kw, loc):
869868
if 'A' in abcstyle:
870869
text = text.upper()
871870
self._abc_text = text
871+
872872
# Apply text
873873
obj = self._abc_label
874874
abc = rc.get('abc', context=True)
875875
if abc is not None:
876876
obj.set_text(self._abc_text if bool(abc) else '')
877+
877878
# Apply new settings
878879
loc = self._loc_translate(None, 'abc')
879880
loc_prev = self._abc_loc
@@ -1015,7 +1016,10 @@ def colorbar(
10151016
:rc:`colorbar.framealpha`, :rc:`axes.linewidth`,
10161017
:rc:`axes.edgecolor`, and :rc:`axes.facecolor`,
10171018
respectively.
1018-
**kwargs
1019+
1020+
Other parameters
1021+
----------------
1022+
*args, **kwargs
10191023
Passed to `~proplot.wrappers.colorbar_wrapper`.
10201024
"""
10211025
# TODO: add option to pad inset away from axes edge!
@@ -1416,6 +1420,9 @@ def indicate_inset_zoom(
14161420
<https://matplotlib.org/3.1.1/gallery/misc/zorder_demo.html>`__
14171421
of the axes, should be greater than the zorder of
14181422
elements in the parent axes. Default is ``3.5``.
1423+
1424+
Other parameters
1425+
----------------
14191426
**kwargs
14201427
Passed to `~matplotlib.axes.Axes.indicate_inset`.
14211428
"""
@@ -1619,11 +1626,6 @@ def violins(self, *args, **kwargs):
16191626
# For consistency with _left_title, _upper_left_title, etc.
16201627
_center_title = property(lambda self: self.title)
16211628

1622-
# ABC location
1623-
abc = property(lambda self: getattr(
1624-
self, '_' + self._abc_loc.replace(' ', '_') + '_title'
1625-
))
1626-
16271629
#: Alias for `~Axes.panel_axes`.
16281630
panel = panel_axes
16291631

@@ -1886,7 +1888,7 @@ def __init__(self, *args, **kwargs):
18861888
"""
18871889
See also
18881890
--------
1889-
`~proplot.subplots.subplots`, `Axes`
1891+
~proplot.subplots.subplots
18901892
"""
18911893
# Impose default formatter
18921894
super().__init__(*args, **kwargs)
@@ -2275,6 +2277,9 @@ def format(
22752277
Keyword arguments used to update the background patch object. You
22762278
can use this, for example, to set background hatching with
22772279
``patch_kw={'hatch':'xxx'}``.
2280+
2281+
Other parameters
2282+
----------------
22782283
rc_kw : dict, optional
22792284
Dictionary containing `~proplot.rctools.rc` settings applied to
22802285
this axes using `~proplot.rctools.rc_configurator.context`.
@@ -2284,6 +2289,10 @@ def format(
22842289
axes `~proplot.rctools.rc` settings. For example,
22852290
``axestitlesize=15`` modifies the :rcraw:`axes.titlesize` setting.
22862291
2292+
See also
2293+
--------
2294+
Axes.format, ~rctools.rc_configurator.context
2295+
22872296
Note
22882297
----
22892298
If you plot something with a `datetime64 \
@@ -2292,10 +2301,6 @@ def format(
22922301
`datetime.time`, or `datetime.datetime` array as the *x* or *y* axis
22932302
coordinate, the axis ticks and tick labels will be automatically
22942303
formatted as dates.
2295-
2296-
See also
2297-
--------
2298-
`Axes.format`, `~rctools.rc_configurator.context`
22992304
"""
23002305
rc_kw, rc_mode, kwargs = _parse_format(**kwargs)
23012306
with rc.context(rc_kw, mode=rc_mode):
@@ -2704,6 +2709,14 @@ def _grid_dict(grid):
27042709
axis.set_major_locator(locator)
27052710
if isinstance(locator, mticker.IndexLocator):
27062711
tickminor = False # 'index' minor ticks make no sense
2712+
if minorlocator in (True, False):
2713+
_warn_proplot(
2714+
f'You passed {x}minorticks={minorlocator}, but this '
2715+
'argument is used to specify tick *locations*. If '
2716+
'you just want to *toggle* minor ticks on and off, '
2717+
f'please use {x}tickminor=True or {x}tickminor=False.'
2718+
)
2719+
minorlocator = None
27072720
if tickminor or minorlocator:
27082721
isdefault = minorlocator is None
27092722
if isdefault:
@@ -2922,7 +2935,7 @@ def __init__(self, *args, **kwargs):
29222935
"""
29232936
See also
29242937
--------
2925-
`~proplot.subplots.subplots`, `Axes`
2938+
~proplot.subplots.subplots
29262939
"""
29272940
# Set tick length to zero so azimuthal labels are not too offset
29282941
# Change default radial axis formatter but keep default theta one
@@ -2996,6 +3009,9 @@ def format(
29963009
thetaformatter_kw, rformatter_kw : dict-like, optional
29973010
The azimuthal and radial label formatter settings. Passed to
29983011
`~proplot.axistools.Formatter`.
3012+
3013+
Other parameters
3014+
----------------
29993015
rc_kw : dict, optional
30003016
Dictionary containing `~proplot.rctools.rc` settings applied to
30013017
this axes using `~proplot.rctools.rc_configurator.context`.
@@ -3007,8 +3023,7 @@ def format(
30073023
30083024
See also
30093025
--------
3010-
`Axes.format`,
3011-
`~proplot.rctools.rc_configurator.context`
3026+
Axes.format, ~proplot.rctools.rc_configurator.context
30123027
"""
30133028
rc_kw, rc_mode, kwargs = _parse_format(**kwargs)
30143029
with rc.context(rc_kw, mode=rc_mode):
@@ -3195,7 +3210,7 @@ def __init__(self, *args, **kwargs):
31953210
"""
31963211
See also
31973212
--------
3198-
`~proplot.subplots.subplots`, `Axes`, `GeoAxes`, `BasemapAxes`
3213+
~proplot.subplots.subplots, GeoAxes, BasemapAxes
31993214
"""
32003215
# Store props that let us dynamically and incrementally modify
32013216
# line locations and settings like with Cartesian axes
@@ -3272,6 +3287,9 @@ def format(
32723287
Keyword arguments used to update the background patch object. You
32733288
can use this, for example, to set background hatching with
32743289
``patch_kw={'hatch':'xxx'}``.
3290+
3291+
Other parameters
3292+
----------------
32753293
rc_kw : dict, optional
32763294
Dictionary containing `~proplot.rctools.rc` settings applied to
32773295
this axes using `~proplot.rctools.rc_configurator.context`.
@@ -3283,7 +3301,7 @@ def format(
32833301
32843302
See also
32853303
--------
3286-
:py:obj:`Axes.format`, `~proplot.rctools.rc_configurator.context`
3304+
Axes.format, ~proplot.rctools.rc_configurator.context
32873305
"""
32883306
rc_kw, rc_mode, kwargs = _parse_format(**kwargs)
32893307
with rc.context(rc_kw, mode=rc_mode):
@@ -3497,12 +3515,15 @@ def __init__(self, *args, map_projection=None, **kwargs):
34973515
----------
34983516
map_projection : `~cartopy.crs.Projection`
34993517
The `~cartopy.crs.Projection` instance.
3518+
3519+
Other parameters
3520+
----------------
35003521
*args, **kwargs
35013522
Passed to `~cartopy.mpl.geoaxes.GeoAxes`.
35023523
35033524
See also
35043525
--------
3505-
`~proplot.subplots.subplots`, `Axes`, `~proplot.projs.Proj`
3526+
~proplot.subplots.subplots, ~proplot.projs.Proj
35063527
"""
35073528
# GeoAxes initialization. Note that critical attributes like
35083529
# outline_patch needed by _format_apply are added before it is called.
@@ -3871,12 +3892,15 @@ def __init__(self, *args, map_projection=None, **kwargs):
38713892
----------
38723893
map_projection : `~mpl_toolkits.basemap.Basemap`
38733894
The `~mpl_toolkits.basemap.Basemap` instance.
3874-
**kwargs
3895+
3896+
Other parameters
3897+
----------------
3898+
*args, **kwargs
38753899
Passed to `Axes`.
38763900
38773901
See also
38783902
--------
3879-
`~proplot.subplots.subplots`, `Axes`, `~proplot.projs.Proj`
3903+
~proplot.subplots.subplots, ~proplot.projs.Proj
38803904
"""
38813905
# Map boundary notes
38823906
# * Must set boundary before-hand, otherwise the set_axes_limits method

0 commit comments

Comments
 (0)