Convenience method for simple axis view autoscaling. See `.Axes.autoscale` for full documentation. Because this function applies to 3D Axes, *axis* can also be set to 'z', and setting *axis* to 'both' autoscales all three axes.
(self, enable=True, axis='both', tight=None)
| 603 | ) |
| 604 | |
| 605 | def autoscale(self, enable=True, axis='both', tight=None): |
| 606 | """ |
| 607 | Convenience method for simple axis view autoscaling. |
| 608 | |
| 609 | See `.Axes.autoscale` for full documentation. Because this function |
| 610 | applies to 3D Axes, *axis* can also be set to 'z', and setting *axis* |
| 611 | to 'both' autoscales all three axes. |
| 612 | """ |
| 613 | if enable is None: |
| 614 | scalex = True |
| 615 | scaley = True |
| 616 | scalez = True |
| 617 | else: |
| 618 | if axis in ['x', 'both']: |
| 619 | self.set_autoscalex_on(enable) |
| 620 | scalex = self.get_autoscalex_on() |
| 621 | else: |
| 622 | scalex = False |
| 623 | if axis in ['y', 'both']: |
| 624 | self.set_autoscaley_on(enable) |
| 625 | scaley = self.get_autoscaley_on() |
| 626 | else: |
| 627 | scaley = False |
| 628 | if axis in ['z', 'both']: |
| 629 | self.set_autoscalez_on(enable) |
| 630 | scalez = self.get_autoscalez_on() |
| 631 | else: |
| 632 | scalez = False |
| 633 | if scalex: |
| 634 | self._request_autoscale_view("x", tight=tight) |
| 635 | if scaley: |
| 636 | self._request_autoscale_view("y", tight=tight) |
| 637 | if scalez: |
| 638 | self._request_autoscale_view("z", tight=tight) |
| 639 | |
| 640 | def auto_scale_xyz(self, X, Y, Z=None, had_data=None): |
| 641 | # This updates the bounding boxes as to keep a record as to what the |