Re: [sage-support] How to close a plot.

2015-02-05 Thread xeno 20150131
Hi group,

Just in case anyone else posts, against this issue, I need to clarify that 
my OP was about plotting not saving without plotting.  The issue was to 
produce a plot each time a loop is transversed, without leaving behind 
plots from previous iterations of the loop (in practice this could produce 
thousands of plots).

The 'solution' I gave above (by saving pdf files) is simply the most 
effective solution (that I have been able to come up with, that works on my 
system).  Any other solutions are welcome.

Thanks for your interest in this issue.

  Ron



On Thursday, 29 January 2015 23:34:46 UTC, Michael Orlitzky wrote:
>
> On 01/28/2015 10:27 AM, Volker Braun wrote: 
> > On Wednesday, January 28, 2015 at 4:18:50 PM UTC+1, kcrisman wrote: 
> >> Does anyone think this might be useful to add to the FAQ or 
> documentation 
> > (if so, where?)? 
> > 
> > IMHO we should not make any guarantees about the behavior of showing 
> plots 
> > besides that a plot is shown. Anything else, like whether or not a 
> > temporary file is created, depends on the UI (commandline vs. different 
> > notebooks) and is subject to change without notice. 
> > 
>
> The question wasn't really about showing a plot. Basically it was, 
>
>   Q: How do I save a plot without showing it? 
>   A: Use save() instead of show() 
>
> The OP asked about closing plots because all of the examples tell you to 
> use show() to save one. 
>
>

-- 
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 sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] How to close a plot.

2015-01-29 Thread Michael Orlitzky
On 01/28/2015 10:27 AM, Volker Braun wrote:
> On Wednesday, January 28, 2015 at 4:18:50 PM UTC+1, kcrisman wrote:
>> Does anyone think this might be useful to add to the FAQ or documentation 
> (if so, where?)? 
> 
> IMHO we should not make any guarantees about the behavior of showing plots 
> besides that a plot is shown. Anything else, like whether or not a 
> temporary file is created, depends on the UI (commandline vs. different 
> notebooks) and is subject to change without notice.
> 

The question wasn't really about showing a plot. Basically it was,

  Q: How do I save a plot without showing it?
  A: Use save() instead of show()

The OP asked about closing plots because all of the examples tell you to
use show() to save one.

-- 
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 sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] How to close a plot.

2015-01-28 Thread kcrisman

>
>
> > Does anyone think this might be useful to add to the FAQ or 
> documentation (if so, where?)? 
>
> IMHO we should not make any guarantees about the behavior of showing plots 
> besides that a plot is shown. Anything else, like whether or not a 
> temporary file is created, depends on the UI (commandline vs. different 
> notebooks) and is subject to change without notice.
>
>
Well, perhaps in an FAQ one could say "In my specific situation, can I do 
thus-and-such" and then the answer could say "Some people have found it 
possible to do that in this way; no guarantees." 

-- 
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 sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] How to close a plot.

2015-01-28 Thread Volker Braun
On Wednesday, January 28, 2015 at 4:18:50 PM UTC+1, kcrisman wrote:
> Does anyone think this might be useful to add to the FAQ or documentation 
(if so, where?)? 

IMHO we should not make any guarantees about the behavior of showing plots 
besides that a plot is shown. Anything else, like whether or not a 
temporary file is created, depends on the UI (commandline vs. different 
notebooks) and is subject to change without notice.

-- 
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 sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] How to close a plot.

2015-01-28 Thread kcrisman

>
>
>  Thanks for all the advice, it has proved very useful (especially Michael 
> Orlitzky's suggestion regarding .pdf files). In case the solution is of 
> use to others, see below -
>
>
>  As an example I use a file containing code such as -
>
>
>  import time
>
> for i in range(1, 11):
>
>  p=plot(sin(i*x))
>
>  p.save('*path/file_name.pdf*')
>
>  time.sleep(2)
>
>
>  and 'attach' it to a sage session running on a local sage server. 
>

Does anyone think this might be useful to add to the FAQ or documentation 
(if so, where?)? 

> Each time the plot is saved it overwrites the previous version. The pdf 
> reader on my system (Ubuntu gnome, which seems to use 'evince' at the pdf 
> reader) redraws the plot when the file to be plotted changes (I do not know 
> if all pdf reader behave this way).
>
>
>  Therefore, all I need to do to get a running updated plot (without 
> leaving behind thousands of previous plots), is to run the code above, and 
> open the pdf file for viewing.
>
>
>  Thanks again for the assistance,
>
>
>  Ron
>
>
>  
>  
>
> On Saturday, 24 January 2015 12:27:06 UTC, xeno 20150131 wrote:
>>
>> Group, 
>>
>> Thanks for all the replies, I will try them and report back here, I they 
>> work.
>>
>> Thanks again,
>>
>>   Ron
>>
>>
>> On Thursday, 22 January 2015 20:48:39 UTC, Michael Orlitzky wrote:
>>>
>>> On 01/22/2015 07:14 AM, xeno 20150131 wrote: 
>>> >   
>>> > 
>>> > Hi group, 
>>> > 
>>> > A simple question (if the answer is just rtfm, just say so).  I am 
>>> opening 
>>> > a plotting window (In a script that I am attaching to a notebook with 
>>> say – 
>>> > 
>>> > show(plot(sin(x))) 
>>>
>>> Something like this works, but I broke my sage installation so I can't 
>>> test it: 
>>>
>>>   p = plot(sin(x)) 
>>>   p.save('sin.pdf') 
>>>
>>> Other file extensions work somewhat magically if I recall. 
>>>
>>>

-- 
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 sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] How to close a plot.

2015-01-27 Thread xeno 20150131
 

Hi Group,


 Thanks for all the advice, it has proved very useful (especially Michael 
Orlitzky's suggestion regarding .pdf files). In case the solution is of use 
to others, see below -


 As an example I use a file containing code such as -


 import time

for i in range(1, 11):

 p=plot(sin(i*x))

 p.save('*path/file_name.pdf*')

 time.sleep(2)


 and 'attach' it to a sage session running on a local sage server. Each 
time the plot is saved it overwrites the previous version. The pdf reader 
on my system (Ubuntu gnome, which seems to use 'evince' at the pdf reader) 
redraws the plot when the file to be plotted changes (I do not know if all 
pdf reader behave this way).


 Therefore, all I need to do to get a running updated plot (without leaving 
behind thousands of previous plots), is to run the code above, and open the 
pdf file for viewing.


 Thanks again for the assistance,


 Ron


 
 

On Saturday, 24 January 2015 12:27:06 UTC, xeno 20150131 wrote:
>
> Group, 
>
> Thanks for all the replies, I will try them and report back here, I they 
> work.
>
> Thanks again,
>
>   Ron
>
>
> On Thursday, 22 January 2015 20:48:39 UTC, Michael Orlitzky wrote:
>>
>> On 01/22/2015 07:14 AM, xeno 20150131 wrote: 
>> >   
>> > 
>> > Hi group, 
>> > 
>> > A simple question (if the answer is just rtfm, just say so).  I am 
>> opening 
>> > a plotting window (In a script that I am attaching to a notebook with 
>> say – 
>> > 
>> > show(plot(sin(x))) 
>>
>> Something like this works, but I broke my sage installation so I can't 
>> test it: 
>>
>>   p = plot(sin(x)) 
>>   p.save('sin.pdf') 
>>
>> Other file extensions work somewhat magically if I recall. 
>>
>>

-- 
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 sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] How to close a plot.

2015-01-24 Thread xeno 20150131
Group, 

Thanks for all the replies, I will try them and report back here, I they 
work.

Thanks again,

  Ron


On Thursday, 22 January 2015 20:48:39 UTC, Michael Orlitzky wrote:
>
> On 01/22/2015 07:14 AM, xeno 20150131 wrote: 
> >   
> > 
> > Hi group, 
> > 
> > A simple question (if the answer is just rtfm, just say so).  I am 
> opening 
> > a plotting window (In a script that I am attaching to a notebook with 
> say – 
> > 
> > show(plot(sin(x))) 
>
> Something like this works, but I broke my sage installation so I can't 
> test it: 
>
>   p = plot(sin(x)) 
>   p.save('sin.pdf') 
>
> Other file extensions work somewhat magically if I recall. 
>
>

-- 
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 sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] How to close a plot.

2015-01-22 Thread Michael Orlitzky
On 01/22/2015 07:14 AM, xeno 20150131 wrote:
>  
> 
> Hi group,
> 
> A simple question (if the answer is just rtfm, just say so).  I am opening 
> a plotting window (In a script that I am attaching to a notebook with say –
> 
> show(plot(sin(x)))

Something like this works, but I broke my sage installation so I can't
test it:

  p = plot(sin(x))
  p.save('sin.pdf')

Other file extensions work somewhat magically if I recall.

-- 
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 sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] How to close a plot.

2015-01-22 Thread xeno 20150131
 

Hi group,

A simple question (if the answer is just rtfm, just say so).  I am opening 
a plotting window (In a script that I am attaching to a notebook with say –

show(plot(sin(x)))

is within a loop.  I wish to replace the plot each time the loop is 
transversed.  So need to close the plot (otherwise I would end up with 
thousands of plots).  I understand that the default plotting system in sage 
is matplotlib, which closes a plot with the function “close()”.  However, I 
have tried many variations of close, plot and show, but nothing seems to 
close the plot.  I get a variety of error messages, that basically boils 
down to, close() is not a valid option.  Apologies as I am sure the 
solution must be very simple.

Thanks

 

-- 
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 sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.