Advertisement
Saeto

Untitled

Jun 24th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.05 KB | None | 0 0
  1. from pylab import *
  2. import matplotlib.pyplot as plt
  3. import numpy as np
  4.  
  5.  
  6. data = ((57, 43), (59, 55), (61, 55),(76, 80))
  7. colors = ("red", "green", "blue", "black",)
  8. groups = ("SAPA", "Hanoi", "Phu Quac", "Qhin Nhon",)
  9.  
  10.  
  11.  
  12. fig = plt.figure()
  13. ax = fig.add_subplot(1, 1, 1)
  14.  
  15. for data, color, group in zip(data, colors, groups):
  16.     x, y = data
  17.     plt.scatter(x, y, s=area, c=colors, alpha=0.5)
  18.     #ax.scatter(x, y, alpha=0.8, c=color, edgecolors='none', s=30, label=group)
  19. ax.spines['bottom'].set_position(('axes', 0.5))
  20. ax.spines['left'].set_position(('axes', 0.5))  
  21.  
  22. ax.spines['right'].set_visible(False)
  23. ax.spines['top'].set_visible(False)
  24.  
  25. ax.set_xlim(0,100)
  26. ax.set_ylim(0,100)
  27.  
  28.  
  29. ax.set_title('FC Hostel Investment Analysis Vietnam', color="red", fontweight="bold", fontname="Times New Roman Bold")
  30.  
  31. ax.set_xlabel("Hostel Market Share")
  32. ax.set_ylabel("INDEX")
  33.  
  34. plt.legend(loc=2)
  35.  
  36. ax.xaxis.set_label_coords(0.50, -0.1)
  37. ax.yaxis.set_label_coords(-0.1, 0.5)
  38.  
  39.  
  40. left,right = ax.get_xlim()
  41. low,high = ax.get_ylim()
  42.  
  43. grid()
  44.  
  45. show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement