Ask Your Question
2

Add legend to implicit_plot for different parameter values

asked 2017-12-22 00:54:19 +0100

flucoe gravatar image

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)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2017-12-28 19:08:50 +0100

eric_g gravatar image

Unfortunately, this is a known bug: labels of implicit plots are not displayed. The bug is reported as ticket #15903 on Sage Developer Trac, but it has not been corrected yet.

edit flag offensive delete link more

Comments

Thanks for the information

flucoe gravatar imageflucoe ( 2018-01-03 05:17:21 +0100 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2017-12-22 00:54:19 +0100

Seen: 1,209 times

Last updated: Dec 28 '17