Wilfried_Huss wrote: > > > On 19 Mrz., 16:47, Jason Grout <jason-s...@creativetrax.com> wrote: >> ma...@mendelu.cz wrote: >>> Hello, this command produces one half of a cirle, not 1/4 as excepted. >>> I think that this is a bug in sage 3.4 >>> Robert >>> region_plot([y>0,x>0,x^2+y^2<3], (-3, 3), (-3, >>> 3),plot_points=100,incol='gray').show(aspect_ratio=1) >> I get a quarter-circle on my sage 3.4 and on sagenb.org. Can you try on >> sagenb.org? > > This works: > sage: var('x,y') > sage: region_plot([y>0,x>0,x^2+y^2<3], (x, -3, 3), (y, -3,3)) > > But if one leaves out the variables, one gets an half circle: > sage: region_plot([y>0,x>0,x^2+y^2<3], (-3, 3), (-3,3)) > > I've written a patch which fixes this: > http://trac.sagemath.org/sage_trac/ticket/5567
Ah, yes, good catch. For those that want to know, Sage was interpreting the first two constraints as functions of one variable, so when it plugged in two numbers, Sage behaved as though you had typed x>0, x>0. When I did my example, I explicitly put in the variable names (it's a good habit to be explicit in plotting), so I got the right plot. There should be a standard function that takes a tuple of functions and returns a list of variables for all the functions. This is used all over the plotting code, the fast_callable code, now this code, etc. Basically, there should be a function that, treating a tuple of functions as a vector-valued function, returns the variables used in the vector-valued function. Also, I wonder why fast_float is not used? It could drastically speed up plots. You could just replace the lines like: s = symbolic_expression(f.rhs() - f.lhs()).function(*variables) with s = fast_float(f.rhs() - f.lhs(), *vars) and you'd probably see at least an order of magnitude speedup. (make sure to do "from sage.ext.fast_eval import fast_float" first). 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 -~----------~----~----~----~------~----~------~--~---