Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a4ccb37

Browse files
committed
Added suggestions from the MEP PR comments
1 parent 9cb29a4 commit a4ccb37

1 file changed

Lines changed: 26 additions & 1 deletion

File tree

doc/devel/MEP/MEP29.rst

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,38 @@ Implementation
4545

4646
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.
4747

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+
4867

4968
Backward compatibility
5069
======================
5170

5271
None at the moment since it is only a proof of concept
5372

73+
5474
Alternatives
5575
============
5676

57-
None (to my knowledge)
77+
As proposed by @anntzer, this could be also implemented as improvements to
78+
mathtext. For example::
79+
80+
r"$\text{Hello \textbf{world}}$"
81+
r"$\text{Hello \textcolor{blue}{world}}$"
82+
r"$\text{Hello \textsf{\small world}}$"

0 commit comments

Comments
 (0)