Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Piecewise functions and legend label

If I plot a piecewise function with a legend label like this:

plot(Piecewise([[(0,1),x],[(1,2),x^2]]),legend_label='f(x)')

I get the legend twice. Is there a way to ensure that it appears only one time, i.e. one legend for the whole function?