2021
01-08
01-08
matplotlib自定义鼠标光标坐标格式的实现
matplotlib默认在图像Windows窗口中显示当前鼠标光标所在位置的坐标,格式为x=xx,y=xx。鼠标光标的坐标格式由子图模块Axes中的format_coord函数控制。通过重写format_coord函数即可实现坐标的自定义格式。注意:调用format_coord函数的对象是子图对象,常见的错误主要在没有正确的获取当前子图对象。format_coord函数源码matplotlib.axes.Axes.format_coorddefformat_coord(self,x,y):"""Returnaformatstringformatting...
继续阅读 >