On Thu, May 27, 2010 at 5:32 PM, Vinod <vinodprab...@gmail.com> wrote: > Yes William, Your code works for me as well. I get a neat plot > displayed as yours. Here the software chosen is sage. > > My question is: > > Is it not possible to write a simple matlab code as I wrote before and > select the option Matlab instead of sage in the list of softwares > available and have it working? > It does all the math and displays the result but not the plot.
Unfortunately, that isn't yet possible, but there is a very simple 3-line patch that would fix it. Mike Hansen just told me that he will create such a patch tonight. http://trac.sagemath.org/sage_trac/ticket/9072 -- William > > Vinod > > On May 27, 2:05 pm, William Stein <wst...@gmail.com> wrote: >> On Thu, May 27, 2010 at 12:23 PM, Mike Hansen <mhan...@gmail.com> wrote: >> > On Thu, May 27, 2010 at 12:20 PM, Vinod <vinodprab...@gmail.com> wrote: >> >> The simple matlab code I wrote is functional and the sage server >> >> evaluates it properly and generates the .png file in the directory. >> >> Only issue that need to be addressed is to get the sage server display >> >> the plots in the web browser itself. We are planning to provide this >> >> to a set of students who take summer classes and >> >> it would be really great if we can get this working. >> >> >> rightnow, this creates the nicefig2.png file in the directory home/ >> >> sageserver/matlab/user/ >> >> >> Is it something to do with the directory it writes? >> >> > Yes. In order for this to work, someone needs to implement the chdir >> > method for the Matlab interface. See the example in >> > sage/interfaces/mathematica.py >> >> In the meantime, try this: >> >> import os >> filename = os.path.join(os.path.abspath('.'),'matlabfig1.png') >> matlab.eval("h = figure('Visible', 'off')") >> matlab.eval("plot(1:.1:10, sin(1:.1:10))") >> out = matlab.eval("saveas(h,'%s')"%filename) >> >> See screenshot for proof this works... >> >> -- >> William Stein >> Professor of Mathematics >> University of Washingtonhttp://wstein.org >> >> Screen shot 2010-05-27 at 2.04.31 PM.png >> 52KViewDownload > > -- > 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 > -- William Stein Professor of Mathematics University of Washington http://wstein.org -- 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