You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/devel/MEP/MEP29.rst
+26-1Lines changed: 26 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,13 +45,38 @@ Implementation
45
45
46
46
A proof of concept is provided in `markup_example.py <https://github.com/rougier/matplotlib/blob/markup/examples/text_labels_and_annotations/markup.py>`_ but it currently only handles the horizontal direction.
47
47
48
+
Improvements
49
+
------------
50
+
51
+
* This proof of concept uses regex to parse the text but it may be better
52
+
to use the html.parser from the standard library.
53
+
54
+
* Computation of text fragment positions could benefit from the OffsetFrom
55
+
class. See for example item 5 in `Using Complex Coordinates with Annotations <http://matplotlib.org/devdocs/users/annotations.html#using-complex-coordinates-with-annotations>`_
56
+
57
+
Problems
58
+
--------
59
+
60
+
* One serious problem is how to deal with text having both latex and
61
+
html-like tags. For example, consider the follwing::
62
+
63
+
$<b>Bold$</b>
64
+
65
+
Recommendation would be to have mutual exclusion.
66
+
48
67
49
68
Backward compatibility
50
69
======================
51
70
52
71
None at the moment since it is only a proof of concept
53
72
73
+
54
74
Alternatives
55
75
============
56
76
57
-
None (to my knowledge)
77
+
As proposed by @anntzer, this could be also implemented as improvements to
0 commit comments