import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D

theta = np.linspace(0, 2 * np.pi, 401)
a = 0.3
m = 11
n = 9
x = (1 + a * np.cos(n * theta)) * np.cos(m * theta)
y = (1 + a * np.cos(n * theta)) * np.sin(m * theta)
z = a * np.sin(n * theta)

fig = plt.figure()
ax = fig.add_subplot(projection="3d")
ax.plot(x, y, z, "g", linewidth=4)
ax.set_zlim3d(-1.0, 1.0)
ax.set_xlabel("x")
ax.set_ylabel("y")
ax.set_zlabel("z")
ax.set_title("Una espiral como curva parametrica", weight="bold", size=16)
# fig.savefig('torus.pdf')
plt.show()