On 12/1/10 8:06 PM, akm wrote:
On Dec 1, 3:35 pm, Jason Grout<jason-s...@creativetrax.com>  wrote:

You might just use matplotlib directly in Sage:

See, for example,

http://matplotlib.sourceforge.net/examples/pylab_examples/date_demo_c...

http://matplotlib.sourceforge.net/examples/pylab_examples/date_demo1....

or just look in the gallery:http://matplotlib.sourceforge.net/gallery.html

Thanks for the ideas; that first date demo bombs out on me with this
stack trace:

Traceback (most recent call last):    date2 = datetime.datetime( 2000,
3, 6)
   File "", line 1, in<module>

   File "/tmp/tmpq8Gtm6/___code___.py", line 10, in<module>
     delta = datetime.timedelta(hours=_sage_const_6 )
TypeError: unsupported type for timedelta hours component:
sage.rings.integer.Integer


The internet suggests that's a numpy bug; Sage reports it's using
numpy version 1.3.0 but numpy is up to 1.5.1

I'm running Sage 4.5; maybe upgrading to 4.6 will help.

It's easy to test it on sagenb.org, which is running 4.6. Here it is on demo.sagenb.org (which is less busy than sagenb.org):

http://demo.sagenb.org/home/pub/62/

You'll notice that I changed the line

delta = datetime.timedelta(hours=6)

to

delta = datetime.timedelta(hours=int(6) )

You'll also notice that at the end, instead of show(), I used the savefig command (that's so a graph will show up in the Sage notebook)

That timedelta problem probably won't affect you; it's just used in this example for constructing some data to plot. You see I also included the second example from my post in the worksheet. I've also filed a bug with Sage: http://trac.sagemath.org/sage_trac/ticket/10365

Finally, in that worksheet, you'll see that I tried using a recent feature of Sage for specifying the formatting of ticks. It required converting dates to ordinals. That seems like an inconvenient step, so I've filed an enhancement request with Sage: http://trac.sagemath.org/sage_trac/ticket/10366

Thanks,

Jason



--
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to