If you built the line twice, it will not be displayed in the legend. It really is better to use patheffects. Here are two simple examples:
import matplotlib.pyplot as plt import numpy as np import matplotlib.patheffects as pe

Or if you want to add a line shadow
# create line plot including an simple line shadow using path_effects plt.plot(x, y, color='k', lw=2, path_effects=[pe.SimpleLineShadow(shadow_color='g'), pe.Normal()])

source share