Skip to content

Commit a2fe623

Browse files
committed
Change drawing order
Change zorder-attribute of the lines so that they are drawn before the tick-labels. This moves the lines to the background and the tick-labels to the foreground.
1 parent 7a3499c commit a2fe623

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

figures/exercice_10.png

-273 Bytes
Loading

scripts/exercice_10.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@
1717
X = np.linspace(-np.pi, np.pi, 256,endpoint=True)
1818
C,S = np.cos(X), np.sin(X)
1919

20-
plt.plot(X, C, color="blue", linewidth=2.5, linestyle="-", label="cosine")
21-
plt.plot(X, S, color="red", linewidth=2.5, linestyle="-", label="sine")
20+
plt.plot(X, C, color="blue", linewidth=2.5, linestyle="-", label="cosine",
21+
zorder=-1)
22+
plt.plot(X, S, color="red", linewidth=2.5, linestyle="-", label="sine",
23+
zorder=-2)
2224

2325

2426
plt.xlim(X.min()*1.1, X.max()*1.1)

0 commit comments

Comments
 (0)