Ask Your Question

flucoe's profile - activity

2019-12-29 17:27:32 +0100 received badge  Popular Question (source)
2019-12-29 17:27:32 +0100 received badge  Notable Question (source)
2018-01-03 05:17:21 +0100 commented answer Add legend to implicit_plot for different parameter values

Thanks for the information

2017-12-26 22:08:41 +0100 received badge  Student (source)
2017-12-22 02:32:52 +0100 asked a question Add legend to implicit_plot for different parameter values

Hi, I want to add a legend to an implicit plot, to plot the same function for different parameter values. I can plot the functions but the legend is not displayed. Is it possible to do it?

var('x y z')
xrange = (x,0,2)
yrange = (y,0,2)
z=1
g1 = implicit_plot(x**3-2*x+y**2==z,xrange,yrange,color='red',legend_label='g1')
z=2 
g2 = implicit_plot(x**3-2*x+y**2==z,xrange,yrange,color='blue',legend_label='g2') 
g = g1+g2
g.legend(True)
g.show(legend_loc='upper right',frame=True)