gpt4 book ai didi

python - Wonder-twin power "Zoom to rectangle"激活?

转载 作者:太空狗 更新时间:2023-10-30 00:08:15 25 4
gpt4 key购买 nike

enter image description here

有没有办法在显示 matplotlib 图形时默认自动激活“缩放到矩形”工具?

import numpy as np
import matplotlib.pyplot as plt
x = np.arange(-300, 300)
y = x**2-7*x
fig = plt.figure()
ax = fig.add_subplot(1,1,1)
plt.plot(x, y)
# Add something here to activate the "Zoom to rectangle" tool?
plt.show()

最佳答案

这对我有用:

plt.get_current_fig_manager().toolbar.zoom()

关于python - Wonder-twin power "Zoom to rectangle"激活?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8144492/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com