[Python] matplotlib中两个坐标轴之间画一条直线光标 →→→→→进入此内容的聊天室

来自 , 2020-09-25, 写在 Python, 查看 115 次.
URL http://www.code666.cn/view/0a9fdbb1
  1. # -*- coding: utf-8 -*-
  2.  
  3. from matplotlib.widgets import MultiCursor
  4. from pylab import figure, show, np
  5.  
  6. t = np.arange(0.0, 2.0, 0.01)
  7. s1 = np.sin(2*np.pi*t)
  8. s2 = np.sin(4*np.pi*t)
  9. fig = figure()
  10. ax1 = fig.add_subplot(211)
  11. ax1.plot(t, s1)
  12.  
  13.  
  14. ax2 = fig.add_subplot(212, sharex=ax1)
  15. ax2.plot(t, s2)
  16.  
  17. multi = MultiCursor(fig.canvas, (ax1, ax2), color='r', lw=1)
  18. show()
  19.  
  20. #//python/6355

回复 "matplotlib中两个坐标轴之间画一条直线光标"

这儿你可以回复上面这条便签

captcha