Hello,

I know how to remove a line from an axes. But a I also want to remove the label of the line from the legend of the axes.

In the sample code you can see two labels in the legend, while there is only one line in the axes left.


import numpy as N
from matplotlib.pyplot import *

x = N.linspace(-10,10,201)
ax = figure().add_subplot(111)
ax.plot(x, x**2, label="$x^2$")
ax.plot(x, x**3, label="$x^3$")
ax.legend()
ax.lines[0].remove()
show()


Regards
Magnus