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

Skip to content

Commit a89ef1f

Browse files
authored
Merge branch 'matplotlib:main' into documentation_1
2 parents 0845d27 + b86ebba commit a89ef1f

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
``mathtext`` now supports ``\text``
22
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
33

4-
``\text`` can be used to obtain upright text within an equation.
4+
``\text`` can be used to obtain upright text within an equation and to get a plain dash
5+
(-).
56

67
.. plot::
78
:include-source: true
89
:alt: Illustration of the newly added \text command, showing that it renders as normal text, including spaces, despite being part of an equation. Also show that a dash is not rendered as a minus when part of a \text command.
910

10-
import matplotlib.pyplot as plt
11-
plt.text(0.1, 0.5, r"$a = \sin(\phi) \text{ such that } \phi = \frac{x}{y}$")
12-
plt.text(0.1, 0.3, r"$\text{dashes (-) are retained}$")
11+
import matplotlib.pyplot as plt
12+
plt.text(0.1, 0.5, r"$a = \sin(\phi) \text{ such that } \phi = \frac{x}{y}$")
13+
plt.text(0.1, 0.3, r"$\text{dashes (-) are retained}$")

galleries/users_explain/axes/autoscale.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,15 @@
2929
# %%
3030
# Margins
3131
# -------
32-
# The default margin around the data limits is 5%:
32+
# The default margin around the data limits is 5%, which is based on the
33+
# default configuration setting of :rc:`axes.xmargin`, :rc:`axes.ymargin`,
34+
# and :rc:`axes.zmargin`:
3335

3436
print(ax.margins())
3537

3638
# %%
37-
# The margins can be made larger using `~matplotlib.axes.Axes.margins`:
39+
# The margin size can be overridden to make them smaller or larger using
40+
# `~matplotlib.axes.Axes.margins`:
3841

3942
fig, ax = plt.subplots()
4043
ax.plot(x, y)

0 commit comments

Comments
 (0)