matplotlib动画:更新轴tick ticks
我正在创建一个图像的动画,其轴值随时间变化。
all_data是一个矩阵,其中包含一个斧头时间框架中的一个矩阵,有3个Quatities是经度的纬度和像素值 因此,
lon = All_data[0,0] #-> lon is a 2D nxm matrix
lat = All_data[0,1] #-> lat is a 2D nxm matrix
I = All_data[0,2] #-> I is a 2D nxm matrix
im = axis.pcolormesh(lon,lat,I)
def animate(i):
im.set_array(All_data[i,2])
#code to add here to update axis too
return im
ani = FuncAnimation.....etc
问题在于,此代码不会更新我的X和Y(经度和态度)轴。 有什么方法可以使用PCOLOR或PCOLORMESH甚至IMShow更新图像的轴值? 结果显示在图像中显示,因为您看到轴的值没有更改
I'm creating an animation of an image with axis values varying over time.
All_data is a matrix that contains in one axe time frames inside there are 3 quatities which are longitude latitude and pixel values
so
lon = All_data[0,0] #-> lon is a 2D nxm matrix
lat = All_data[0,1] #-> lat is a 2D nxm matrix
I = All_data[0,2] #-> I is a 2D nxm matrix
im = axis.pcolormesh(lon,lat,I)
def animate(i):
im.set_array(All_data[i,2])
#code to add here to update axis too
return im
ani = FuncAnimation.....etc
The problem is that this code will not update my X and Y (longitude and attitude) axis.
is there any way to update the axis values with images using pcolor or pcolormesh or even imshow?
The results are shown in the image as you see the values of the axis are not changing
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我尚未使用您的代码进行测试(问题可以使用 mwe ),但是您可能能够做类似的事情:
I haven't tested this with your code (the question could use an MWE), but you might be able to do something like: