diff options
| author | Ralf Gommers <ralf.gommers@gmail.com> | 2021-03-21 23:16:41 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-03-21 23:16:41 +0100 |
| commit | 172251dd0b3629f248c86bbc77ab782ab50d298a (patch) | |
| tree | 043086fa7d9a6bec0cc8795818e8f23c5f7c46ab /doc/source/reference | |
| parent | 5e53c94de47ab5df05778283c0012adf03793dae (diff) | |
| parent | bfb5e9f3450b5ecc19c1093b3f09e61037588ede (diff) | |
| download | numpy-172251dd0b3629f248c86bbc77ab782ab50d298a.tar.gz | |
Merge pull request #18652 from timhoffm/doc-plot
DOC: Update some plotting code to current Matplotlib idioms
Diffstat (limited to 'doc/source/reference')
| -rw-r--r-- | doc/source/reference/routines.polynomials.classes.rst | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/doc/source/reference/routines.polynomials.classes.rst b/doc/source/reference/routines.polynomials.classes.rst index 10331e9c1..5f575bed1 100644 --- a/doc/source/reference/routines.polynomials.classes.rst +++ b/doc/source/reference/routines.polynomials.classes.rst @@ -290,7 +290,8 @@ polynomials up to degree 5 are plotted below. >>> import matplotlib.pyplot as plt >>> from numpy.polynomial import Chebyshev as T >>> x = np.linspace(-1, 1, 100) - >>> for i in range(6): ax = plt.plot(x, T.basis(i)(x), lw=2, label="$T_%d$"%i) + >>> for i in range(6): + ... ax = plt.plot(x, T.basis(i)(x), lw=2, label=f"$T_{i}$") ... >>> plt.legend(loc="upper left") <matplotlib.legend.Legend object at 0x3b3ee10> @@ -304,7 +305,8 @@ The same plots over the range -2 <= `x` <= 2 look very different: >>> import matplotlib.pyplot as plt >>> from numpy.polynomial import Chebyshev as T >>> x = np.linspace(-2, 2, 100) - >>> for i in range(6): ax = plt.plot(x, T.basis(i)(x), lw=2, label="$T_%d$"%i) + >>> for i in range(6): + ... ax = plt.plot(x, T.basis(i)(x), lw=2, label=f"$T_{i}$") ... >>> plt.legend(loc="lower right") <matplotlib.legend.Legend object at 0x3b3ee10> |
