Former-commit-id:a02aeb236c
[formerly9f19e3f712
] [formerlya02aeb236c
[formerly9f19e3f712
] [formerly06a8b51d6d
[formerly 64fa9254b946eae7e61bbc3f513b7c3696c4f54f]]] Former-commit-id:06a8b51d6d
Former-commit-id:8e80217e59
[formerly3360eb6c5f
] Former-commit-id:377dcd10b9
24 lines
475 B
Python
Executable file
24 lines
475 B
Python
Executable file
from mpl_toolkits.mplot3d import Axes3D
|
|
import numpy as np
|
|
import matplotlib.pyplot as plt
|
|
|
|
fig = plt.figure()
|
|
ax = Axes3D(fig)
|
|
|
|
x = np.linspace(0, 1, 100)
|
|
y = np.sin(x * 2 * np.pi) / 2 + 0.5
|
|
ax.plot(x, y, zs=0, zdir='z', label='zs=0, zdir=z')
|
|
|
|
colors = ('r', 'g', 'b', 'k')
|
|
for c in colors:
|
|
x = np.random.sample(20)
|
|
y = np.random.sample(20)
|
|
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()
|
|
|