Advertisement
Guest User

Untitled

a guest
Apr 22nd, 2019
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. from mpl_toolkits.mplot3d import axes3d
  2. import matplotlib.pyplot as plt
  3.  
  4. fig = plt.figure()  # fig - figure, yep, logical
  5. ax = fig.add_subplot(111, projection='3d')  # three digit integer, where the first digit is the number of rows,
  6. # the second the number of columns, and the third the index of the subplot.
  7. # Projection - custom projection (rectilinear is default)
  8.  
  9. # Grab some test data.          (gotta work there, duh)
  10. X, Y, Z = axes3d.get_test_data(0.05)    # return a tuple X, Y, Z with a tested data
  11.  
  12. # X и Y заданы кортежом от -30 до 29,5 с шагом 0,5 (видимо ещё происходит деление на 0.05, отсюда такие малые значения)
  13. # Z высчитывается благодаря заданной формуле
  14. # Plot a basic wireframe.
  15. ax.plot_wireframe(X, Y, Z, rstride=10, cstride=10)  # rstride and cstride - step size
  16.  
  17. # т.к. X, Y, Z - кортежи, то делать цикл for с перебором значений здесь не имеет смысла
  18.  
  19. plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement