# Plotting an element in a polynomial ideal

I have a polynomial ring in three variables:

P.<x,y,z> = PolynomialRing(QQ)


and I've eliminated the variable t in an ideal generated by several polynomials to obtain an implicit function in just x and y. I'd like to plot this function. But the plot method, applied to an ideal in just two variables, produces the error:

ValueError: Variable 't' not found


So either I need somehow to introduce this variable into the plot, or pull the function out of the polynomial ring so that it can be plotted as a function of real variables with implicit_plot. But I'm not sure how to do either...any advice would be most helpful!

edit retag close merge delete

Sort by » oldest newest most voted

Something like that

sage: P.<x,y,z> = PolynomialRing(QQ)
sage: I=P.ideal(x*x+y*y-1)
sage: implicit_plot(QQ['x,y'](I.gens()[0]),(x,-2,2),(y,-2,2))


maybe ?

more

That works! Many thanks. I don't think I've ever needed the QQ[...] syntax before, even though it's described in the documentation about univariate polynomial rings .

( 2015-05-26 11:00:35 +0200 )edit

That's just a shortcut for PolynomialRing(QQ,['x','y']).

( 2015-05-26 17:43:21 +0200 )edit