Formatting lines allows viewers to distinguish between target thresholds, forecasts, historical baselines, and active signals on the same graph.
Switching from a solid marker pen to a dashed stencil ruler or lowering ink opacity.
'-' (solid), '--' (dashed), '-.' (dash-dot), ':' (dotted), 'none' (no line).
plt.plot(x, y, linestyle='--', lw=2)`alpha` accepts a float from 0.0 (completely invisible) to 1.0 (fully opaque).
plt.plot(x, y, alpha=0.5)Avoid the top errors and bad plotting practices that trip up new Python developers
Switch from abstract numbers to relatable Cricket, Cinema & Business charts
Write Matplotlib code to solve the objective and see your live plot render
Plot `x=[0, 5]` and `y=[10, 10]` as a dashed horizontal threshold line with `linestyle='--'`, `color='#FF5C7A'`, and `linewidth=2`.
✓ linestyle✓ plt.plotTest your understanding to unlock the lesson completion badge