legend would work on plot but I can't run my code on plot  (it won't take
the variable y)

plot(x**2-4*x+y**2==0,xrange,yrange,color='red',linewidth=5,legend_label='x^2
- 4x + y^2 == 0')

Traceback (click to the left of this block for traceback)
...
ValueError: free variable: y

Vu,


On Thu, Mar 6, 2014 at 12:24 PM, Liam Dalton <[email protected]>wrote:

> I have similar issues when running your code. However, the same code works
> if you do not do implicit plotting:
>
> var('x y')
> xrange = (x,0,5)
> yrange = (y,0,5)
> f1 = plot(x**2,xrange,color='red',legend_label='x^2 - 4x + y^2 == 0')
> f2 = plot(x,xrange,legend_label='x*y==1')
> result = f1+f2
> result.legend(True)
> result.show(legend_loc='upper right',frame=True)
>
> To me this implies that the problem is with implicit plotting.
>
>
> On Thursday, March 6, 2014 11:02:04 AM UTC-8, tvn wrote:
>>
>> Hi, I try to add legend on a plot (created below) but doesn't seem to
>> have any success.  There was no error, the legends just won't show up.
>>
>>
>> var('x y')
>> xrange = (x,0,5)
>> yrange = (y,0,5)
>> f1 = 
>> implicit_plot(x**2-4*x+y**2==0,xrange,yrange,color='red',linewidth=5,legend_label='x^2
>> - 4x + y^2 == 0')
>> f2 = implicit_plot(x*y==1,xrange,yrange,linewidth=5,legend_
>> label='x*y==1')
>> result = f1+f2
>> result.legend(True)
>> result.show(legend_loc='upper right',frame=True)
>>
>>
>>  --
> You received this message because you are subscribed to a topic in the
> Google Groups "sage-support" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/sage-support/YLKxkk1H04g/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/sage-support.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to