python3二进制文件读写,Python 能够以文本和二进制两种方式处理文件

  python3二进制文件读写,Python 能够以文本和二进制两种方式处理文件

  导入matplotlib。py绘图为pltimport matplotlib。将导入matplotlib转换为mpl导入图表。CRS作为CCR导入目录。io。形状阅读器作为来自carto py的页面阅读器。mpl。ticker从matplotlib导入经度格式,纬度格式。font _ manager导入字体属性filename=(r .\ data \ SURF _ CLI _ CHN _ MERGE _ CMP _ PRE _ HOUR _ GRID _ 0.10 r \ SURF _ CLI _ CHN _ MERGE _ CMP _ PRE _ HOUR _ GRID _ 0.10 r SURF _ CLI _ CHN _ MERGE _ CMP _ PRE _ HOUR _ GRID _ 0.10-2018 08 17 07。grd )crain,gsamp=read(文件名)crain[crain==-999]=NP。nan shpname=r .\ data \ map \ China _ province provinces _ records=list(shp reader .阅读器(shpname).records())vincents _ geometry s=[x . geometry for x in vincents _ records]font=font properties(fname=r c:\ Windows \ Fonts \ simsun。TTC)平板carree=ccrs .PlateCarree()fig=PLT。figure( Demo ,figsize=(9,6),dpi=100,constrained _ layout=True)ax=PLT。轴(投影=板托架)ax。add _ geometries(provinces _ geometrys,plate carree,edgecolor=gray ,facecolor=None)extent=[70.05,139.95,15.05,59.95]cmap=mpl。颜色([青色,暗青色,绿色, ListedColormapN)im=ax . im show(crain,transform=PlateCarree,origin=upper ,extent=[70,139.95,15,59.95],cmap=cmap,norm=norm,aspect=1.2)cb=fig.colorbar(im,ax=ax,extend=both ,extendrect=True,ticks=bounds,extendfrac=auto ,pad=0.01,shrink=0.8,aspect=40,fraction=0.01中国自动站与CMORPH降水产品融合的逐小时降水量,fontproperties=font,fontsize=23)plt.text(1,-0.07,公众号碎积云,fontproperties=font,transform=ax.transAxes,horizontalalignment=right ,verticalalignment=top ,fontsize=14)plt.text(0.5,0.98, 2018-08-17 07:00(GMT),fontproperties=font,transform=ax.transAxes,horizontalalignment=center ,verticalalignment=top ,font size=15)南海=PLT。我在读(r .\数据\地图\南海诸岛插图. tif)y,x=南海。shape[:2]ax。im show(南海,origin=upper ,extent=[135-10,135,18,18 10/x*y],aspect=1.2)PLT。显示()PLT。保存图(r .\ data \ SURF _ CLI _ CHN _ MERGE _ CMP _ PRE _ HOUR _ GRID _ 0.10 \ demo。png )好~懒~啊~

  喜欢的话请关注吧,天晓得还会更新什么好玩儿的东西:

郑重声明:本文由网友发布,不代表盛行IT的观点,版权归原作者所有,仅为传播更多信息之目的,如有侵权请联系,我们将第一时间修改或删除,多谢。

留言与评论(共有 条评论)
   
验证码: