scatter = ax.scatter(x,y,marker='o',c=z,edgecolors='none',s=25,label='label' ,cmap='Spectral_r') cbar_ax = plt.gcf().add_axes([0.93, 0.15, 0.02, 0.7])#[left,bottom,width,height] position cbar = fig.colorbar(scatter, cax=cbar_ax, label='Probability density') ax.set_xlab...
(xgrid, ygrid, data=z1.data,cmap='Spectral_r') colorbar = map_base.colorbar(cp,size='3%',pad="5%",label="Kriging_inter") #设置colorbar colorbar.outline.set_edgecolor('none') for spine in ['top','left','right','bottom']: ax.spines[spine].set_visible(None) #隐去轴脊 ax....
imshow(conc[i,0], cmap='Spectral_r') 结果显示为: 可以发现,溶质绕过了低渗透区域。 6 完整代码 %matplotlib inline %config InlineBackend.figure_format = 'svg' import numpy as np import matplotlib.pyplot as plt import flopy config = { 'font.family':'Times New Roman', 'font.size': 15, ...
1importplotnine2fromplotnineimport*3plotnine.options.figure_size = (5, 4.5)4idw_scatter = (ggplot() +5geom_map(js,fill='none',color='gray',size=0.4) +6geom_point(pm,aes(x='经度',y='纬度',fill='PM2.5'),size=5) +7scale_fill_cmap(cmap_name='Spectral_r',name='PM2.5',8breaks=...
()+geom_tile(IDW_grid_df,aes(x='lon',y='lat',fill='idw_value'),size=0.1)+geom_map(js,fill='none',color='gray',size=0.4)+geom_point(pm,aes(x='经度',y='纬度',fill='PM2.5'),size=4,stroke=.3,show_legend=False)+scale_fill_cmap(cmap_name='Spectral_r',name='idw_value',...
+ scale_fill_cmap(name='Spectral_r', breaks=np.arange(0.025, 0.126, 0.05)) + theme_matplotlib() + theme( # legend_position='none', text=element_text(size=14, colour="black"), aspect_ratio=1, dpi=100, figure_size=(4, 4))) ...
zm2=np.ma.masked_where(z>5,z)###3fig=plt.figure(figsize=(2,2),dpi=500)ax=fig.add_axes([0,0,1,1])levels=np.arange(0,20,1)ac1=ax.contourf(X,Y,zm,levels=levels,cmap='Spectral_r')ac2=ax.contourf(X,Y,zm2,levels=levels,cmap='Blues_r') 出现锯齿状误差是因为牵涉到割圆术的...
LATITUDE_FORMATTER#y轴设为纬度格式31#设置colorbar32cbar_kwargs ={33'orientation':'horizontal',34'label':'Potential',35'shrink': 0.8,36}37#画图38levels = np.arange(0,1,0.1)39temp.plot.contourf(ax=ax, levels=levels, cmap='Spectral_r',40cbar_kwargs=cbar_kwargs, transform=ccrs.Plate...
在使用Python扩展库Matplotlib进行可视化时,不少函数支持使用参数cmap指定配色方案。例如,下面的代码模拟了一个3像素的图像并设置了Blues配色方案,实现了从白色到蓝色(蓝色分量饱和度从0到100%)的渐变,根据像素的值插值计算合适的颜色进行填充。 下面的代码设置了Blues_r配色方案,后缀_r表示反向映射,插值计算的方向与Blu...
=LONGITUDE_FORMATTER#x轴设为经度格式gl.yformatter=LATITUDE_FORMATTER#y轴设为纬度格式# 设置colorbarcbar_kwargs={'orientation':'horizontal','label':'Potential','shrink':0.8,}# 画图levels=np.arange(0,1,0.1)temp.plot.contourf(ax=ax,levels=levels,cmap='Spectral_r',cbar_kwargs=cbar_kwargs,...