list_plot() not working in a terminal session
Hello,
list_plot() does not produce any plot when I run a script in a terminal (pure text) session. But it does when I run the same script in SAGE's graphical ("notebook()") environment. However, in both ways the execution ends normally (no error messages).
Curiously, if I type list_plot(...array name goes here...) in the terminal after the execution of the aforementioned script, a plot is produced.
Any explanation for that? The script is quite simple and short as shown below.
Thanks for any help.
import time
from sage.all import *
import math
n = [19, 31, 61, 127]
l=len(n)
c = []
for i in range(l-1):
for k in range(i+1,l):
ai = 2**n[i]-1
ak = 2**n[k]-1
temp = ai*ak
print ai, ak, ai*ak
start_cpu = time.clock()
divs = prime_divisors(temp)
cpu_t = time.clock() - start_cpu
c.append((math.log10(1.0*ai*ak),cpu_t))
print divs
print 'CPU time = %.3e \n' % (cpu_t)
list_plot(c)
My setup: OS X 10.10.2, Sage 6.5.beta2. With your exact code, I get the plot displayed (an external viewer, Preview, is started and the plot is displayed there). What OS and what version of Sage are you using?
Hi, Sorry for taking too long to reply. I had problems signing in and had to create another account. I'm using SAGE 6.4 on a Ubuntu 14.04-64bit machine. Thanks.