工具栏的python奇怪的matplotlib行为

发布于 2025-02-02 14:05:28 字数 680 浏览 5 评论 0原文

一个非常简单的问题。在Python -3中,Ver.10 i构建了相同的简单图。

import matplotlib.pyplot as plt
x = [1, 2, 3, 4, 5, 6]
y = [1, 5, 3, 5, 7, 8]
plt.plot(x, y)
plt.show()

在计算机#II上,请参阅带有8个按钮(图1)的丰富顶部工具栏(#1)的绘图,但是在计算机#2上,我看到一个底部放置的工具栏(#2),只有7个按钮(图2) )。工具栏(#1)和工具栏(#2)的默认功能不同。为什么?如何修复这种奇怪的matplotlib行为,以使工具栏的属性在所有情况下都是相同的?

”底部位置工具栏“

A very simple question. In python -3, ver.10 I build the same simple graph.

import matplotlib.pyplot as plt
x = [1, 2, 3, 4, 5, 6]
y = [1, 5, 3, 5, 7, 8]
plt.plot(x, y)
plt.show()

On computer #I I see plot with a rich top-places toolbar (#1) with 8 buttons (Fig.1), but on computer #2 I see a bottom-placed toolbar (#2) with only 7 buttons (Fig.2). The default functionality of the toolbar (#1) and the toolbar (#2) is different. Why? How can I fix this strange matplotlib behavior so that the property of toolbar would be the same in all cases?

top-placed toolbar

bottom-placed toolbar

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

将军与妓 2025-02-09 14:05:28

答案很简单:计算机#1安装了PYQT5,计算机#2却没有。在计算机#2上安装PIP [PIP安装PYQT5]后,图2中出现相同的工具栏菜单,如图1所示。此外,安装PYQT5之后,AddCopyFighandler软件包(import addCopyFighandler)开始在计算机上在计算机上使用相同的计算机#2方式如计算机#1。最后一个问题是在我的另一篇文章中提出的。因此,通过安装PYQT5来解决这两个问题。

The answer is simple: computer #1 has pyqt5 installed and computer #2 does not. After installing pip [pip install pyqt5] on computer #2, the same toolbar menu appeared in Fig. 2 as in Fig. 1. Moreover, after installing pyqt5, the addcopyfighandler package (import addcopyfighandler) starts working on computer #2 in the same way as on computer #1. The last question was asked in my other post. So, both problems are solved by installing pyqt5.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文