Python:复制底图或从图形中删除数据 [英] Python: copy basemap or remove data from figure

查看:112
本文介绍了Python:复制底图或从图形中删除数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用底图图形作为背景,并在顶部绘制图形.由于底图图形(极地立体图)的生成非常耗时,因此我只想执行一次.

I want to use a basemap figure as a background and plot things ontop. As the generation of the basemap figure (a polar stereographic plot) is quite time intensive I only want to do this once.

第二步是在该图上绘制一些防风刺,并在同一图上绘制其他防风刺,但不使用第一组倒刺.

The second step would be to draw some wind barbs on this plot and some other wind barbs on the same plot, but without the first set of barbs.

现在我要么复制背景图像,然后绘制两个不同的图像,要么我可以移除第一组倒钩,然后绘制第二组倒钩,所以我不介意走哪条路.

Now either I copy the background image and then draw two different images or I can remove the first set of barbs and then draw the second, I don't mind which way to go.

不幸的是,我的大脑今天没有帮助我,我却一无所获.我将不胜感激.

Unfortunately my brain is not helping me today and I am getting nowhere. I would be grateful for any tips.

推荐答案

如果新的倒钩位于同一位置,则可以使用set_UVC用新的风力数据更新现有对象.

If the new barbs will be in the same place you can use set_UVC to update the existing object with the new wind data.

假设m是您的底图对象,例如:

Assuming m is your basemap object, something like:

n_barb,s_barb = m.barbs(...)
#some code
n_barb.set_UVC(newU,newV,newC)

虽然我没有风力数据可以对此进行测试.

I don't have wind data to test this on though.

这篇关于Python:复制底图或从图形中删除数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆