admin管理员组文章数量:1023105
I'd like to plot some tracks around polars with cartopy. When the track through -180:180 lat line, strange line are plotted.
The minimum example and plot is here.
import matplotlib.pyplot as plt
import cartopy.crs as ccrs
fig = plt.figure(figsize=[8, 8])
ax = fig.add_subplot(111, projection=ccrs.SouthPolarStereo())
ax.set_extent([-180, 180, -90, -60], ccrs.PlateCarree())
ax.gridlines(crs=ccrs.PlateCarree())
ax.coastlines()
ax.plot([135, 170, -170], [-71, -75, -75], marker='*', transform=ccrs.PlateCarree())
If I don't use line (i.e., lw=0, marker='.'
), it is not an issue. Do you have more beautiful solution?
I'd like to plot some tracks around polars with cartopy. When the track through -180:180 lat line, strange line are plotted.
The minimum example and plot is here.
import matplotlib.pyplot as plt
import cartopy.crs as ccrs
fig = plt.figure(figsize=[8, 8])
ax = fig.add_subplot(111, projection=ccrs.SouthPolarStereo())
ax.set_extent([-180, 180, -90, -60], ccrs.PlateCarree())
ax.gridlines(crs=ccrs.PlateCarree())
ax.coastlines()
ax.plot([135, 170, -170], [-71, -75, -75], marker='*', transform=ccrs.PlateCarree())
If I don't use line (i.e., lw=0, marker='.'
), it is not an issue. Do you have more beautiful solution?
1 Answer
Reset to default 0Try this instead.
ax.plot([135, 170, -170], [-71, -75, -75],marker='*', transform=ccrs.Geodetic())
I'd like to plot some tracks around polars with cartopy. When the track through -180:180 lat line, strange line are plotted.
The minimum example and plot is here.
import matplotlib.pyplot as plt
import cartopy.crs as ccrs
fig = plt.figure(figsize=[8, 8])
ax = fig.add_subplot(111, projection=ccrs.SouthPolarStereo())
ax.set_extent([-180, 180, -90, -60], ccrs.PlateCarree())
ax.gridlines(crs=ccrs.PlateCarree())
ax.coastlines()
ax.plot([135, 170, -170], [-71, -75, -75], marker='*', transform=ccrs.PlateCarree())
If I don't use line (i.e., lw=0, marker='.'
), it is not an issue. Do you have more beautiful solution?
I'd like to plot some tracks around polars with cartopy. When the track through -180:180 lat line, strange line are plotted.
The minimum example and plot is here.
import matplotlib.pyplot as plt
import cartopy.crs as ccrs
fig = plt.figure(figsize=[8, 8])
ax = fig.add_subplot(111, projection=ccrs.SouthPolarStereo())
ax.set_extent([-180, 180, -90, -60], ccrs.PlateCarree())
ax.gridlines(crs=ccrs.PlateCarree())
ax.coastlines()
ax.plot([135, 170, -170], [-71, -75, -75], marker='*', transform=ccrs.PlateCarree())
If I don't use line (i.e., lw=0, marker='.'
), it is not an issue. Do you have more beautiful solution?
1 Answer
Reset to default 0Try this instead.
ax.plot([135, 170, -170], [-71, -75, -75],marker='*', transform=ccrs.Geodetic())
本文标签: cartopyHow to get smooth track around 180180 longitude with SouthPolarStereoStack Overflow
版权声明:本文标题:cartopy - How to get smooth track around -180:180 longitude with SouthPolarStereo - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745578288a2157154.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论