Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. import numpy as np
  2. f, axs = plt.subplots(1,2,figsize=(8,3))
  3. x = np.array([])
  4. y = np.array([])
  5. for r in range(2):
  6. x = np.append(x, np.array([-r,2*r,-r]))
  7. y = np.append(y, np.array([2*r,-r,-r]))
  8. axs[0].plot(x,y)
  9. axs[0].scatter(x,y)
  10. plt.xlim(-1,2)
  11. plt.ylim(-1,2)
  12. print(list(zip(x,y)))
  13. x = np.array([])
  14. y = np.array([])
  15. for r in range(2):
  16. x = np.append(x, np.array([-r,r,-r]))
  17. y = np.append(y, np.array([r,-r,-r]))
  18. axs[1].plot(x,y)
  19. axs[1].scatter(x,y)
  20. plt.xlim(-1,2)
  21. plt.ylim(-1,2)
  22. print(list(zip(x,y)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement