以下代码将绘制我希望看到的内容,但我想知道如何编辑颜色条以使其具有标题?
fig = plt.figure()
ax = fig.add_subplot(1,1,1)
x = []
y = []
z = []
with open('TEMP.txt', 'r') as csvfile:
plots = csv.reader(csvfile, delimiter="\t")
for row in plots:
x.append(float(row[0]))
y.append(float(row[1]))
z.append(float(row[2]))
m = Basemap(projection='stere',lat_ts = -25, lat_0 = -25.27 , lon_0 = 133.77, resolution='l',width=14000000, height=10000000)
m.drawcoastlines()
m.drawparallels(np.arange(-80, 80, 20))
m.drawmeridians(np.arange(-180, 181, 20))
m.fillcontinents(color='coral')
lats = x
lons = y
time = z
x, y = m(lons,lats)
sc = m.scatter(x,y,60,z,cmap='jet',marker='o')
plt.colorbar(sc)
plt.show()