ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Fri, 09 Feb 2018 16:20:43 +0100Using Sage plotting capability on data from PARI/GP (1)https://ask.sagemath.org/question/41048/using-sage-plotting-capability-on-data-from-parigp-1/ This is a short follow-up question from [this one](https://ask.sagemath.org/question/41029/using-sage-plotting-capability-on-data-from-parigp/).
I would like to produce an implicit plot (a contour plot where the real or imaginary values of a function are zero):
var('x,y,s')
g=real(zeta(s))
implicit_plot(lambda x,y:g(x+y*I),(x,-3,3),(y,-3,3))
This works fine, however I want to use GP/Pari to evaluate the zeta function and therefore wrote:
var('x,y')
g=gp("H(s)=zeta(s)")
implicit_plot(lambda x,y:real_part(g(x+y*I)),(x,-3,3),(y,-3,3))
but then keep getting an error message:
**PARI/GP ERROR:
*** at top-level: sage[45020]=sage[16][1]
*** ^---
*** incorrect type in _[_] OCcompo1 [not a vector] (t_REAL).**
For 'normal' plots like this one:
var('x')
g=gp("H(s)=real(zeta(s))")
plot(lambda x:(g(x)),(x,3,6))
the interface with GP works fine, so I probably do something wrong using multiple variables or complex numbers? It doesn't seem to be zeta-function specific (like the pole at s=1), since it also fails for e.g. the cos-function.
Grateful for any advice on how to make this work.
Thanks!RuudHFri, 09 Feb 2018 16:20:43 +0100https://ask.sagemath.org/question/41048/