Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from pylab import *
- import matplotlib.pyplot as plt
- import numpy as np
- data = ((57, 43), (59, 55), (61, 55),(76, 80))
- color = ("red", "green", "blue", "black",)
- groups = ("SAPA", "Hanoi", "Phu Quac", "Qhin Nhon",)
- areas = (10, 20, 30, 40)
- fig = plt.figure()
- ax = fig.add_subplot(1, 1, 1)
- #for data, color, group in zip(data, colors, groups):
- for data, color, group,area in zip(data, colors, groups,areas):
- x, y = data
- #plt.scatter(x, y, s=area, c=colors, alpha=0.5)
- #ax.scatter(x, y, alpha=0.8, c=color, edgecolors='none', s=30, label=group)
- ax.spines['bottom'].set_position(('axes', 0.5))
- ax.spines['left'].set_position(('axes', 0.5))
- ax.spines['right'].set_visible(False)
- ax.spines['top'].set_visible(False)
- ax.set_xlim(0,100)
- ax.set_ylim(0,100)
- ax.set_title('FC Hostel Investment Analysis Vietnam', color="red", fontweight="bold", fontname="Times New Roman Bold")
- ax.set_xlabel("Hostel Market Share")
- ax.set_ylabel("INDEX")
- plt.legend(loc=2)
- ax.xaxis.set_label_coords(0.50, -0.1)
- ax.yaxis.set_label_coords(-0.1, 0.5)
- left,right = ax.get_xlim()
- low,high = ax.get_ylim()
- grid()
- show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement