> Is there a way to change the color, or change the line type, etc.
> without recalculating the plot (and waiting a long time again)?

I'm not sure where the slowness is coming in for you.  If the issue is
that f takes a long time to compute -- as opposed to the plotting
itself being really slow for some reason, but if that's the case it's
a harder problem to work around -- then you can either precompute the
values in a list and plot those instead, or simply use a cached
version.

# if f is really an expression
f = x**2
g = CachedFunction(lambda xi: f(x=xi))
plot(g, 0, 10, randomize=False)

# or if it's a Sage function
f(x) = x**2
g = CachedFunction(lambda x: f(x))
plot(g, 0, 10, randomize=False)

# or a python function:
def f(x):
    print 'called with',x
    return x**2

g = CachedFunction(f)
plot(g, 0, 10, randomize=False) # this is very noisy
plot(g, 0, 10, randomize=False) # this is quiet: using the cache

Note that you need to use "randomize=False" in plot if you're doing
this, because otherwise the plot positions are different each time
(!), so caching the function is useless.  I don't understand the
motivation for having that be the default behaviour.


Doug

--
Department of Earth Sciences
University of Hong Kong

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

Reply via email to