Is it possible to add an entry to the legend in matplotlib without having plotted the corresponding object?
For example, I have two sets of three lines plotted on one graph. They come in pairs, so I want to plot them in corresponding colors, one of them dashed and the other solid.
import matplotlib.pyplot as plt
import numpy as np
for i in range(1,4):
line = plt.plot(i*np.arange(1,10), label=i)[0]
plt.plot(-i*np.arange(1,10), ls='--', color=line.get_color(), label=-i)
plt.legend()
However, instead of having all six items in the legend, (solid blue 1, solid orange 2, solid green 3, dashed blue 1, dashed orange 2, dashed green 3) I'd like to have three (solid blue 1, solid orange 2, solid green 3) and then two additional entries to disambiguate dashed from solid (solid black 'positives', dashed black 'negatives').
How can I add these two entries, since I don't have the solid/dashed black lines plotted?

