MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / __get__

Method __get__

lib/matplotlib/axis.py:562–582  ·  view source on GitHub ↗
(self, instance, owner)

Source from the content-addressed store, hash-verified

560 self._major = major
561
562 def __get__(self, instance, owner):
563 if instance is None:
564 return self
565 else:
566 # instance._get_tick() can itself try to access the majorTicks
567 # attribute (e.g. in certain projection classes which override
568 # e.g. get_xaxis_text1_transform). In order to avoid infinite
569 # recursion, first set the majorTicks on the instance temporarily
570 # to an empty list. Then create the tick; note that _get_tick()
571 # may call reset_ticks(). Therefore, the final tick list is
572 # created and assigned afterwards.
573 if self._major:
574 instance.majorTicks = []
575 tick = instance._get_tick(major=True)
576 instance.majorTicks = [tick]
577 return instance.majorTicks
578 else:
579 instance.minorTicks = []
580 tick = instance._get_tick(major=False)
581 instance.minorTicks = [tick]
582 return instance.minorTicks
583
584
585class Axis(martist.Artist):

Callers

nothing calls this directly

Calls 1

_get_tickMethod · 0.45

Tested by

no test coverage detected