展示 Matplotlib 图像为全屏

展示 Matplotlib 图像为全屏

要将 Matplotlib 图像显示为全屏,可以使用 full_screen_toggle() 方法。

步骤

  • 使用 figure() 方法创建图像或激活现有图像。

  • 使用两个列表绘制一条线。

  • 返回当前图像的图像管理器。

  • 使用 full_screen_toggle() 方法切换全屏图像。

  • 使用 show() 方法显示图像。

示例

from matplotlib import pyplot as plt
plt.rcParams["figure.figsize"] = [7.00, 3.50]
plt.rcParams["figure.autolayout"] = True
plt.figure()
plt.plot([1, 2], [1, 2])
manager = plt.get_current_fig_manager()
manager.full_screen_toggle()
plt.show()
Python

结果

展示 Matplotlib 图像为全屏

Python教程

Java教程

Web教程

数据库教程

图形图像教程

大数据教程

开发工具教程

计算机教程

登录

注册