D1X - 9 months ago 46
Python Question

# What is the most descriptive way to plot Lorenz System?

I am (numerically) solving the Lorenz System by using different methods. I am plotting it using matplotlib but I would like a way to distinguish better the points.

For example:

Let's assume the points to be plotted are stored in the array

a
which has the form

array([[  0.5       ,   0.5       ,   0.5       ],
[  0.50640425,   0.6324552 ,   0.48965064]])
#...


Now these lines of code

import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
fig = plt.figure()
ax.plot(a[:,0],a[:,1],a[:,2])
plt.show()


produce:

Not very descriptive, is it? So I thought plotting discrete points would work better. So these ones:

import matplotlib.pyplot as plt
from matplotlib import cm
from mpl_toolkits.mplot3d import Axes3D
fig = plt.figure()
ax.scatter(a[:,0],a[:,1],a[:,2], s=0.2)
plt.show()


produce:

But it is not as descriptive as I want. I want to know what is the most descriptive way to plot the Lorenz system.

Consider making your scatter points transparent. You can do this by passing an alpha keyword to plt.scatter. Here's an example, modified from mplot3d example gallery, with alpha = 1.0, which is the default value:
ax.scatter(xs, ys, zs, alpha=1.0, s=0.2)

And here is the same scatter point cloud drawn with alpha = 0.1:
ax.scatter(xs, ys, zs, alpha=0.1, s=0.2)