Draw mathtext markers '$...$' using `.TextPath` object. Submitted by tcb
(self)
| 481 | self._transform = Affine2D().scale(0.5).rotate_deg(rotation) |
| 482 | |
| 483 | def _set_mathtext_path(self): |
| 484 | """ |
| 485 | Draw mathtext markers '$...$' using `.TextPath` object. |
| 486 | |
| 487 | Submitted by tcb |
| 488 | """ |
| 489 | from matplotlib.text import TextPath |
| 490 | |
| 491 | # again, the properties could be initialised just once outside |
| 492 | # this function |
| 493 | text = TextPath(xy=(0, 0), s=self.get_marker(), |
| 494 | usetex=mpl.rcParams['text.usetex']) |
| 495 | if len(text.vertices) == 0: |
| 496 | return |
| 497 | |
| 498 | bbox = text.get_extents() |
| 499 | max_dim = max(bbox.width, bbox.height) |
| 500 | self._transform = ( |
| 501 | Affine2D() |
| 502 | .translate(-bbox.xmin + 0.5 * -bbox.width, -bbox.ymin + 0.5 * -bbox.height) |
| 503 | .scale(1.0 / max_dim)) |
| 504 | self._path = text |
| 505 | self._snap = False |
| 506 | |
| 507 | def _half_fill(self): |
| 508 | return self.get_fillstyle() in self._half_fillstyles |
nothing calls this directly
no test coverage detected