使摄影图仅适用于一个轴
我在x,z
中有数据,其中x
在度上是经度的,而z是km的高度。
我希望能够使用Cartopy对经度轴的“智能”处理(即,将数据集中到任何选择的点LON0
的能力,该数据可以处理跨周期性边界的数据包装) 。
如果我的坐标为lat
,lon
,这很容易,并且涉及向轴对象发送投影
参数,以及tronfrold
对图对象的参数:
import matplotlib.pyplot as plt
import cartopy.crs as ccrs
fig = plt.figure()
ax = fig.add_subplot(111, projection=ccrs.PlateCarree())
ax.plot(lat, lon, data, transform=ccrs.PlateCarree())
我认为我需要做的是有效地将transform
应用于X轴。换句话说,我想绘制垂直的横截面,而不是水平横截面的标准用例。
编辑:也许我只需要在数据上使用极性变换,其中$ x $被解释为角坐标。但是我需要在没有执行相关投影的情况下进行此转换(我仍然希望我的情节是矩形,我只想以一段时间的方式来表现数据)
I have data in x, z
, where x
is longitude in degrees, and z is an altitude in km.
I'd like to be able to use Cartopy's "intelligent" handling of the longitude axis (namely, the ability to center the data at any chosen point lon0
, which handles the data wrapping across the periodic boundary).
if my coordinates were lat
, lon
, this is easy, and involves sending a projection
argument to the axis object, and a transform
argument to the plot object:
import matplotlib.pyplot as plt
import cartopy.crs as ccrs
fig = plt.figure()
ax = fig.add_subplot(111, projection=ccrs.PlateCarree())
ax.plot(lat, lon, data, transform=ccrs.PlateCarree())
I think what I need to be able to do is effectively only apply the transform
to the x-axis. In other words, I'd like to plot vertical cross sections with the power of Cartopy, rather than the standard use case of horizontal cross sections.
Edit: perhaps all I need to is use a polar transform on the data, where $x$ is interpreted as the angular coordinate. But I would need to do this transformation without doing the associated projection (I still want my plot to be a rectangle, I just want to the data to behave in a period manner)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论