Contour plot legend - Matplotlib
问题 As the question says, I have a contour plot and I would like show a legend for if. I'm using the contour plot style that uses: dashed lines for negative levels solid lines for positive values I would like to have a legend for them (dashed == negative and solid == positive). I tried the approaches found here and here. However, as can be seen below, this doesn't show the correct result. # Draw the scalar field level curves div_field = plt.contour(x, y, div_scalar_field, colors='white') rot