Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

plot grids in a figure

Dear all,

I want to plot grids in my plot.

I couldn't find any keyword like 'grid' in the help document of 'plot()' <function sage.plot.plot.plot="">, and hence I tried NUMERICAL PLOTTING:

sage: from pylab import *
sage: t = arange(0.0, 2.0, 0.01)
sage: s = sin(2*pi*t)
sage: P = plot(t, s, linewidth=1.0)
sage: xl = xlabel('time (s)')
sage: yl = ylabel('voltage (mV)')
sage: t = title('About as simple as it gets, folks')
sage: grid(True)
sage: savefig(os.path.join(SAGE_TMP, 'sage.png'))
sage: P 
[<matplotlib.lines.Line2D at 0x7e0a050>] # stored in RAM?

but nothing came out... OK, how can I check if SAGE can call Matplotlib in my OS (openSuSE 12.3) correctly? I have installed and updated 'matplotlib' for Python 2.7 via YaST2.

Thanks in advance!

click to hide/show revision 2
retagged

plot grids in a figure

Dear all,

I want to plot grids in my plot.

I couldn't find any keyword like 'grid' in the help document of 'plot()' <function sage.plot.plot.plot="">, and hence I tried NUMERICAL PLOTTING:

sage: from pylab import *
sage: t = arange(0.0, 2.0, 0.01)
sage: s = sin(2*pi*t)
sage: P = plot(t, s, linewidth=1.0)
sage: xl = xlabel('time (s)')
sage: yl = ylabel('voltage (mV)')
sage: t = title('About as simple as it gets, folks')
sage: grid(True)
sage: savefig(os.path.join(SAGE_TMP, 'sage.png'))
sage: P 
[<matplotlib.lines.Line2D at 0x7e0a050>] # stored in RAM?

but nothing came out... OK, how can I check if SAGE can call Matplotlib in my OS (openSuSE 12.3) correctly? I have installed and updated 'matplotlib' for Python 2.7 via YaST2.

Thanks in advance!