在 matplotlib 图中交互式选择系列 [英] Interactive selection of series in a matplotlib plot

查看:65
本文介绍了在 matplotlib 图中交互式选择系列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在寻找一种方法,可以在创建绘图后选择在绘图上可见的系列.

I have been looking for a way to be able to select which series are visible on a plot, after a plot is created.

我需要这个,因为我经常有很多系列的情节.它们太多而无法同时绘制,我需要快速交互地选择哪些系列是可见的.理想情况下,将有一个窗口,其中包含绘图和复选框的系列列表,在其中可以看到带有选中复选框的系列.

I need this as i often have plots with many series. they are too many to plot at the same time, and i need to quickly and interactively select which series are visible. Ideally there will be a window with a list of series in the plot and checkboxes, where the series with the checked checkbox is visible.

有人知道这是否已经在某处实施了吗?如果没有,那么有人可以指导我如何自己做吗?

Does anyone know if this has been already implemented somewhere?, if not then can someone guide me of how can i do it myself?

谢谢!

奥马尔

推荐答案

这完全取决于您愿意付出多少努力以及确切的要求是什么,但您可以打赌它已经在某处实施了:-)

It all depends on how much effort you are willing to do and what the exact requirements are, but you can bet it has already been implemented somewhere :-)

如果主要目的是不使图像混乱,则使用内置功能可能就足够了;您可以在 matplotlib 示例库中找到相关代码:

If the aim is mainly to not clutter the image, it may be sufficient to use the built-in capabilities; you can find relevant code in the matplotlib examples library:

如果你真的想要一个 UI,那么你可以通过限制绘图/数据的数量来保护性能,你通常会使用一个 GUI 工具箱,比如 GTK、QT 或 WX.在这里查看一些文章和示例代码:

If you really want to have a UI, so you can guard the performance by limiting the amount of plots / data, you would typically use a GUI toolbox such as GTK, QT or WX. Look here for some articles and example code:

这篇关于在 matplotlib 图中交互式选择系列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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