如何在matplotlib中两个坐标轴之间画一条直线光标
2012-09-22 23:09
543 查看
看看下面的例子和效果吧
下面是图形效果,看随着光标的移动,在两个图之间会画一条竖线
![](http://img.my.csdn.net/uploads/201209/22/1348326658_8391.JPG)
这个功能有时还是比较有用的
# -*- coding: utf-8 -*- from matplotlib.widgets import MultiCursor from pylab import figure, show, np t = np.arange(0.0, 2.0, 0.01) s1 = np.sin(2*np.pi*t) s2 = np.sin(4*np.pi*t) fig = figure() ax1 = fig.add_subplot(211) ax1.plot(t, s1) ax2 = fig.add_subplot(212, sharex=ax1) ax2.plot(t, s2) multi = MultiCursor(fig.canvas, (ax1, ax2), color='r', lw=1) show()
下面是图形效果,看随着光标的移动,在两个图之间会画一条竖线
这个功能有时还是比较有用的
相关文章推荐
- Python实现在matplotlib中两个坐标轴之间画一条直线光标的方法
- Python实现在matplotlib中两个坐标轴之间画一条直线光标的方法
- 【python】matplotlib在把坐标轴移到中间后如何去掉两个坐标轴上多余的一个0?
- 如何设定数字标题和坐标轴标签字体大小matplotlib
- python matplotlib 在指定的两个点之间连线方法
- python matplotlib 画一条水平直线遇到的问题
- 演示MatPlotLib中如何设置坐标轴主刻度标签和次刻度标签
- Python利用matplotlib.pyplot绘图时如何设置坐标轴刻度
- python matplotlib 在指定的两个点之间连线
- Matplotlib 如何画散点图的图例
- Python+matplotlib实现计算两个信号的交叉谱密度实例
- 测试如何将MatPlotLib嵌入到wxPython中
- Matplotlib 如何显示中文
- Python 使用matplotlib画图添加标注、及移动坐标轴位置
- matplotlib去掉坐标轴刻度
- 【Matplotlib】线设置,坐标显示范围
- matplotlib--设置坐标轴
- matplotlib的基本用法(十五)——主次坐标轴
- 如何在win7下安装numpy,matplotlib,scipy,pandas等库
- python matplotlib如何将图例放在图外