In [1]:
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
%matplotlib inline
In [7]:
L = 10
NG = 100
x = np.linspace(0, L, NG, endpoint=True)
mode_number = 2
y = np.sin(mode_number*2*np.pi*x/L)
plt.plot(x, y)
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
theta = 2 * np.pi / L * x
x_plot = np.cos(theta)
y_plot = np.sin(theta)
z = y
ax.plot(x_plot, y_plot, np.zeros_like(x_plot))
ax.plot(x_plot, y_plot, z)
Out[7]:
In [ ]: