Форум сайта python.su
Всем привет! Я пытаюсь построить сферическую спираль с помощью Matplotlib. Собственно, кой-чего я уже достиг:
from matplotlib.pyplot import *
from numpy import linspace, cos, sin, sqrt, tan, sinh, cosh, tanh, fabs
from mpl_toolkits.mplot3d import Axes3D
r = 50
m = 0.038
t = linspace(-100.0, 100.0, 1000)
l = 0.9
x = r * cos(t) / cosh(m * (t-l))
y = r * sin(t) / cosh(m * (t-l))
z = r * tanh(m * (t-l))
fig = figure(figsize=(4,4))
ax = fig.add_subplot(111,projection='3d')
ax.view_init(30,60)
ax.plot(x,y,z)
ax.set_xlabel(r'x')
ax.set_ylabel(r'y')
ax.set_zlabel(r'z')
fig.savefig("Test.svg",bbox_inches="tight",\
pad_inches=.15)
Отредактировано stratumx (Дек. 2, 2014 17:29:52)
Офлайн