Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 15b71b3

Browse files
authored
Merge pull request #18466 from anntzer/histautoscale
Remove unnecessary autoscale handling in hist().
2 parents 687fd12 + ddaf96d commit 15b71b3

1 file changed

Lines changed: 0 additions & 12 deletions

File tree

lib/matplotlib/axes/_axes.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6613,14 +6613,6 @@ def hist(self, x, bins=None, range=None, density=False, weights=None,
66136613

66146614
patches = []
66156615

6616-
# Save autoscale state for later restoration; turn autoscaling
6617-
# off so we can do it all a single time at the end, instead
6618-
# of having it done by bar or fill and then having to be redone.
6619-
_saved_autoscalex = self.get_autoscalex_on()
6620-
_saved_autoscaley = self.get_autoscaley_on()
6621-
self.set_autoscalex_on(False)
6622-
self.set_autoscaley_on(False)
6623-
66246616
if histtype.startswith('bar'):
66256617

66266618
totwidth = np.diff(bins)
@@ -6741,10 +6733,6 @@ def hist(self, x, bins=None, range=None, density=False, weights=None,
67416733
# we return patches, so put it back in the expected order
67426734
patches.reverse()
67436735

6744-
self.set_autoscalex_on(_saved_autoscalex)
6745-
self.set_autoscaley_on(_saved_autoscaley)
6746-
self._request_autoscale_view()
6747-
67486736
# If None, make all labels None (via zip_longest below); otherwise,
67496737
# cast each element to str, but keep a single str as it.
67506738
labels = [] if label is None else np.atleast_1d(np.asarray(label, str))

0 commit comments

Comments
 (0)