怎么在Matplotlib中使用Cursor实现UI定位
今天就跟大家聊聊有关怎么在Matplotlib中使用Cursor实现UI定位,可能很多人都不太了解,为了让大家更加了解,小编给大家总结了以下内容,希望大家根据这篇文章可以有所收获。
Matplotlib编程实现
import matplotlib.pyplot as plt import numpy as np from matplotlib.widgets import Cursor lineprops = dict(color="red", lw=2) fig, ax = plt.subplots(1, 1, subplot_kw=dict(facecolor="lemonchiffon")) x = np.random.random(100) y = np.random.random(100) ax.scatter(x, y, marker="o", color="red") ax.set_xlim(-0.02, 1.02) ax.set_ylim(-0.02, 1.02) cursor = Cursor(ax, useblit=True, **lineprops) plt.show()
成品截图
看完上述内容,你们对怎么在Matplotlib中使用Cursor实现UI定位有进一步的了解吗?如果还想了解更多知识或者相关内容,请关注行业资讯频道,感谢大家的支持。