• linkedu视频
  • 平面设计
  • 电脑入门
  • 操作系统
  • 办公应用
  • 电脑硬件
  • 动画设计
  • 3D设计
  • 网页设计
  • CAD设计
  • 影音处理
  • 数据库
  • 程序设计
  • 认证考试
  • 信息管理
  • 信息安全
菜单
linkedu.com
  • 网页制作
  • 数据库
  • 程序设计
  • 操作系统
  • CMS教程
  • 游戏攻略
  • 脚本语言
  • 平面设计
  • 软件教程
  • 网络安全
  • 电脑知识
  • 服务器
  • 视频教程
  • vbs
  • DOS/BAT
  • hta/htc
  • python
  • perl
  • VBA
  • ColdFusion
  • ruby
  • PowerShell
  • Lua
  • Golang
  • linux shell
您的位置:首页 > 脚本语言 >python > Python实现在matplotlib中两个坐标轴之间画一条直线光标的方法

Python实现在matplotlib中两个坐标轴之间画一条直线光标的方法

作者: 字体:[增加 减小] 来源:互联网

通过本文主要向大家介绍了python matplotlib,python安装matplotlib,python中matplotlib,python3 matplotlib,matplotlib python2.7等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com

本文实例讲述了Python实现在matplotlib中两个坐标轴之间画一条直线光标的方法。分享给大家供大家参考。具体如下:

看看下面的例子和效果吧

# -*- 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()

</div>

下面是图形效果,看随着光标的移动,在两个图之间会画一条竖线

这个功能有时还是比较有用的

希望本文所述对大家的Python程序设计有所帮助。

</div>

您可能想查找下面的文章:

  • 利用numpy+matplotlib绘图的基本操作教程
  • 利用matplotlib+numpy绘制多种绘图的方法实例
  • python使用matplotlib绘制柱状图教程
  • python使用matplotlib绘制折线图教程
  • python利用matplotlib库绘制饼图的方法示例
  • Windows下为Python安装Matplotlib模块
  • Python使用matplotlib实现在坐标系中画一个矩形的方法
  • Python使用matplotlib绘制动画的方法
  • Python实现在matplotlib中两个坐标轴之间画一条直线光标的方法
  • Python Matplotlib库入门指南

相关文章

  • 在GitHub Pages上使用Pelican搭建博客的教程
  • Python Requests 基础入门
  • Python中捕捉详细异常信息的代码示例
  • 听歌识曲--用python实现一个音乐检索器的功能
  • 在Docker上部署Python的Flask框架的教程
  • 介绍Python中的一些高级编程技巧
  • python求crc32值的方法
  • Linux下通过python访问MySQL、Oracle、SQL Server数据库的方法
  • Python同时向控制台和文件输出日志logging的方法
  • Python中Random和Math模块学习笔记

文章分类

  • vbs
  • DOS/BAT
  • hta/htc
  • python
  • perl
  • VBA
  • ColdFusion
  • ruby
  • PowerShell
  • Lua
  • Golang
  • linux shell

最近更新的内容

    • 在Python的Flask框架中实现单元测试的教程
    • centos6.7安装python2.7.11的具体方法
    • Python的Django框架中消息通知的计数器实现教程
    • python生成日历实例解析
    • python实现统计代码行数的方法
    • Python 网络编程说明第1/2页
    • 深入解析Python的Tornado框架中内置的模板引擎
    • 决策树的python实现方法
    • Python常见文件操作的函数示例代码
    • Python对两个有序列表进行合并和排序的例子

关于我们 - 联系我们 - 免责声明 - 网站地图

©2020-2025 All Rights Reserved. linkedu.com 版权所有