登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
#Create normal distribution point data
f=addfile('Y:/FARMS/2009_newplot/new_aqua_clear.nc')
x = f['observed'][:]
y = f['calculate'][:]
#Calculate point density
x_g = linspace(x.min(), x.max(), 100)
y_g = linspace(y.min(), y.max(), 100)
z1,x1,y1,z = griddata((x,y), None, xi=(x_g, y_g), method='inside_count')
#Sort the points by density, so that the densest points are plotted last
idx = argsort(z)
x = x[idx]
y = y[idx]
z = z[idx]
#Plot scatter point colored by density
ls = scatter(x, y, s=4, c=z, edgecolor=None, cnum=20)
#plot(x_g,y_g,'r-',linewidth=2,color='black')
colorbar(ls)
#xlim(,) control axis limit
#ylim(,)
title('Scatter density plot example')
ylabel('Estimsted')
xlabel('Observed')
#savefig('Y:/FARMS/2017/plotinput/Himawari_clear.png')
报错如下:
array([1, 3, 9, 11, 24, 25, 28, 30, 36, 41, 43, 45, 51, 65, 69, 73, 74, 78, 81, 82, 86, 89, 91, 94, 108, 129, 174, 202, 211, 215, 261, 268, 281, 282, 283, 287, 289, 290, 296, 297, 298, 306, 311, 312, 314, 326, 327, 328, 331, 332, 333, 334, 338, 339, 342, 343, 357, 360, 365, 366, 367, 370, 373, 378, 387, 391, 392, 397, 398, 401, 402, 415, 433, 451, 492, 502, 504, 509, 512, 523, 524, 538, 551, 552, 613, 628, 639, 640, 656, 657, 777, 779, 787, 813, 849, 851, 861, 866, 874, 876, 877, 881, 897, 898, 900, 901, 908, 909, 910, 914, 923, 929, 930, 936, 941, 944, 945, 953, 957, 966, 969, 977, 980, 982, 985, 989, 993, 997, 1003, 1011, 1012, 1013, 1014, 1015, 1021, 1022, 1107, 1112, 1113, 1142, 1359, 1370, 1384, 1390, 1393, 1396, 1447, 1511, 1515, 1521, 1526, 1528, 1538, 1540, 1546, 1549, 1552, 1554, 1565, 1566, 1569, 1570, 1571, 1573, 1580, 1581, 1587, 1610, 1626, 1627, 1666, 1669, 1686, 1687, 1688, 1689, 1690, 1696, 1717, 1787, 1798, 1803, 1858, 1885, 1934, 1946, 1948, 1952, 1959, 1966, 2019, 2022, 2079, 2081, 2083, 2087, 2093, 2100, 2124, 2125, 2152, ...])
Traceback (most recent call last):
File "Y:\FARMS\2009_newplot\scatterdensity.py", line 12, in <module>
x = x[idx]
File "C:\Apps\Meteoinfo\MeteoInfo\pylib\mipylib\numeric\core\dimarray.py", line 202, in __getitem__
raise IndexError()
IndexError
|