Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Commit160de56
committed
Only autoscale_view() when needed, not after every plotting call.
This avoids quadratic complexity when accumulating sticky edges.Mostly, this just replaces autoscale_view() calls with setting a flagrequesting that autoscale_view() be called the next time viewLim isaccessed. Note that we cannot just do this in draw as this would breakcommon idioms like```ax.plot(...)ax.set_xlim(0, None) # keep top limit to what plot() set```The main nontrivial changes are- Removal of sticky_edges from hexbin(): Previously, hexbin() actually did *not* respect the sticky_egdes settings for some reason (this can be checked visually); but with this patch it would respect them -- breaking the baseline images. So just don't set sticky_edges instead.- Making LinearLocator.numticks a property: Previously, some code using LinearLocator would only work after the locator has been used once, so that tick_values properly set numticks to not-None; but with this patch, tick_values is no longer called early enough; making numticks a property fixes that. Note that LinearLocator is likely extremely rarely used anyways...- In test_bbox_inches_tight (which uses the old "round_numbers" autolimits mode), the autolimits change depending on whether autoscaling happens before the call to `xticks([])` (old behavior) or after (because there's no notion of "round numbers" anymore. Here we can just force these limits.- test_multi_color_hatch relied on ax.bar() triggering an autoscale but ax.add_patch *not* doing so. Just disable autoscaling then.This patch also prepares towards fixing collections autoscaling problemswhen switching from linear to log scales (as that also needs to bedeferred to as late as possible, once the scale is actually known).1 parent34970ed commit160de56
File tree
9 files changed
+148
-72
lines changed- doc/api/next_api_changes
- lib/matplotlib
- axes
- tests
9 files changed
+148
-72
lines changedLines changed: 20 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + |
Lines changed: 26 additions & 28 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
840 | 840 |
| |
841 | 841 |
| |
842 | 842 |
| |
843 |
| - | |
| 843 | + | |
844 | 844 |
| |
845 | 845 |
| |
846 | 846 |
| |
| |||
909 | 909 |
| |
910 | 910 |
| |
911 | 911 |
| |
912 |
| - | |
| 912 | + | |
913 | 913 |
| |
914 | 914 |
| |
915 | 915 |
| |
| |||
965 | 965 |
| |
966 | 966 |
| |
967 | 967 |
| |
968 |
| - | |
| 968 | + | |
969 | 969 |
| |
970 | 970 |
| |
971 | 971 |
| |
| |||
1030 | 1030 |
| |
1031 | 1031 |
| |
1032 | 1032 |
| |
1033 |
| - | |
| 1033 | + | |
1034 | 1034 |
| |
1035 | 1035 |
| |
1036 | 1036 |
| |
| |||
1105 | 1105 |
| |
1106 | 1106 |
| |
1107 | 1107 |
| |
1108 |
| - | |
| 1108 | + | |
1109 | 1109 |
| |
1110 | 1110 |
| |
1111 | 1111 |
| |
| |||
1182 | 1182 |
| |
1183 | 1183 |
| |
1184 | 1184 |
| |
1185 |
| - | |
| 1185 | + | |
1186 | 1186 |
| |
1187 | 1187 |
| |
1188 | 1188 |
| |
| |||
1398 | 1398 |
| |
1399 | 1399 |
| |
1400 | 1400 |
| |
1401 |
| - | |
| 1401 | + | |
1402 | 1402 |
| |
1403 | 1403 |
| |
1404 | 1404 |
| |
| |||
1642 | 1642 |
| |
1643 | 1643 |
| |
1644 | 1644 |
| |
1645 |
| - | |
| 1645 | + | |
1646 | 1646 |
| |
1647 | 1647 |
| |
1648 | 1648 |
| |
| |||
1718 | 1718 |
| |
1719 | 1719 |
| |
1720 | 1720 |
| |
1721 |
| - | |
| 1721 | + | |
1722 | 1722 |
| |
1723 | 1723 |
| |
1724 | 1724 |
| |
| |||
2422 | 2422 |
| |
2423 | 2423 |
| |
2424 | 2424 |
| |
2425 |
| - | |
| 2425 | + | |
2426 | 2426 |
| |
2427 | 2427 |
| |
2428 | 2428 |
| |
| |||
2623 | 2623 |
| |
2624 | 2624 |
| |
2625 | 2625 |
| |
2626 |
| - | |
| 2626 | + | |
2627 | 2627 |
| |
2628 | 2628 |
| |
2629 | 2629 |
| |
| |||
3429 | 3429 |
| |
3430 | 3430 |
| |
3431 | 3431 |
| |
3432 |
| - | |
| 3432 | + | |
3433 | 3433 |
| |
3434 | 3434 |
| |
3435 | 3435 |
| |
| |||
4101 | 4101 |
| |
4102 | 4102 |
| |
4103 | 4103 |
| |
4104 |
| - | |
| 4104 | + | |
4105 | 4105 |
| |
4106 | 4106 |
| |
4107 | 4107 |
| |
| |||
4479 | 4479 |
| |
4480 | 4480 |
| |
4481 | 4481 |
| |
4482 |
| - | |
| 4482 | + | |
4483 | 4483 |
| |
4484 | 4484 |
| |
4485 | 4485 |
| |
| |||
4832 | 4832 |
| |
4833 | 4833 |
| |
4834 | 4834 |
| |
4835 |
| - | |
4836 |
| - | |
4837 |
| - | |
| 4835 | + | |
4838 | 4836 |
| |
4839 | 4837 |
| |
4840 | 4838 |
| |
| |||
5004 | 5002 |
| |
5005 | 5003 |
| |
5006 | 5004 |
| |
5007 |
| - | |
| 5005 | + | |
5008 | 5006 |
| |
5009 | 5007 |
| |
5010 | 5008 |
| |
| |||
5020 | 5018 |
| |
5021 | 5019 |
| |
5022 | 5020 |
| |
5023 |
| - | |
| 5021 | + | |
5024 | 5022 |
| |
5025 | 5023 |
| |
5026 | 5024 |
| |
| |||
5075 | 5073 |
| |
5076 | 5074 |
| |
5077 | 5075 |
| |
5078 |
| - | |
| 5076 | + | |
5079 | 5077 |
| |
5080 | 5078 |
| |
5081 | 5079 |
| |
| |||
5257 | 5255 |
| |
5258 | 5256 |
| |
5259 | 5257 |
| |
5260 |
| - | |
| 5258 | + | |
5261 | 5259 |
| |
5262 | 5260 |
| |
5263 | 5261 |
| |
| |||
5438 | 5436 |
| |
5439 | 5437 |
| |
5440 | 5438 |
| |
5441 |
| - | |
| 5439 | + | |
5442 | 5440 |
| |
5443 | 5441 |
| |
5444 | 5442 |
| |
| |||
5937 | 5935 |
| |
5938 | 5936 |
| |
5939 | 5937 |
| |
5940 |
| - | |
| 5938 | + | |
5941 | 5939 |
| |
5942 | 5940 |
| |
5943 | 5941 |
| |
| |||
6150 | 6148 |
| |
6151 | 6149 |
| |
6152 | 6150 |
| |
6153 |
| - | |
| 6151 | + | |
6154 | 6152 |
| |
6155 | 6153 |
| |
6156 | 6154 |
| |
| |||
6320 | 6318 |
| |
6321 | 6319 |
| |
6322 | 6320 |
| |
6323 |
| - | |
| 6321 | + | |
6324 | 6322 |
| |
6325 | 6323 |
| |
6326 | 6324 |
| |
6327 | 6325 |
| |
6328 | 6326 |
| |
6329 | 6327 |
| |
6330 |
| - | |
| 6328 | + | |
6331 | 6329 |
| |
6332 | 6330 |
| |
6333 | 6331 |
| |
6334 | 6332 |
| |
6335 | 6333 |
| |
6336 | 6334 |
| |
6337 | 6335 |
| |
6338 |
| - | |
| 6336 | + | |
6339 | 6337 |
| |
6340 | 6338 |
| |
6341 | 6339 |
| |
| |||
6842 | 6840 |
| |
6843 | 6841 |
| |
6844 | 6842 |
| |
6845 |
| - | |
| 6843 | + | |
6846 | 6844 |
| |
6847 | 6845 |
| |
6848 | 6846 |
| |
|
0 commit comments
Comments
(0)