import numpy as np
// Fixing random state for reproducibility
np.random.seed(19680801)
x = np.random.random(20)
y = np.random.random(20)
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Lines on top of scatter
After Change
// Many functions that create a visible object accepts a ``zorder`` parameter.
// Alternatively, you can call ``set_order()`` on the created object later.
x = np.linspace(0, 7.5, 100)
plt.rcParams["lines.linewidth"] = 5
plt.figure()
plt.plot(x, np.sin(x), label="zorder=2", zorder=2) // bottom
plt.plot(x, np.sin(x+0.5), label="zorder=3", zorder=3)
plt.axhline(0, label="zorder=2.5", color="lightgrey", zorder=2.5)
plt.title("Custom order of elements")
l = plt.legend(loc="upper right")