usage of matplotlib, focus on the format!
# import
import matplotlib.pyplot as plt
# coordinates for scatter plot, and define related marker.
plt.scatter(x, y, marker='.')
plt.scatter(np.mean(x_set), np.mean(y_set), marker='*')
# set format of x and y axis.
ax = plt.gca()
# self define the origin of the x and y axis locating on a special point.
ax.spines['left'].set_position(('data', np.mean(x_set)))
ax.spines['bottom'].set_position(('data', np.mean(y_set)))
# add the label
plt.xlabel('Longitude')
plt.ylabel('Latitude')
# show in a new window
plt.show()
|