使摄影图仅适用于一个轴

发布于 2025-01-22 15:22:12 字数 681 浏览 1 评论 0原文

我在x,z中有数据,其中x在度上是经度的,而z是km的高度。

我希望能够使用Cartopy对经度轴的“智能”处理(即,将数据集中到任何选择的点LON0的能力,该数据可以处理跨周期性边界的数据包装) 。

如果我的坐标为latlon,这很容易,并且涉及向轴对象发送投影参数,以及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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文