- 积分
- 103
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2021-11-1
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
代码如下:
import matplotlib.pyplot as plt
import numpy as np
import cmaps
import matplotlib.ticker as mticker
fig = plt.figure(figsize=(8,7))
# plt.subplots_adjust(left=0.24, right=0.76, top=0.90,bottom=0.3, wspace=0.01, hspace=0.05)
x = list(range(1, 8))
scatter = plt.scatter(x, x, s=10*np.array(x)**2, c=x, cmap=cmaps.BlGrYeOrReVi200)
plt.xticks([1, 2, 3, 4, 5, 6], ['2003', '2004', '2005', '2006', '2007', '2008'])
plt.legend(*scatter.legend_elements(prop='sizes', num = 5, alpha = 0.3), ncol = 5, frameon=False, title = 'Duration(days)')
fc = fig.colorbar(scatter, extend = 'both', orientation='horizontal', label = 'Averaged magnitude(AOD)', fraction = 0.05)
fc.outline.set_color('none')
ax1 = fc.ax
ax1.tick_params(which='major',direction='out',labelsize=10,length=5)
ax1.xaxis.set_minor_locator(mticker.MultipleLocator(0.25))
plt.show()
|
|