|
5 | 5 |
|
6 | 6 | import numpy as np
|
7 | 7 |
|
8 |
| -from matplotlib import _text_helpers, dviread, font_manager, rcParams |
| 8 | +from matplotlib import _text_helpers, dviread, font_manager |
9 | 9 | from matplotlib.font_manager import FontProperties, get_font
|
10 | 10 | from matplotlib.ft2font import LOAD_NO_HINTING, LOAD_TARGET_LIGHT
|
11 | 11 | from matplotlib.mathtext import MathTextParser
|
@@ -385,11 +385,11 @@ def __init__(self, xy, s, size=None, prop=None,
|
385 | 385 |
|
386 | 386 | self._cached_vertices = None
|
387 | 387 | s, ismath = Text(usetex=usetex)._preprocess_math(s)
|
388 |
| - self._vertices, self._codes = text_to_path.get_text_path( |
389 |
| - prop, s, ismath=ismath) |
| 388 | + super().__init__( |
| 389 | + *text_to_path.get_text_path(prop, s, ismath=ismath), |
| 390 | + _interpolation_steps=_interpolation_steps, |
| 391 | + readonly=True) |
390 | 392 | self._should_simplify = False
|
391 |
| - self._simplify_threshold = rcParams['path.simplify_threshold'] |
392 |
| - self._interpolation_steps = _interpolation_steps |
393 | 393 |
|
394 | 394 | def set_size(self, size):
|
395 | 395 | """Set the text size."""
|
@@ -427,4 +427,5 @@ def _revalidate_path(self):
|
427 | 427 | .scale(self._size / text_to_path.FONT_SCALE)
|
428 | 428 | .translate(*self._xy))
|
429 | 429 | self._cached_vertices = tr.transform(self._vertices)
|
| 430 | + self._cached_vertices.flags.writeable = False |
430 | 431 | self._invalid = False
|
0 commit comments