2011/10/27 Ondřej Čertík <ondrej.cer...@gmail.com>: > Hi Stefan, > > On Wed, Oct 26, 2011 at 12:54 PM, krastanov.ste...@gmail.com > <krastanov.ste...@gmail.com> wrote: >> The visual examples are in test.py in the root (the file will be >> deleted/moved if there is ever a version for merging)- it's meant for copy >> pasting or interactive shell, so you can see how it works. >> >> About the differences: The code in newplot is just a *simplified* interface >> to whichever backend you choose (eg matplotlib, textplot, google chart api, >> the current plotting module, etc). Only textplot and matplotlib backends are >> present (and they are fairly simple). >> >> The *only* advantage of using this code instead directly one of the backends >> it's that you have simplified interface for all of the common tasks >> (including for example coloring as a function of parameters). For >> complicated stuff you can directly access the backend. >> >> So instead of typing >> >> x_points = range(N_points)/float(step) >> y_points = [(x**2).eval(subs={x : point}) for point in x_points] >> do_whatever_you_need_to_do_to_use_THE_CHOSEN_BACKEND() >> >> you write >> >> p = Plot(x**2,x,start,end) >> p.backend = THE_CHOSEN_BACKEND. > > I would suggest to use: > > p = Plot(x**2, (x, start, end)) > > to be compatible with integrate and other parts in SymPy.
The other advantage of this is that you could just do Plot(x**2, x), and it would try to be smart about the range (or maybe it could just use a default range). This syntax also works nicely for 3-d (or more) plots, where you have multiple variables and ranges. Also, would it make sense to rather have it as p = Plot(x**2, (x, start, end), backend=BACKEND) i.e., instantiate the backend with the plot (and maybe backend would have a default None, which would try to choose the best one for you based on what you have installed)? Aaron Meurer > > I mentioned this patch to Aaron at the Google Mentor Summit, but > unfortunately we didn't have time to look into it there. It is very > important to improve the plotting support, so many thanks for the > initiative. I'll try to review this soon and provide suggestions. > > Ondrej > > -- > You received this message because you are subscribed to the Google Groups > "sympy" group. > To post to this group, send email to sympy@googlegroups.com. > To unsubscribe from this group, send email to > sympy+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/sympy?hl=en. > > -- You received this message because you are subscribed to the Google Groups "sympy" group. To post to this group, send email to sympy@googlegroups.com. To unsubscribe from this group, send email to sympy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sympy?hl=en.