| 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 | |
| 585 | class Axis(martist.Artist): |