The spines are the four border lines of an Axes. Removing the top and right ones — a "chart junk" cleanup — instantly makes a plot look more modern and professional. Gridlines, used lightly, aid reading values.
Cleaning up spines
ax.spines["top"].set_visible(False)ax.spines["right"].set_visible(False)# now only the left and bottom borders remain — cleaner
Gridlines
ax.grid(True, axis="y", alpha=0.3) # faint horizontal gridlines onlyax.set_axisbelow(True) # draw grid behind the data
Key takeaways
- 01Spines are the Axes border lines; hiding top/right cleans up the look.
- 02ax.grid(axis="y", alpha=0.3) adds faint gridlines to aid reading.
- 03set_axisbelow(True) puts the grid behind the data.
- 04Reducing non-data ink (chart junk) makes the data stand out.
