How do I plot a helix in SymPy?

  • Topic: Python 
  • Thread starter Thread starter JD_PM
  • Start date Start date
  • Tags Tags
    Helix Plot Python
Join the discussion
Registration is free. Start your own thread to ask a follow-up.
6 replies · 3K views · last reply
JD_PM
Messages
1,125
Reaction score
156
I asked this question on SO, but I am having problems with it (I cannot even get into my account now). It seems that people using the IP I am using are asking a lot and that limits the number of questions I can ask. Please have a look at my question. Here's the link:
[Moderators note: bold large formatting removed. Please use plain text in PF posts.]
https://stackoverflow.com/questions/55576155/how-to-plot-a-helix-in-sympy
After seeing that comment I have tried:

>>>x = sp.symbols('x')
>>>sp.plotting.plot3d_parametric_line(sp.cos(x),sp.sin(x),x, (x,0,10))

But got not plot:

<sympy.plotting.plot.Plot at 0x29104c282e8>

Any help is appreciated.
 
Last edited by a moderator:
Physics news on Phys.org
DrClaude said:
Can you otherwise produce plots? Because the code you wrote works for me.

You can get more information on the plotting command at
https://docs.sympy.org/latest/modules/plotting.html#sympy.plotting.plot.plot3d_parametric_line

Thanks.

Following the same example SymPy provides us with I got the same kind of outcome:

Jupyter notebook cell showing SymPy code: from sympy import symbols, from sympy.plotting import plot3d, x, y = symbols('x y'), and plot3d(x*y, (x, -5, 5), (y, -5, 5)). Output reads <Figure size 640x480 with 1 Axes> and Out[2]: <sympy.plotting.plot.Plot at 0x27a693fd7b8>.


A weird (for me of course, I have just started with SymPy) outcome between <>.

What am I missing?
 
It appears that your python installation is not capable of opening a window for plotting.

You'll have to give details of your setup.
 
  • Like
Likes   Reactions: JD_PM
JD_PM said:
I use Jupyter Notebook for running code.
I found this:
 
  • Like
Likes   Reactions: jim mcnamara and JD_PM
DrClaude said:
I found this:

Thanks, now fixed! :)

3D matplotlib plot of a helix, a blue curve winding around the z axis, with z axis ticks from 0 to 10 and x and y axes from -0.75 to 1.00 and -0.75 to 0.75.