First time here? Check out the FAQ!

Ask Your Question
2

Add legend to implicit_plot for different parameter values

asked 7 years ago

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)
Preview: (hide)

1 Answer

Sort by » oldest newest most voted
2

answered 7 years ago

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.

Preview: (hide)
link

Comments

Thanks for the information

flucoe gravatar imageflucoe ( 7 years ago )

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: 7 years ago

Seen: 1,289 times

Last updated: Dec 28 '17