Re: [sage-devel] mpmath and plot incompatibility

2011-03-01 Thread Fredrik Johansson
On Tue, Mar 1, 2011 at 4:30 AM, Francois Bissey
francois.bis...@canterbury.ac.nz wrote:
 On Mon, 28 Feb 2011 at 01:26PM -0800, jtyard wrote:
  I'm running sage 4.6.1 and cannot use plot after loading mpmath.
  Namely, running
 
   from mpmath import *
   plot(lambda t: sin(2*pi*t), [1, 4])
 
  produces no output in the notebook.  I'm loading mpmath because I need
  to make plots of theta functions, and the page
 
 
  http://mpmath.googlecode.com/svn/trunk/doc/build/functions/elliptic.html#
  jacobi-theta-functions
 
  tells me to first run from mpmath import * to gain access to jtheta.

 I'm not 100% sure what's going on, but I do see that mpmath has its own
 plot function, and your from mpmath import * line overwrites Sage's
 usual plot function with mpmath's.

 This works:

 sage: import mpmath
 sage: plot(lambda t: mpmath.sin(2*pi*t), (1,4))

 So I guess the question is, why isn't mpmath's plot function working?

 Interestingly mpmath-0.16 and 0.17 have support for matplotlib so presumably
 those can use matplotlib for plot.

mpmath basically justs calls pylab.show(), which doesn't do anything
in the notebook (nor in the Sage interpreter). We could hack mpmath in
Sage to be more clever. Alternatively, perhaps a better solution would
to make pylab.show() work in Sage. Is this feasible?

Fredrik

-- 
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


[sage-devel] mpmath and plot incompatibility

2011-02-28 Thread jtyard
Hi,

I'm running sage 4.6.1 and cannot use plot after loading mpmath.
Namely, running

 from mpmath import *
 plot(lambda t: sin(2*pi*t), [1, 4])

produces no output in the notebook.  I'm loading mpmath because I need
to make plots of theta functions, and the page

http://mpmath.googlecode.com/svn/trunk/doc/build/functions/elliptic.html#jacobi-theta-functions

tells me to first run from mpmath import * to gain access to jtheta.

Presumably this is a bug?

Jon

-- 
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


Re: [sage-devel] mpmath and plot incompatibility

2011-02-28 Thread Dan Drake
On Mon, 28 Feb 2011 at 01:26PM -0800, jtyard wrote:
 I'm running sage 4.6.1 and cannot use plot after loading mpmath.
 Namely, running
 
  from mpmath import *
  plot(lambda t: sin(2*pi*t), [1, 4])
 
 produces no output in the notebook.  I'm loading mpmath because I need
 to make plots of theta functions, and the page
 
 http://mpmath.googlecode.com/svn/trunk/doc/build/functions/elliptic.html#jacobi-theta-functions
 
 tells me to first run from mpmath import * to gain access to jtheta.

I'm not 100% sure what's going on, but I do see that mpmath has its own
plot function, and your from mpmath import * line overwrites Sage's
usual plot function with mpmath's.

This works:

sage: import mpmath
sage: plot(lambda t: mpmath.sin(2*pi*t), (1,4))

So I guess the question is, why isn't mpmath's plot function working?

Dan

--
---  Dan Drake
-  http://mathsci.kaist.ac.kr/~drake
---


signature.asc
Description: Digital signature


Re: [sage-devel] mpmath and plot incompatibility

2011-02-28 Thread Francois Bissey
 On Mon, 28 Feb 2011 at 01:26PM -0800, jtyard wrote:
  I'm running sage 4.6.1 and cannot use plot after loading mpmath.
  Namely, running
  
   from mpmath import *
   plot(lambda t: sin(2*pi*t), [1, 4])
  
  produces no output in the notebook.  I'm loading mpmath because I need
  to make plots of theta functions, and the page
  
  http://mpmath.googlecode.com/svn/trunk/doc/build/functions/elliptic.html#
  jacobi-theta-functions
  
  tells me to first run from mpmath import * to gain access to jtheta.
 
 I'm not 100% sure what's going on, but I do see that mpmath has its own
 plot function, and your from mpmath import * line overwrites Sage's
 usual plot function with mpmath's.
 
 This works:
 
 sage: import mpmath
 sage: plot(lambda t: mpmath.sin(2*pi*t), (1,4))
 
 So I guess the question is, why isn't mpmath's plot function working?
 
Interestingly mpmath-0.16 and 0.17 have support for matplotlib so presumably
those can use matplotlib for plot.

Francois

This email may be confidential and subject to legal privilege, it may
not reflect the views of the University of Canterbury, and it is not
guaranteed to be virus free. If you are not an intended recipient,
please notify the sender immediately and erase all copies of the message
and any attachments.

Please refer to http://www.canterbury.ac.nz/emaildisclaimer for more
information.

-- 
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