有没有办法在显示matplotlib图时默认自动激活"Zoom to rectangle“工具?
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()
发布于 2011-11-16 07:43:58
这对我来说很有效:
plt.get_current_fig_manager().toolbar.zoom()
https://stackoverflow.com/questions/8144492
复制相似问题