Environnement: Ubuntu 14.04 LTS
Installez IPython Notebook
$ sudo apt-get install ipython-notebook
Installation d'une bibliothèque de calculs numériques et d'une bibliothèque de dessins graphiques
$ sudo apt-get install python-matplotlib python-scipy python-pandas python-sympy python-nose
$ ipython notebook
IPython Notebook se lance sur le navigateur
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
import matplotlib.pyplot as plt
fig = plt.figure()
ax = fig.gca(projection='3d')
colors = ('r', 'g', 'b', 'k')
for c in colors:
x = np.random.sample(30)
y = np.random.sample(30)
ax.scatter(x, y, 0, zdir='y', c=c)
ax.legend()
ax.set_xlim3d(0, 1)
ax.set_ylim3d(0, 1)
ax.set_zlim3d(0, 1)
plt.show()
Recommended Posts