2016-10-26 2 views
4

두 점 사이의 큰 원형 거리를 플롯하려고합니다. 나는 cartopy 문서에서 발견 한 (introductory_examples/01.great_circle.html) :cartopy : 큰 원형 거리 선에 대해 더 높은 해상도

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

ax = plt.axes(projection=ccrs.Robinson()) 

ax.set_global() 

ax.coastlines() 

plt.plot([-0.08, 132], [51.53, 43.17], color='red',  transform=ccrs.Geodetic()) 
plt.plot([-0.08, 132], [51.53, 43.17], color='blue', transform=ccrs.PlateCarree()) 

plt.show() 

다음과 같은 이미지를 만듭니다 :

great circle example

것은입니다, 내 자신의 작품에의 두 점은 서로 더 가까워지고 다른 투영법에서 (비록 내가 여기서는 중요하지 않다고 생각하지만).

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

ax = plt.axes(projection=ccrs.Robinson()) 

ax.set_extent([-5, 55, 40, 55]) 

ax.coastlines() 

plt.plot([-0.08, 50], [51.53, 43.17], color='red',  transform=ccrs.Geodetic()) 
plt.plot([-0.08, 50], [51.53, 43.17], color='blue', transform=ccrs.PlateCarree()) 

plt.show() 

이 다음 이미지 수 : shorter line

이 경우 빨간색 큰 원 선이 엉터리 모양을하고있는 것처럼 보인다 나는 작은 영역에서 선 수과 같이이 코드를 변경하는 경우 해상도가 너무 낮아서 큰 원을 구성하는 점수를 늘리려면 어떻게해야합니까?

답변

8

이 문제는 프로젝션에서 하드 코드 된 임계 값 때문입니다. 현재이 사용자 제어 매개 변수 아니지만, 당신은 당신의 자신의 하위 클래스를 정의하는 것으로 해결할 수 있습니다

class LowerThresholdRobinson(ccrs.Robinson): 

    @property 
    def threshold(self): 
     return 1e3 

당신이 축을 정의 할 때이 문제를 제거해야 ccrs.Robinson() 대신 LowerThresholdRobinson()를 사용하는 경우.

관련 문제