@@ -1617,13 +1617,15 @@ def axis(self, *args, **kwargs):
1617
1617
'equal' Set equal scaling (i.e., make circles circular) by
1618
1618
changing axis limits.
1619
1619
'scaled' Set equal scaling (i.e., make circles circular) by
1620
- changing dimensions of the plot box.
1621
- 'tight' Set limits just large enough to show all data.
1620
+ changing dimensions of the plot box, then disable further
1621
+ autoscaling.
1622
+ 'tight' Set limits just large enough to show all data, then
1623
+ disable further autoscaling.
1622
1624
'auto' Automatic scaling (fill plot box with data).
1623
1625
'normal' Same as 'auto'; deprecated.
1624
1626
'image' 'scaled' with axis limits equal to data limits.
1625
1627
'square' Square plot; similar to 'scaled', but initially forcing
1626
- ``xmax-xmin = ymax-ymin``.
1628
+ ``xmax-xmin == ymax-ymin``.
1627
1629
======== ==========================================================
1628
1630
1629
1631
emit : bool, optional, default *True*
@@ -2348,16 +2350,12 @@ def autoscale(self, enable=True, axis='both', tight=None):
2348
2350
None leaves the autoscaling state unchanged.
2349
2351
2350
2352
axis : {'both', 'x', 'y'}, optional
2351
- which axis to operate on; default is 'both'
2353
+ Which axis to operate on; default is 'both'.
2352
2354
2353
2355
tight : bool or None, optional
2354
- If True, set view limits to data limits;
2355
- if False, let the locator and margins expand the view limits;
2356
- if None, use tight scaling if the only artist is an image,
2357
- otherwise treat *tight* as False.
2358
- The *tight* setting is retained for future autoscaling
2359
- until it is explicitly changed.
2360
-
2356
+ If True, first set the margins to zero. Then, this argument is
2357
+ forwarded to `autoscale_view` (regardless of its value); see the
2358
+ description of its behavior there.
2361
2359
"""
2362
2360
if enable is None :
2363
2361
scalex = True
@@ -2381,17 +2379,31 @@ def autoscale_view(self, tight=None, scalex=True, scaley=True):
2381
2379
"""
2382
2380
Autoscale the view limits using the data limits.
2383
2381
2384
- You can selectively autoscale only a single axis, e.g., the xaxis by
2385
- setting *scaley* to *False*. The autoscaling preserves any
2386
- axis direction reversal that has already been done.
2387
-
2388
- If *tight* is *False*, the axis major locator will be used
2389
- to expand the view limits if rcParams['axes.autolimit_mode']
2390
- is 'round_numbers'. Note that any margins that are in effect
2391
- will be applied first, regardless of whether *tight* is
2392
- *True* or *False*. Specifying *tight* as *True* or *False*
2393
- saves the setting as a private attribute of the Axes; specifying
2394
- it as *None* (the default) applies the previously saved value.
2382
+ Parameters
2383
+ ----------
2384
+ tight : bool or None
2385
+ If *True*, only expand the axis limits using the margins. Note
2386
+ that unlike for `autoscale`, ``tight=True`` does *not* set the
2387
+ margins to zero.
2388
+
2389
+ If *False* and :rc:`axes.autolimit_mode` is 'round_numbers', then
2390
+ after expansion by the margins, further expand the axis limits
2391
+ using the axis major locator.
2392
+
2393
+ If None (the default), reuse the value set in the previous call to
2394
+ `autoscale_view` (the initial value is False, but the default style
2395
+ sets :rc:`axes.autolimit_mode` to 'data', in which case this
2396
+ behaves like True).
2397
+
2398
+ scalex : bool
2399
+ Whether to autoscale the x axis (default is True).
2400
+
2401
+ scaley : bool
2402
+ Whether to autoscale the x axis (default is True).
2403
+
2404
+ Notes
2405
+ -----
2406
+ The autoscaling preserves any preexisting axis direction reversal.
2395
2407
2396
2408
The data limits are not updated automatically when artist data are
2397
2409
changed after the artist has been added to an Axes instance. In that
0 commit comments