On Mon, Feb 23, 2009 at 05:40:39AM -0600, Jason Grout wrote: [...] > Yes, that is correct. When someone calls plot(h(f), 0, 20), then h is > evaluated at f first, so if f was 10, then plot(h(f), 0, 20) is exactly > the same as plot(0, 0, 20). In order to call h with the numeric values > between 0 and 20, you need to pass the *function* h, not the output of > evaluating the function at f. > > Things would work differently if h was a symbolic expression, rather > than a python function. For example: > > h(x) = sin(x) > > plot(h(x), (x, 0, 20)) > > or > > plot(h, 0, 20) > > would both give the expected plot, because h(x) is sin(x) (i.e., a > function, not a number), and h is the function x |--> sin(x). And why does
plot(h(x), (x, 0, 20)) with h defined as in Stephanies example, not work? I thought, sage would evaluate h(x) for x values between 0 and 20 and then plot this. Why does this work for h(x) = sin(x) but not for h as defined in Stephanies example? Oliver --~--~---------~--~----~------------~-------~--~----~ 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 URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---