Clear the axis. This resets axis properties to their default values: - the label - the scale - locators, formatters and ticks - major and minor grid - units - registered callbacks
(self)
| 889 | mpl.rcParams['axes.grid.which'] in ('both', 'minor')) |
| 890 | |
| 891 | def clear(self): |
| 892 | """ |
| 893 | Clear the axis. |
| 894 | |
| 895 | This resets axis properties to their default values: |
| 896 | |
| 897 | - the label |
| 898 | - the scale |
| 899 | - locators, formatters and ticks |
| 900 | - major and minor grid |
| 901 | - units |
| 902 | - registered callbacks |
| 903 | """ |
| 904 | self.label._reset_visual_defaults() |
| 905 | # The above resets the label formatting using text rcParams, |
| 906 | # so we then update the formatting using axes rcParams |
| 907 | self.label.set_color(mpl.rcParams['axes.labelcolor']) |
| 908 | self.label.set_fontsize(mpl.rcParams['axes.labelsize']) |
| 909 | self.label.set_fontweight(mpl.rcParams['axes.labelweight']) |
| 910 | self.offsetText._reset_visual_defaults() |
| 911 | self.labelpad = mpl.rcParams['axes.labelpad'] |
| 912 | |
| 913 | self._init() |
| 914 | |
| 915 | self._set_scale('linear') |
| 916 | |
| 917 | # Clear the callback registry for this axis, or it may "leak" |
| 918 | self.callbacks = cbook.CallbackRegistry(signals=["units"]) |
| 919 | |
| 920 | # whether the grids are on |
| 921 | self._major_tick_kw['gridOn'] = ( |
| 922 | mpl.rcParams['axes.grid'] and |
| 923 | mpl.rcParams['axes.grid.which'] in ('both', 'major')) |
| 924 | self._minor_tick_kw['gridOn'] = ( |
| 925 | mpl.rcParams['axes.grid'] and |
| 926 | mpl.rcParams['axes.grid.which'] in ('both', 'minor')) |
| 927 | self.reset_ticks() |
| 928 | |
| 929 | self._converter = None |
| 930 | self._converter_is_explicit = False |
| 931 | self.units = None |
| 932 | self.stale = True |
| 933 | |
| 934 | def reset_ticks(self): |
| 935 | """ |
no test coverage detected