2017-04-18 2 views
1

私は-100o〜30o lと0〜80o latのデータを持っています。cartopy - lonsとlatを使用したAlbersEqualAreaのリミット領域

私は、この領域のみを表示するために投影を使用したいと思います。私の頭の中で

私はこのようなプロット表示したいと思い、次のように私はAlbersEqualArea投影をしようとすると、しかし

regional map

を:

plt.figure(figsize=(5.12985642927, 3)) 
ax = plt.axes(projection=ccrs.AlbersEqualArea(central_longitude=-35, central_latitude=40, standard_parallels=(0, 80)))  
ax.set_extent([lon180[0], lon180[-1], lat[0], lat[-1]], ccrs.Geodetic()) 

私は、マップの上映を取得します:

regional AEA map

データがある領域を表示する最も良い方法は何ですか?

乾杯、 レイ

答えて

3

矩形以外の境界線を使用する場合は、それを自分で定義する必要があります。次のようなものは、あなたのために働く可能性があります

import cartopy.crs as ccrs 
import matplotlib.pyplot as plt 
import matplotlib.path as mpath 

proj = ccrs.AlbersEqualArea(central_longitude=-35, 
          central_latitude=40, 
          standard_parallels=(0, 80)) 
ax = plt.axes(projection=proj)  
ax.set_extent([-100, 30, 0, 80], crs=ccrs.PlateCarree()) 
ax.coastlines() 

# Make a boundary path in PlateCarree projection, I choose to start in 
# the bottom left and go round anticlockwise, creating a boundary point 
# every 1 degree so that the result is smooth: 
vertices = [(lon, 0) for lon in range(-100, 31, 1)] + \ 
      [(lon, 80) for lon in range(30, -101, -1)] 
boundary = mpath.Path(vertices) 
ax.set_boundary(boundary, transform=ccrs.PlateCarree()) 

plt.show() 

enter image description here

+0

境界についての私に教えてくれてありがとう。プロットにlonとlatsを追加することは、グリッド線を使用して実行可能ではないようです。私はPlateCarree(PC)とAlbersEqualArea(AEA)の使用の間に2つの心があります。私は北大西洋での季節的予測を見ており、AEAは季節的予測が良い熱帯地方に「重み付け」を与えています。しかし、私はNAOを見ており、PCはその地域をよりよく強調するかもしれません。 AxesGridではPCがよりよく見え、lonとlatのティックは利点です。 PCマップ:http://imgur.com/a/GcWFr AEA地図:http://imgur.com/a/Uxl1n 環境設定をお持ちですか? –

-1

私は多分あなたは多分もっとthisのように、プロットに変換としてAlbersEqualAreaを追加する必要があると思います。

関連する問題