Manually add legend Items Python matplotlib : <p>I am using matlibplot and I would like to manually add items to the legend that are a color and a label. I am adding data to to the plot to specifying there would lead to a lot of duplicates.</p>

<p>My thought was to do:</p>

<pre><code>    ax2.legend(self.labels,colorList[:len(self.labels)])
    plt.legend()
</code></pre>

<p>Where self.labels is the number of items I want legend lables for that takes a subset of the large color list. However this yields nothing when I run it.</p>

<p>Am I missing anything?</p>

<p>Thanks</p>
