Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 90c30a0

Browse filesBrowse files
committed
Improve lazy-ticks realization.
1 parent 0e89377 commit 90c30a0
Copy full SHA for 90c30a0

File tree

Expand file treeCollapse file tree

1 file changed

+11
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+11
-2
lines changed

‎lib/matplotlib/axis.py

Copy file name to clipboardExpand all lines: lib/matplotlib/axis.py
+11-2Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -677,11 +677,20 @@ def __get__(self, instance, cls):
677677
if instance is None:
678678
return self
679679
else:
680+
# instance._get_tick() can itself try to access the majorTicks
681+
# attribute (e.g. in certain projection classes which override
682+
# e.g. get_xaxis_text1_transform). In order to avoid infinite
683+
# recursion, first set the majorTicks on the instance to an empty
684+
# list, then create the tick and append it.
680685
if self._major:
681-
instance.majorTicks = [instance._get_tick(major=True)]
686+
instance.majorTicks = []
687+
tick = instance._get_tick(major=True)
688+
instance.majorTicks.append(tick)
682689
return instance.majorTicks
683690
else:
684-
instance.minorTicks = [instance._get_tick(major=False)]
691+
instance.minorTicks = []
692+
tick = instance._get_tick(major=False)
693+
instance.minorTicks.append(tick)
685694
return instance.minorTicks
686695

687696

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.