简体   繁体   English

如何配置Qt4Agg后端的行为?

[英]How do I configure the behavior of the Qt4Agg backend?

In an earlier question I learned that the behavior on show() was dependent on the backend in use by matplotlib. 在一个较早的问题中,我了解到show()上的行为取决于matplotlib使用的后端 At that time I was looking for a way to keep show() from deleting the drawing elements of a figure, concluding that by switching from Qt4Agg to TkAgg, the drawing elements would be preserved even if the figures were closed. 当时我正在寻找一种方法,以防止show()删除图形中的图形元素,从而得出结论,即使从图形中关闭,也可以从Qt4Agg切换到TkAgg,从而保留图形元素。 I would like to increase my superpowers by learning, if possible, how to configure the Qt4agg backend to behave as desired. 我想通过学习(如果可能)如何配置Qt4agg后端以使其表现理想来增加我的超能力。

Instead of trying to exercise extra control over the backend, just create the figures and keep references to them yourself, as shown in the highest-rated answer to your first question. 无需尝试对后端进行额外的控制,只需创建数字并自己保留对它们的引用即可,如第一个问题的最高评价所示。 The problem with trying to manipulate the backend, as you are asking to do here, is that the backend is not intended to hand your figures back to you intact once you have looked at them; 正如您要在此处进行的那样,尝试操作后端的问题在于,一旦查看了这些数据,后端就无意将其完整地交给您。 that's not normally the backend's job. 通常这不是后端的工作。 See: matplotlib figures disappearing between show() and savefig() 请参阅: matplotlib数字在show()和savefig()之间消失

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM