On Friday, January 13, 2017 at 4:12:44 PM UTC-8, John H Palmieri wrote: > > > > On Friday, January 13, 2017 at 4:05:59 PM UTC-8, John H Palmieri wrote: >> >> >> >> On Friday, January 13, 2017 at 3:55:24 PM UTC-8, William wrote: >>> >>> On Fri, Jan 13, 2017 at 3:50 PM, John H Palmieri <[email protected]> >>> wrote: >>> > This question comes from >>> > http://stackoverflow.com/questions/41638257/graphics-in-sage-script: >>> if I >>> > have a file "foo.sage" and I want to run "sage foo.sage" and have it >>> pop up >>> > a window displaying a plot, how do I do this? >>> > >>> > For example, if foo.sage contains >>> > >>> > P = plot(sin(x)) >>> > P.show() >>> > >>> > then it prints "Graphics object consisting of 1 graphics primitive" >>> rather >>> > than displaying the plot. I know I can save the plot instead, but is >>> there >>> > an easy way to display it directly? >>> >>> I suspect >>> >>> echo "%load 'a.sage'" | sage >>> >>> would have to work... >>> >> >> That is an interesting idea, but it doesn't work for me: the graphics >> file is stored in a temporary directory which is deleted once Sage exits. >> Maybe that's a reason this won't work at all. >> > > I fixed this by adding "sleep(1)" at the end of the file. >
Also, I should add that %load doesn't work for me. I don't know what it's supposed to do. I used %attach instead. > >> >> John >> >> >> >>> >>> > >>> > -- >>> > John >>> > >>> > -- >>> > You received this message because you are subscribed to the Google >>> Groups >>> > "sage-support" group. >>> > To unsubscribe from this group and stop receiving emails from it, send >>> an >>> > email to [email protected]. >>> > To post to this group, send email to [email protected]. >>> > Visit this group at https://groups.google.com/group/sage-support. >>> > For more options, visit https://groups.google.com/d/optout. >>> >>> >>> >>> -- >>> William (http://wstein.org) >>> >> -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.
