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

Skip to content

Commit 995f8cf

Browse files
committed
Added markup MEP
1 parent 4019a8c commit 995f8cf

1 file changed

Lines changed: 58 additions & 0 deletions

File tree

doc/devel/MEP/MEPxx.rst

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
=========================
2+
MEPxx: Text light markup
3+
=========================
4+
5+
.. contents::
6+
:local:
7+
8+
9+
Status
10+
======
11+
12+
Discussion
13+
14+
15+
Branches and Pull requests
16+
==========================
17+
18+
None at the moment, proof of concept only.
19+
20+
Abstract
21+
========
22+
23+
This MEP proposes to add lightweight markup to the text artist.
24+
25+
Detailed description
26+
====================
27+
28+
Using different size/color/family in a text annotation is difficult because the
29+
`text` method accepts argument for size/color/family/weight/etc. that are used
30+
for the whole text. But, if one wants, for example, to have different colors,
31+
one has to look at the gallery where one such example is provided:
32+
http://matplotlib.org/examples/text_labels_and_annotations/rainbow_text.html
33+
34+
This example takes a list of strings as well as a list of colors which makes it
35+
cumbersome to use. An alternative would be to use a restricted set of pango-like markup (see https://developer.gnome.org/pango/stable/PangoMarkupFormat.html) and to interpret this markup.
36+
37+
Some markup examples::
38+
39+
Hello <b>world!</b>`
40+
Hello <span color="blue">world!</span>
41+
42+
43+
Implementation
44+
==============
45+
46+
One proof of concept is provided in markup_example.py but it only handles
47+
horizontal direction.
48+
49+
50+
Backward compatibility
51+
======================
52+
53+
None at the moment since it is only a proof of concept
54+
55+
Alternatives
56+
============
57+
58+
None (to my knowledge)

0 commit comments

Comments
 (0)