Initialize the label and offsetText instance values and `label_position` / `offset_text_position`.
(self)
| 2767 | self._init() |
| 2768 | |
| 2769 | def _init(self): |
| 2770 | """ |
| 2771 | Initialize the label and offsetText instance values and |
| 2772 | `label_position` / `offset_text_position`. |
| 2773 | """ |
| 2774 | # x in display coords, y in axes coords (to be updated at draw time by |
| 2775 | # _update_label_positions and _update_offset_text_position). |
| 2776 | self.label.set( |
| 2777 | x=0, y=0.5, |
| 2778 | verticalalignment='bottom', horizontalalignment='center', |
| 2779 | rotation='vertical', rotation_mode='anchor', |
| 2780 | transform=mtransforms.blended_transform_factory( |
| 2781 | mtransforms.IdentityTransform(), self.axes.transAxes), |
| 2782 | ) |
| 2783 | self.label_position = 'left' |
| 2784 | |
| 2785 | if mpl.rcParams['ytick.labelcolor'] == 'inherit': |
| 2786 | tick_color = mpl.rcParams['ytick.color'] |
| 2787 | else: |
| 2788 | tick_color = mpl.rcParams['ytick.labelcolor'] |
| 2789 | |
| 2790 | # x in axes coords, y in display coords(!). |
| 2791 | self.offsetText.set( |
| 2792 | x=0, y=0.5, |
| 2793 | verticalalignment='baseline', horizontalalignment='left', |
| 2794 | transform=mtransforms.blended_transform_factory( |
| 2795 | self.axes.transAxes, mtransforms.IdentityTransform()), |
| 2796 | fontsize=mpl.rcParams['ytick.labelsize'], |
| 2797 | color=tick_color |
| 2798 | ) |
| 2799 | self.offset_text_position = 'left' |
| 2800 | |
| 2801 | def contains(self, mouseevent): |
| 2802 | # docstring inherited |