Advertisement
Guest User

Untitled

a guest
Dec 8th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. from pylab import *
  2. from matplotlib import *
  3. from mpmath import *
  4.  
  5. r, R = 1, 2.5
  6. f = lambda u, v: [r*cos(u), (R+r*sin(u))*cos(v), (R+r*sin(u))*sin(v)]
  7. splot(f, [0, 2*pi], [0, 2*pi])
  8.  
  9. ---------------------------------------------------------------------------
  10. TypeError Traceback (most recent call last)
  11. <ipython-input-42-3f3bdff4f661> in <module>()
  12. 5 r, R = 1, 2.5
  13. 6 f = lambda u, v: [r*cos(u), (R+r*sin(u))*cos(v), (R+r*sin(u))*sin(v)]
  14. ----> 7 splot(f, [0, 2*pi], [0, 2*pi])
  15.  
  16. /Users/kevin/anaconda/lib/python2.7/site-packages/mpmath/visualization.pyc in splot(ctx, f, u, v, points, keep_aspect, wireframe, file, dpi, axes)
  17. 227 points = [points, points]
  18. 228 M, N = points
  19. --> 229 u = pylab.linspace(ua, ub, M)
  20. 230 v = pylab.linspace(va, vb, N)
  21. 231 x, y, z = [pylab.zeros((M, N)) for i in xrange(3)]
  22.  
  23. /Users/kevin/anaconda/lib/python2.7/site-packages/numpy/core/function_base.pyc in linspace(start, stop, num, endpoint, retstep, dtype)
  24. 91 stop = stop * 1.
  25. 92
  26. ---> 93 dt = result_type(start, stop, float(num))
  27. 94 if dtype is None:
  28. 95 dtype = dt
  29.  
  30. TypeError: data type not understood
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement