Note
Go to the end to download the full example code.
Choosing the thumbnail of an example#
An example that draws more than once has to say which figure represents it in
the gallery grid. Setting sphinx_gallery_thumbnail_number as a comment
anywhere below the docstring picks a figure by the order it was drawn in; this
example picks the second one.
import matplotlib.pyplot as plt
import numpy as np
try:
import mplstyle_reslumen # noqa: F401
plt.style.use("reslumen")
except ImportError:
pass
Plot 1#
plt.figure()
plt.plot(x, y1, label="sin")
plt.plot(x, y2, label="cos")
plt.legend()
plt.show()
Plot 2#
The one the gallery shows.
plt.figure()
plt.plot(x, y1, label="sin")
plt.plot(x, y2, label="cos")
plt.legend()
plt.xscale("log")
plt.yscale("log")
plt.show()
Total running time of the script: (0 minutes 0.239 seconds)