thank you for you quick answers! it works. but my example in my previous mail was only a simplification of my real problem. your answer works fine with my simplification. but I am not shure what to do with my original problem. I want to plot a function of two variables, but with one variable fixed. I have
def g(f,s): .... (quiet long here with a lot of cases...) and I want to plot for example plot(g(x,90),48,51) the answer of sage is again TypeError: no way to make fast_float from None I think this is a similar problem. but I cannot call it with plot(g(x,48,51), since than it is not clear what variable to use !? regards, steffi Quoting Jason Grout <jason-s...@creativetrax.com>: > > Oliver Block wrote: >> Dear Stefanie, >> >> On Mon, Feb 23, 2009 at 11:55:27AM +0100, Stefanie Schmidt wrote: >> [...] >>> G=plot(h(f), 0, 20) >>> G.show() >> Although I am not a sage expert, I would say, you want the >> following: >> >> G=plot(h, 0, 20) >> G.show() >> >> Do not give an argument to h. > > > 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). > > Jason > > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---