[Matplotlib-users] Rabinovich...

2015-05-30 Thread Prahas David Nafissian
Hello,

My latest fractal music video, made with
MatPlotLib.

Enjoy!

--Prahas

https://www.youtube.com/watch?v=kh6ZLvpWr5kfeature=youtu.be

--
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Lorenz: A Composition

2015-04-01 Thread Prahas David Nafissian
Hi,

For a little right brain diversion, here's what I created
using matplotlib:

https://www.youtube.com/watch?v=gWkFnPHbHokfeature=youtu.be

Enjoy!

--Prahas
--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Set a 3-D point?

2015-03-30 Thread Prahas David Nafissian
Hi,

For those of you following the trials and tribulations of moi,
I hacked the solution.  The assignment is:

x0 = [ [-1.0,0.0,0.5] ]

I printed the orig x0.  Printed mine.  Noticed mine was missing
a set of brackets.  Tried it.  Success!

--Prahas




On Sun, Mar 29, 2015 at 10:07 AM, Prahas David Nafissian 
prahas.mu...@gmail.com wrote:


 Hi Mat-Plotters,

 I'm trying to modify the below code so that I can
 set the initial conditions to (-1,0,0.5).

 The code below randomly sets the initial conditions:

 **

 # I changed the equation -- it's not Lorenz.

 N_trajectories = 1

 def lorentz_deriv((x, y, z), t0, aa=1.1, yy=0.87):
 Compute the time-derivative of a Lorentz system.
 return [y*(z-1+x*x)+yy*x, x*(3*z+1-x*x)+yy*y, -2*z*(aa+x*y)]

 # Choose random starting points, uniformly distributed from -15 to 15

 np.random.seed(1)

 *# Here's the statement which assigns the initial conditions:*

 x0 = -15 + 30 * np.random.random((N_trajectories, 3))

 **

 I tried simply doing this:

 x0 = (-1,0,0.5)

 but I get this error:

 ValueError: need more than 1 value to unpack


 What am I missing?  What is the correct way to make the assignment?


 Thanks!


 --Prahas





--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Set a 3-D point?

2015-03-29 Thread Prahas David Nafissian
Hi Mat-Plotters,

I'm trying to modify the below code so that I can
set the initial conditions to (-1,0,0.5).

The code below randomly sets the initial conditions:

**

# I changed the equation -- it's not Lorenz.

N_trajectories = 1

def lorentz_deriv((x, y, z), t0, aa=1.1, yy=0.87):
Compute the time-derivative of a Lorentz system.
return [y*(z-1+x*x)+yy*x, x*(3*z+1-x*x)+yy*y, -2*z*(aa+x*y)]

# Choose random starting points, uniformly distributed from -15 to 15

np.random.seed(1)

*# Here's the statement which assigns the initial conditions:*

x0 = -15 + 30 * np.random.random((N_trajectories, 3))

**

I tried simply doing this:

x0 = (-1,0,0.5)

but I get this error:

ValueError: need more than 1 value to unpack


What am I missing?  What is the correct way to make the assignment?


Thanks!


--Prahas
--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Lorenz -- another Q

2015-03-11 Thread Prahas David Nafissian
Hi,

Given the Lorenz code shared yesterday, is there a way
to generate a log file of the x,y,z points generated?

Thanks in advance.

--Prahas

In case you deleted the code:


import numpy as np
from scipy import integrate

from matplotlib import pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from matplotlib.colors import cnames
from matplotlib import animation

# orig value of N_traj was 20 -- very cool this way.

N_trajectories = 1

def lorentz_deriv((x, y, z), t0, sigma=10., beta=8./3, rho=28.0):
Compute the time-derivative of a Lorentz system.
return [sigma * (y - x), x * (rho - z) - y, x * y - beta * z]

# Choose random starting points, uniformly distributed from -15 to 15

np.random.seed(1)

# changing from -15,30 to 10,5 below starts the drawing in the middle,
# rather than getting the long line from below
# if using N_Traj  1, return to orig values.

# x0 = -15 + 30 * np.random.random((N_trajectories, 3))

x0 = 10 + 5 * np.random.random((N_trajectories, 3))


# Solve for the trajectories

# orig values:  0,4,1000
# 3rd value -- lower it, it gets choppier.
# 2nd value -- increase it -- more points, but speedier.

# change middle num from 4 to 15 -- this adds points

t = np.linspace(0, 40, 3000)
x_t = np.asarray([integrate.odeint(lorentz_deriv, x0i, t)
  for x0i in x0])

# Set up figure  3D axis for animation
fig = plt.figure()
ax = fig.add_axes([0, 0, 1, 1], projection='3d')

# changing off to on below adds axises.  slows it down but you
# can fix that with interval value in the animation call

ax.axis('on')

# choose a different color for each trajectory
colors = plt.cm.jet(np.linspace(0, 1, N_trajectories))

# set up lines and points -- this is a correction from
# the orig jake code.  the next four lines...

lines = [ax.plot([], [], [], '-', c=c)[0]
for c in colors]
pts = [ax.plot([], [], [], 'o', c=c)[0]
for c in colors]

# prepare the axes limits
ax.set_xlim((-25, 25))
ax.set_ylim((-35, 35))
ax.set_zlim((5, 55))

# set point-of-view: specified by (altitude degrees, azimuth degrees)
ax.view_init(30, 0)

# initialization function: plot the background of each frame
def init():
for line, pt in zip(lines, pts):
line.set_data([], [])
line.set_3d_properties([])

pt.set_data([], [])
pt.set_3d_properties([])
return lines + pts

# animation function.  This will be called sequentially with the frame number
def animate(i):
# we'll step two time-steps per frame.  This leads to nice results.

i = (2 * i) % x_t.shape[1]

for line, pt, xi in zip(lines, pts, x_t):
x, y, z = xi[:i].T
line.set_data(x, y)
line.set_3d_properties(z)

pt.set_data(x[-1:], y[-1:])
pt.set_3d_properties(z[-1:])

# changed 0.3 to 0.05 below -- this slows the rotation of the view.
# changed 30 to 20 below
# changing 20 to (20 + (.1 * i)) rotates on the Z axis.  trippy.

ax.view_init(10, 0.1 * i)
# ax.view_init(10, 100)
fig.canvas.draw()
return lines + pts

# instantiate the animator.  I've deleted the blit switch (for Mac)
# enlarging frames=500 works now -- it failed before because I didn't give it
# enough data -- by changing the t=np.linspace line above I generate
more points.
# interval larger slows it down
# changed inteval from 30 to 200, frames from 500 to 3000

anim = animation.FuncAnimation(fig, animate, init_func=init,
   frames=3000, interval=200)

# Save as mp4. This requires mplayer or ffmpeg to be installed. COMPLEX!
# Instead, use a screen record program:  Quicktime on the Mac; MS
Expression Encoder on PC.
# anim.save('PDNlorentz_attractor.mp4', fps=15, extra_args=['-vcodec',
'libx264'])

plt.show()

--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Lorenz -- another Q

2015-03-11 Thread Prahas David Nafissian
Hello,

Solved the write issue.

I tried numpy savetxt but it chokes on 3D arrays.

So I'm doing this:

x_t.tofile('test3.txt',sep= ,format=%f)

Only issue -- no end-of-lines. But I can write a quick
Pascal program to fix this...

Once again, thanks!

--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Lorenz - solution

2015-03-10 Thread Prahas David Nafissian
I think you need to ask Jake Vanderplas -- the code
is all his!  See the link in the email to get to his blog...

Thanks again!




On Tue, Mar 10, 2015 at 8:49 AM, Benjamin Root ben.r...@ou.edu wrote:
 +1000!!

 Great job! Would you mind if I clean it up a bit and add it to the
 mplot3d/animation gallery? Full credit, of course.


 On Tue, Mar 10, 2015 at 11:30 AM, Prahas David Nafissian
 prahas.mu...@gmail.com wrote:

 Friends,

 I thought you'd like to see the solution.

 Many thanks to Jake Vanderplas for his code and teachings:


 https://jakevdp.github.io/blog/2013/02/16/animating-the-lorentz-system-in-3d/

 If you start a new IP Notebook session, run as your first entry:

 %pylab

 and then copy and paste the text below and run it, you should be good to
 go
 (on a Mac, at least).

 There are several parameters I've changed from his original, and I've
 commented as I've changed.  The original code is at the link above.

 There is one error in his code -- I've documented it below.

 Again, thanks to the community, Jake, and Ben Root.

 --Prahas

 **

 import numpy as np
 from scipy import integrate

 from matplotlib import pyplot as plt
 from mpl_toolkits.mplot3d import Axes3D
 from matplotlib.colors import cnames
 from matplotlib import animation

 # orig value of N_traj was 20 -- very cool this way.

 N_trajectories = 1

 def lorentz_deriv((x, y, z), t0, sigma=10., beta=8./3, rho=28.0):
 Compute the time-derivative of a Lorentz system.
 return [sigma * (y - x), x * (rho - z) - y, x * y - beta * z]

 # Choose random starting points, uniformly distributed from -15 to 15

 np.random.seed(1)

 # changing from -15,30 to 10,5 below starts the drawing in the middle,
 # rather than getting the long line from below
 # if using N_Traj  1, return to orig values.

 # x0 = -15 + 30 * np.random.random((N_trajectories, 3))

 x0 = 10 + 5 * np.random.random((N_trajectories, 3))


 # Solve for the trajectories

 # orig values:  0,4,1000
 # 3rd value -- lower it, it gets choppier.
 # 2nd value -- increase it -- more points, but speedier.

 # change middle num from 4 to 15 -- this adds points

 t = np.linspace(0, 40, 3000)
 x_t = np.asarray([integrate.odeint(lorentz_deriv, x0i, t)
   for x0i in x0])

 # Set up figure  3D axis for animation
 fig = plt.figure()
 ax = fig.add_axes([0, 0, 1, 1], projection='3d')

 # changing off to on below adds axises.  slows it down but you
 # can fix that with interval value in the animation call

 ax.axis('on')

 # choose a different color for each trajectory
 colors = plt.cm.jet(np.linspace(0, 1, N_trajectories))

 # set up lines and points -- this is a correction from
 # the orig jake code.  the next four lines...

 lines = [ax.plot([], [], [], '-', c=c)[0]
 for c in colors]
 pts = [ax.plot([], [], [], 'o', c=c)[0]
 for c in colors]

 # prepare the axes limits
 ax.set_xlim((-25, 25))
 ax.set_ylim((-35, 35))
 ax.set_zlim((5, 55))

 # set point-of-view: specified by (altitude degrees, azimuth degrees)
 ax.view_init(30, 0)

 # initialization function: plot the background of each frame
 def init():
 for line, pt in zip(lines, pts):
 line.set_data([], [])
 line.set_3d_properties([])

 pt.set_data([], [])
 pt.set_3d_properties([])
 return lines + pts

 # animation function.  This will be called sequentially with the frame
 number
 def animate(i):
 # we'll step two time-steps per frame.  This leads to nice results.

 i = (2 * i) % x_t.shape[1]

 for line, pt, xi in zip(lines, pts, x_t):
 x, y, z = xi[:i].T
 line.set_data(x, y)
 line.set_3d_properties(z)

 pt.set_data(x[-1:], y[-1:])
 pt.set_3d_properties(z[-1:])

 # changed 0.3 to 0.05 below -- this slows the rotation of the
 view.
 # changed 30 to 20 below
 # changing 20 to (20 + (.1 * i)) rotates on the Z axis.  trippy.

 ax.view_init(10, 0.1 * i)
 # ax.view_init(10, 100)
 fig.canvas.draw()
 return lines + pts

 # instantiate the animator.  I've deleted the blit switch (for Mac)
 # enlarging frames=500 works now -- it failed before because I didn't give
 it
 # enough data -- by changing the t=np.linspace line above I generate
 more points.
 # interval larger slows it down
 # changed inteval from 30 to 200, frames from 500 to 3000

 anim = animation.FuncAnimation(fig, animate, init_func=init,
frames=3000, interval=200)

 # Save as mp4. This requires mplayer or ffmpeg to be installed.
 COMPLEX!
 # Instead, use a screen record program:  Quicktime on the Mac; MS
 Expression Encoder on PC.
 # anim.save('PDNlorentz_attractor.mp4', fps=15, extra_args=['-vcodec',
 'libx264'])

 plt.show()

 


 --
 Dive into the World of Parallel Programming The Go Parallel Website,
 sponsored
 by Intel and developed in partnership

Re: [Matplotlib-users] Lorenz - solution

2015-03-10 Thread Prahas David Nafissian
@ Adam -- thanks!

@ Everyone:  given the Lorenz code shared, is there a way
to generate a log file of the x,y,z points generated?

Thanks in advance.

--Prahas




On Tue, Mar 10, 2015 at 8:59 AM, Adam Hughes hughesada...@gmail.com wrote:
 That's pretty swag!

 On Tue, Mar 10, 2015 at 11:49 AM, Benjamin Root ben.r...@ou.edu wrote:

 +1000!!

 Great job! Would you mind if I clean it up a bit and add it to the
 mplot3d/animation gallery? Full credit, of course.


 On Tue, Mar 10, 2015 at 11:30 AM, Prahas David Nafissian
 prahas.mu...@gmail.com wrote:

 Friends,

 I thought you'd like to see the solution.

 Many thanks to Jake Vanderplas for his code and teachings:


 https://jakevdp.github.io/blog/2013/02/16/animating-the-lorentz-system-in-3d/

 If you start a new IP Notebook session, run as your first entry:

 %pylab

 and then copy and paste the text below and run it, you should be good to
 go
 (on a Mac, at least).

 There are several parameters I've changed from his original, and I've
 commented as I've changed.  The original code is at the link above.

 There is one error in his code -- I've documented it below.

 Again, thanks to the community, Jake, and Ben Root.

 --Prahas

 **

 import numpy as np
 from scipy import integrate

 from matplotlib import pyplot as plt
 from mpl_toolkits.mplot3d import Axes3D
 from matplotlib.colors import cnames
 from matplotlib import animation

 # orig value of N_traj was 20 -- very cool this way.

 N_trajectories = 1

 def lorentz_deriv((x, y, z), t0, sigma=10., beta=8./3, rho=28.0):
 Compute the time-derivative of a Lorentz system.
 return [sigma * (y - x), x * (rho - z) - y, x * y - beta * z]

 # Choose random starting points, uniformly distributed from -15 to 15

 np.random.seed(1)

 # changing from -15,30 to 10,5 below starts the drawing in the middle,
 # rather than getting the long line from below
 # if using N_Traj  1, return to orig values.

 # x0 = -15 + 30 * np.random.random((N_trajectories, 3))

 x0 = 10 + 5 * np.random.random((N_trajectories, 3))


 # Solve for the trajectories

 # orig values:  0,4,1000
 # 3rd value -- lower it, it gets choppier.
 # 2nd value -- increase it -- more points, but speedier.

 # change middle num from 4 to 15 -- this adds points

 t = np.linspace(0, 40, 3000)
 x_t = np.asarray([integrate.odeint(lorentz_deriv, x0i, t)
   for x0i in x0])

 # Set up figure  3D axis for animation
 fig = plt.figure()
 ax = fig.add_axes([0, 0, 1, 1], projection='3d')

 # changing off to on below adds axises.  slows it down but you
 # can fix that with interval value in the animation call

 ax.axis('on')

 # choose a different color for each trajectory
 colors = plt.cm.jet(np.linspace(0, 1, N_trajectories))

 # set up lines and points -- this is a correction from
 # the orig jake code.  the next four lines...

 lines = [ax.plot([], [], [], '-', c=c)[0]
 for c in colors]
 pts = [ax.plot([], [], [], 'o', c=c)[0]
 for c in colors]

 # prepare the axes limits
 ax.set_xlim((-25, 25))
 ax.set_ylim((-35, 35))
 ax.set_zlim((5, 55))

 # set point-of-view: specified by (altitude degrees, azimuth degrees)
 ax.view_init(30, 0)

 # initialization function: plot the background of each frame
 def init():
 for line, pt in zip(lines, pts):
 line.set_data([], [])
 line.set_3d_properties([])

 pt.set_data([], [])
 pt.set_3d_properties([])
 return lines + pts

 # animation function.  This will be called sequentially with the frame
 number
 def animate(i):
 # we'll step two time-steps per frame.  This leads to nice results.

 i = (2 * i) % x_t.shape[1]

 for line, pt, xi in zip(lines, pts, x_t):
 x, y, z = xi[:i].T
 line.set_data(x, y)
 line.set_3d_properties(z)

 pt.set_data(x[-1:], y[-1:])
 pt.set_3d_properties(z[-1:])

 # changed 0.3 to 0.05 below -- this slows the rotation of the
 view.
 # changed 30 to 20 below
 # changing 20 to (20 + (.1 * i)) rotates on the Z axis.  trippy.

 ax.view_init(10, 0.1 * i)
 # ax.view_init(10, 100)
 fig.canvas.draw()
 return lines + pts

 # instantiate the animator.  I've deleted the blit switch (for Mac)
 # enlarging frames=500 works now -- it failed before because I didn't
 give it
 # enough data -- by changing the t=np.linspace line above I generate
 more points.
 # interval larger slows it down
 # changed inteval from 30 to 200, frames from 500 to 3000

 anim = animation.FuncAnimation(fig, animate, init_func=init,
frames=3000, interval=200)

 # Save as mp4. This requires mplayer or ffmpeg to be installed.
 COMPLEX!
 # Instead, use a screen record program:  Quicktime on the Mac; MS
 Expression Encoder on PC.
 # anim.save('PDNlorentz_attractor.mp4', fps=15, extra_args=['-vcodec',
 'libx264'])

 plt.show

[Matplotlib-users] Lorenz - solution

2015-03-10 Thread Prahas David Nafissian
Friends,

I thought you'd like to see the solution.

Many thanks to Jake Vanderplas for his code and teachings:

https://jakevdp.github.io/blog/2013/02/16/animating-the-lorentz-system-in-3d/

If you start a new IP Notebook session, run as your first entry:

%pylab

and then copy and paste the text below and run it, you should be good to go
(on a Mac, at least).

There are several parameters I've changed from his original, and I've
commented as I've changed.  The original code is at the link above.

There is one error in his code -- I've documented it below.

Again, thanks to the community, Jake, and Ben Root.

--Prahas

**

import numpy as np
from scipy import integrate

from matplotlib import pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from matplotlib.colors import cnames
from matplotlib import animation

# orig value of N_traj was 20 -- very cool this way.

N_trajectories = 1

def lorentz_deriv((x, y, z), t0, sigma=10., beta=8./3, rho=28.0):
Compute the time-derivative of a Lorentz system.
return [sigma * (y - x), x * (rho - z) - y, x * y - beta * z]

# Choose random starting points, uniformly distributed from -15 to 15

np.random.seed(1)

# changing from -15,30 to 10,5 below starts the drawing in the middle,
# rather than getting the long line from below
# if using N_Traj  1, return to orig values.

# x0 = -15 + 30 * np.random.random((N_trajectories, 3))

x0 = 10 + 5 * np.random.random((N_trajectories, 3))


# Solve for the trajectories

# orig values:  0,4,1000
# 3rd value -- lower it, it gets choppier.
# 2nd value -- increase it -- more points, but speedier.

# change middle num from 4 to 15 -- this adds points

t = np.linspace(0, 40, 3000)
x_t = np.asarray([integrate.odeint(lorentz_deriv, x0i, t)
  for x0i in x0])

# Set up figure  3D axis for animation
fig = plt.figure()
ax = fig.add_axes([0, 0, 1, 1], projection='3d')

# changing off to on below adds axises.  slows it down but you
# can fix that with interval value in the animation call

ax.axis('on')

# choose a different color for each trajectory
colors = plt.cm.jet(np.linspace(0, 1, N_trajectories))

# set up lines and points -- this is a correction from
# the orig jake code.  the next four lines...

lines = [ax.plot([], [], [], '-', c=c)[0]
for c in colors]
pts = [ax.plot([], [], [], 'o', c=c)[0]
for c in colors]

# prepare the axes limits
ax.set_xlim((-25, 25))
ax.set_ylim((-35, 35))
ax.set_zlim((5, 55))

# set point-of-view: specified by (altitude degrees, azimuth degrees)
ax.view_init(30, 0)

# initialization function: plot the background of each frame
def init():
for line, pt in zip(lines, pts):
line.set_data([], [])
line.set_3d_properties([])

pt.set_data([], [])
pt.set_3d_properties([])
return lines + pts

# animation function.  This will be called sequentially with the frame number
def animate(i):
# we'll step two time-steps per frame.  This leads to nice results.

i = (2 * i) % x_t.shape[1]

for line, pt, xi in zip(lines, pts, x_t):
x, y, z = xi[:i].T
line.set_data(x, y)
line.set_3d_properties(z)

pt.set_data(x[-1:], y[-1:])
pt.set_3d_properties(z[-1:])

# changed 0.3 to 0.05 below -- this slows the rotation of the view.
# changed 30 to 20 below
# changing 20 to (20 + (.1 * i)) rotates on the Z axis.  trippy.

ax.view_init(10, 0.1 * i)
# ax.view_init(10, 100)
fig.canvas.draw()
return lines + pts

# instantiate the animator.  I've deleted the blit switch (for Mac)
# enlarging frames=500 works now -- it failed before because I didn't give it
# enough data -- by changing the t=np.linspace line above I generate
more points.
# interval larger slows it down
# changed inteval from 30 to 200, frames from 500 to 3000

anim = animation.FuncAnimation(fig, animate, init_func=init,
   frames=3000, interval=200)

# Save as mp4. This requires mplayer or ffmpeg to be installed. COMPLEX!
# Instead, use a screen record program:  Quicktime on the Mac; MS
Expression Encoder on PC.
# anim.save('PDNlorentz_attractor.mp4', fps=15, extra_args=['-vcodec',
'libx264'])

plt.show()



--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Newbie Q re: Lorenz attractor

2015-03-09 Thread Prahas David Nafissian
Dear Ben, Amit, and Ryan,

Thanks so much for your input!  Looking forward to
finding the time to give it a go!

Best,

--Prahas


On Sun, Mar 8, 2015 at 7:14 PM, Benjamin Root ben.r...@ou.edu wrote:
 Yes, absolutely it will work... so long as you do not use blitting. Blitting
 for mplot3d is pretty much useless anyway (I think draws of the axes occur
 anyway regardless of the blit mode), but it is also broken for the macosx
 backend, anyway.

 Cheers!
 Ben Root

 On Sun, Mar 8, 2015 at 8:59 PM, Amit Saha amitsaha...@gmail.com wrote:

 On Mon, Mar 9, 2015 at 7:31 AM, Prahas David Nafissian
 prahas.mu...@gmail.com wrote:
  Hi,
 
  I want to create an animation of the Lorenz attractor,
  plotting each new point as it is generated by the
  equations.  So we see the graph being drawn
  over time.

 You will very likely need to use the animation API for this. I
 recently tried to demonstrate the Henon function in a fashion that it
 appears I am drawing it over time:
 https://www.youtube.com/watch?v=76ll818RlpQ

 You can see the code linked from there:

 https://github.com/amitsaha/playground/blob/master/recipes/henon_animation.py

 That might give you a starting point of what you are trying to do.

 
  Also, as it is being drawn, I want to be able to
  rotate the screen in 3 dimensions.

 Sorry, nothing much I can add here.

 Best,
 Amit.

 --
 http://echorand.me


 --
 Dive into the World of Parallel Programming The Go Parallel Website,
 sponsored
 by Intel and developed in partnership with Slashdot Media, is your hub for
 all
 things parallel software development, from weekly thought leadership blogs
 to
 news, videos, case studies, tutorials and more. Take a look and join the
 conversation now. http://goparallel.sourceforge.net/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users



--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Newbie Q re: Lorenz attractor

2015-03-08 Thread Prahas David Nafissian
Hi,

I want to create an animation of the Lorenz attractor,
plotting each new point as it is generated by the
equations.  So we see the graph being drawn
over time.

Also, as it is being drawn, I want to be able to
rotate the screen in 3 dimensions.

Will MatPlot do this on a Mac (10.8.5)?

Thanks!

PS -- here is code using MatPlot to create the full Lorenz:

http://matplotlib.org/examples/mplot3d/lorenz_attractor.html

--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users