On 02/14/2010 07:44 PM, Dana Ernst wrote:
Apparently, I'm not afraid to ask silly questions...

First, if someone can tell how to find out the answers by myself to some of the 
kinds of questions I'm asking, please let me know.


For these questions, I think sage-support is a great place to find the answers.

3.  I'm trying to do plot some implicit functions.  For example:

implicit_plot(x^3+y^3-2*x*y,(x,-3,3,),(y,-3,3))

(a) Why is the aspect ratio off?


The aspect ratio, by default, approximates the golden ratio, like a lot of plotting programs. Maybe for implicit_plotting, it should default to aspect_ratio=1. In fact, it should default to that for a lot of plots---someone should look at this issue across all of plotting when there is time. There is a trac ticket out there for doing "sensible" aspect ratios for different kinds of plots.



(b) Is there a way to automatically display the axes?

use axes=True

implicit_plot(x^3+y^3-2*x*y,(x,-3,3,),(y,-3,3),axes=True)

(c) Can I color implicit plots?


Yes, using the not-very-intuitive cmap argument. The problem is that we just pass things on to contour plot (i.e., plot the contour f==0), where cmap makes sense, but it's not very intuitive for implicit_plot.

implicit_plot(x^3+y^3-2*x*y,(x,-3,3,),(y,-3,3),axes=True,cmap=['red'])

Can you open a trac ticket to wrap this in a color='red' argument for implicit_plot?


(d) Is there a way to automatically display asymptotes (with dotted or dashed 
lines)?  (My example has one.)


hmmm...this is more difficult for implicit plots. I don't think code is written for it, especially in your case where the asymptote is neither vertical or horizontal. You can, of course, draw a dotted line yourself. Maybe you could make a student project out of writing code to automatically calculating the asymptote, and this could be added to Sage for implicit plots?



4.  When to use f.somecommand() is still mysterious to me.  It seems that some 
times, but not always, you can use somecommand(f).  For example, take

f=(x+1)^2

Then both integral(f,x) and f.integral(x) work.  However, f.is_zero() works, 
but is_zero(f) does not.  Can someone help me understand this (without having 
to learn Python; I'll do that later)?



Certain functions are defined to work like function(f). These are in sage/misc/functional.py, for example. Most functions use the .method() syntax, though, to avoid cluttering the global namespace. Somewhere, somewhen, somebody (William?) wrote code once that would take something like is_zero(f) and automatically try to call f.is_zero() if the is_zero() top-level function wasn't defined. I don't know how to turn that on, though.

Thanks,

Jason

--
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to