change line opacity matplotlib code example Example: matplotlib transparent line plt.plot(x, y, 'r-', alpha=0.7)