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

Skip to content

Commit 515a166

Browse files
AlainAlain
Alain
authored and
Alain
committed
modified behavior change doc
1 parent 5770305 commit 515a166

File tree

1 file changed

+5
-19
lines changed

1 file changed

+5
-19
lines changed
Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
1-
Support customizing antialiasing for text and annotation
2-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3-
4-
5-
6-
``matplotlib.pyplot.annotate()`` and ``matplotlib.pyplot.text()`` now support parameter ``antialiased``.
7-
When ``antialiased`` is set to ``True``, antialiasing will be applied to the text.
8-
When ``antialiased`` is set to ``False``, antialiasing will be applied to the text.
9-
When ``antialiased`` is not specified, it will use the value from ``rcParams['text.antialiased']``.
1+
Default antialiasing behavior changes for ``Text`` and ``Annotation``
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
103

4+
``matplotlib.pyplot.annotate()`` and ``matplotlib.pyplot.text()`` now support parameter ``antialiased`` when initializing.
115
Examples:
126

137
.. code-block::
@@ -16,15 +10,6 @@ Examples:
1610
plt.text(0.5, 0.5, '6 inches x 2 inches', antialiased=True)
1711
ax.annotate('local max', xy=(2, 1), xytext=(3, 1.5), antialiased=False)
1812
19-
If the text contains math expression, then anaialiasing will be applied by ``rcParams['text.antialiased']`` and ``antialiased`` will have no effect
20-
This applies to the whole text.
21-
Examples:
22-
23-
.. code-block::
24-
25-
plt.text(0.5, 0.25, r"$I'm \sqrt{x}$", antialiased=False)
26-
27-
Also note that antialiasing for coordinate axes will be set with ``rcParams['text.antialiased']`` when they are created and cannot be changed afterwards.
2813
2914
With this new feature, you may want to make sure that you are creating and saving/showing the figure under the same context::
3015

@@ -34,9 +19,10 @@ With this new feature, you may want to make sure that you are creating and savin
3419
ax.annotate('local max', xy=(2, 1), xytext=(3, 1.5))
3520
fig.savefig('/tmp/test.png')
3621

37-
3822
# previously this had an effect, now this is a no-op
3923
fig, ax = plt.subplots()
4024
ax.annotate('local max', xy=(2, 1), xytext=(3, 1.5))
4125
with rccontext(text.antialiased=False):
4226
fig.savefig('/tmp/test.png')
27+
28+
Also note that antialiasing for tick labeles will be set with ``rcParams['text.antialiased']`` when they are created (usually when a ``Figure`` is created) - This means antialiasing for them can no longer be changed by modifying ``rcParams['text.antialiased']``.

0 commit comments

Comments
 (0)