国产亚洲精品福利在线无卡一,国产精久久一区二区三区,亚洲精品无码国模,精品久久久久久无码专区不卡

當前位置: 首頁 > news >正文

三門峽建設銀行網(wǎng)站緬甸今日新聞

三門峽建設銀行網(wǎng)站,緬甸今日新聞,線上推廣引流是做網(wǎng)站嗎,手機做網(wǎng)站公司有哪些問題 當繪圖時,往往并不需要繪制整塊區(qū)域,而是想聚焦于局部地區(qū),此時我們需要繪制扇形圖。 在cartopy中,只提供普通正方形的框架,如果我們需要其他,邊界,需要自己去繪制,最常見的是…

問題

當繪圖時,往往并不需要繪制整塊區(qū)域,而是想聚焦于局部地區(qū),此時我們需要繪制扇形圖。
在cartopy中,只提供普通正方形的框架,如果我們需要其他,邊界,需要自己去繪制,最常見的是使用set_boundary繪制邊界,set_extend規(guī)定邊界,如:

latmin = 10
latmax = 60
lonmin = 70
lonmax = 140
lats = np.linspace(latmax, latmin, latmax - latmin + 1)
lons = np.linspace(lonmin, lonmax, lonmax - lonmin + 1)
vertices = [(lon, latmin) for lon in range(lonmin, lonmax + 1, 1)] + \[(lon, latmax) for lon in range(lonmax, lonmin - 1, -1)]
boundary = mpath.Path(vertices)
ax.set_boundary(boundary, transform=ccrs.PlateCarree())
ax.set_extent(extent)

需要注意的是,在使用set_boundary裁剪邊界后,需要使用set_extend規(guī)定邊界,否則會出現(xiàn)如下情況:
在這里插入圖片描述

但是,這種方法有著自己的bug與缺陷:比如

  1. 需要自己添加網(wǎng)格和經(jīng)緯度標簽
  2. set_boundary和 set_extend一起使用時,繪制到邊界消失,如:cartopy二次曲線外觀保持
  3. 添加坐標時可能會有A LinearRing must have at least 3 coordinate tuples的報錯。

解決方式

實際上,這個問題原因還是由于投影轉換的問題,在set_extend時,繪制的上下邊界仍然是方形、未被正確投影的邊界,與我們的set_boundary存在沖突,最根本的原因還是在于cartopy對于投影計算的一些缺陷。
這類問題的解決在:GeoAxes.set_extent on non-cylindrical projections得到了充分的討論與解決,主要是使用了這幾行代碼:

lon1, lon2, lat1, lat2 = [-20, 20, 50, 80]
rect = mpath.Path([[lon1, lat1], [lon2, lat1],[lon2, lat2], [lon1, lat2], [lon1, lat1]]).interpolated(50)
proj_to_data = ccrs.PlateCarree()._as_mpl_transform(ax) - ax.transData
rect_in_target = proj_to_data.transform_path(rect)

將我們繪制的邊界進行了轉換。
我自己繪制到圖形示例如下:

import matplotlib.pyplot               as plt
import matplotlib.path                 as mpath
import cartopy.crs                     as ccrs
import cartopy.mpl.ticker              as ctk
import cartopy.feature as cfeature
import cmapscmap = cmaps.BlueDarkRed18
leftlon, rightlon, lowerlat, upperlat = [0,120,65,85]rect = mpath.Path([[leftlon, lowerlat], [rightlon, lowerlat],[rightlon, upperlat], [leftlon, upperlat], [leftlon, lowerlat]]).interpolated(50)proj=ccrs.NearsidePerspective(central_longitude=(leftlon+rightlon)*0.5,central_latitude=(lowerlat+upperlat)*0.5)
fig= plt.figure(figsize=(8,8),dpi=300)#設置畫布大小
ax= fig.add_axes([0.2,0.3,0.5,0.5],projection =proj)
#ax.set_extent(extent, ccrs.PlateCarree())#這樣截出來是方形的
ax.add_feature(cfeature.COASTLINE.with_scale('110m'))proj_to_data = ccrs.PlateCarree()._as_mpl_transform(ax) - ax.transData
rect_in_target = proj_to_data.transform_path(rect)
ax.set_boundary(rect_in_target)
ax.set_xlim(rect_in_target.vertices[:,0].min(), rect_in_target.vertices[:,0].max())
ax.set_ylim(rect_in_target.vertices[:,1].min(), rect_in_target.vertices[:,1].max())gl=ax.gridlines(draw_labels=True, x_inline=False, y_inline=False, linestyle='dashed')
gl.top_labels=False
gl.right_labels=False
gl.rotate_labels=False
gl.xlocator=ctk.LongitudeLocator(4)
gl.ylocator=ctk.LatitudeLocator(6)
gl.xformatter=ctk.LongitudeFormatter(zero_direction_label=True)
gl.yformatter=ctk.LatitudeFormatter()
ax.set_title('AMJ-pc1 & SON-SIC',loc='center',fontsize =12)c1 = ax.contourf(lon1,lat1, s, zorder=0,levels =np.arange(-0.09,0.12,0.03),extend = 'both',cmap=cmap,transform=ccrs.PlateCarree())
c1b =ax.contourf(lon1,lat1, p,[0,0.1 ,1], zorder=1,hatches=['...', None],colors="none",transform=ccrs.PlateCarree())position=fig.add_axes([0.2, 0.2, 0.5, 0.02])
fig.colorbar(c1,cax=position,orientation='horizontal')#,format='%.2f',)
plt.show()

在這里插入圖片描述
另外我們需要指出的是:**該方法不適用于極地投影,即NorthPolarStereo,由于NorthPolarStereo本身投影特性只需一個參數(shù),本身并不適合。
**

極地局部繪制(不推薦)

我們繪制極地投影時,同樣也是使用set_boundary繪制圓形邊界,那么當我們想要繪制扇形時,可以通過只繪制一部分的圓形,通過調整繪制圓的參數(shù)來局部繪制。
詳細例子可見:極地局部圖繪制
在我進行實驗后發(fā)現(xiàn)它存在一些缺陷:
1、難以準確截出自己需要的區(qū)域
2、圖形位置不好確定。
3、同樣不好添加網(wǎng)格標簽。
該方法本質是:繪制整個圓形邊界,而只顯示部分區(qū)域,在繪圖時會給人不過完整的感覺。
直接繪制如下圖,需要自行裁剪或調整繪制:
在這里插入圖片描述
請根據(jù)喜好自行選擇,

http://m.aloenet.com.cn/news/39496.html

相關文章:

  • 微信微網(wǎng)站開發(fā)百度云競價賬戶
  • 上海網(wǎng)站建設找緣魁北京網(wǎng)站提升排名
  • 個人怎么做網(wǎng)站推廣競價推廣是什么意思
  • 織夢系統(tǒng)網(wǎng)站騰訊競價廣告
  • 人防工程做資料的網(wǎng)站sem托管公司
  • 怎么做跑腿網(wǎng)站如何建網(wǎng)站詳細步驟
  • 哪個網(wǎng)站可以做賣房百度詞條優(yōu)化
  • 福州建設網(wǎng)站效果seo關鍵詞優(yōu)化報價價格
  • 網(wǎng)站是怎么做的嗎谷歌網(wǎng)頁版登錄入口
  • 可信的大連網(wǎng)站建設成都百度推廣優(yōu)化創(chuàng)意
  • 浙江建設職業(yè)學校網(wǎng)站刷網(wǎng)站軟件
  • 公司網(wǎng)站建設方案百度推廣管理系統(tǒng)
  • 黃驊港十里金沙灘門票重慶網(wǎng)站seo技術
  • js網(wǎng)站評論框小紅書推廣價目表
  • 華強北 做網(wǎng)站海外推廣營銷平臺
  • 對互聯(lián)網(wǎng)網(wǎng)站的理解網(wǎng)站維護費用
  • 網(wǎng)站權重為零百度快速優(yōu)化排名軟件
  • 網(wǎng)站打開速度很慢濟南疫情最新情況
  • 深圳建筑業(yè)協(xié)會石家莊seo顧問
  • 博野網(wǎng)站建設江西省水文監(jiān)測中心
  • linux怎么做網(wǎng)站怎么提高關鍵詞搜索權重
  • 網(wǎng)站正在開發(fā)中鄭州谷歌優(yōu)化外包
  • wordpress下拉篩選重慶做seo外包的
  • wordpress科技主題網(wǎng)站排名優(yōu)化公司
  • seo優(yōu)化排名推廣排名優(yōu)化系統(tǒng)
  • 網(wǎng)頁設計模板網(wǎng)站推薦外包網(wǎng)絡推廣公司
  • 上海網(wǎng)站開發(fā)公司外包自學seo能找到工作嗎
  • asp網(wǎng)站制作設計教程佛山網(wǎng)站優(yōu)化軟件
  • 海南省住房和城鄉(xiāng)建設廳網(wǎng)站首頁排名前50名免費的網(wǎng)站
  • 網(wǎng)站建設 云計算搜索數(shù)據(jù)