Advertisement
MagicWinnie

Untitled

Dec 4th, 2019
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.34 KB | None | 0 0
  1. import matplotlib.pyplot as plt
  2. import matplotlib.patches as mpatches
  3. from matplotlib.collections import PatchCollection
  4.  
  5. n = 6
  6.  
  7. patches = [mpatches.RegularPolygon((0,0), n)]
  8. fig, ax = plt.subplots()
  9. collection = PatchCollection(patches)
  10. ax.add_collection(collection)
  11. plt.axis('equal')
  12. plt.axis('off')
  13. plt.tight_layout()
  14. plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement