金狮镖局 Design By www.egabc.com
matplotlib
默认在图像Windows窗口中显示当前鼠标光标所在位置的坐标,格式为x=xx, y=xx
。
鼠标光标的坐标格式由子图模块Axes
中的format_coord
函数控制。
通过重写format_coord
函数即可实现坐标的自定义格式。
注意:调用format_coord
函数的对象是子图对象,常见的错误主要在没有正确的获取当前子图对象。
format_coord
函数源码
matplotlib.axes.Axes.format_coord def format_coord(self, x, y): """Return a format string formatting the *x*, *y* coordinates.""" if x is None: xs = '"htmlcode">import matplotlib.pyplot as plt def format_coord(x, y): return 'x坐标为%1.4f, y坐标为%1.4f' % (x, y) #获取当前子图 ax=plt.gca() ax.format_coord = format_coord plt.show()
金狮镖局 Design By www.egabc.com
金狮镖局
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件!
如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
金狮镖局 Design By www.egabc.com
暂无matplotlib自定义鼠标光标坐标格式的实现的评论...
更新日志
2024年09月23日
2024年09月23日
- 王子异《1996 Part.2》[320K/MP3][18.29MB]
- 群星.1994-宝丽金最倾情3CD【宝丽金】【WAV+CUE】
- 乐俊亨.2024-同泪【CharioticMusic】【FLAC分轨】
- 何耀珊.2006-收获【华纳】【WAV+CUE】
- 梁汉文1994-壹精选[华星][WAV+CUE]
- 洪荣宏1981-歹路不可行·相思雨(飞跃复刻版)[光美][WAV+CUE]
- 旅行团2015-10Day’s[来福胶泥][WAV+CUE]
- 龙千玉.2011-卡将哟【豪记】【WAV+CUE】
- 蔣志光.1993-多情多寂寞(国专)【BMG】【WAV+CUE】
- 陈慧娴.1996-雪映美白96演唱会2CD(2024环球红馆40复刻系列)【环球】【WAV+CUE】
- 王子异《1996 Part.2》[FLAC/分轨][50.66MB]
- 贵族音乐《古典名曲与轻音乐钢琴 打开宝宝睡眠开关》[320K/MP3][155.91MB]
- 贵族音乐《古典名曲与轻音乐钢琴 打开宝宝睡眠开关》[FLAC/分轨][251.78MB]
- 黄韵玲2001-巴结音乐[全员集合][WAV+CUE]
- 郑绪岚2015-流金岁月·精选[首版][WAV+CUE]