Matplotlib 中更改绘图背景
凯哥英语视频
import matplotlib.pyplot as plt
import re
tip_coordinate_re = re.compile(r'^(\d+):\s(\d+)\s(\d+)$')
tip_coordinate_x = []
tip_coordinate_y = []
tip_coordinate_x = [1407, 1403, 1398, 1394, 1384, 1371]
tip_coordinate_y = [374, 381, 383, 395, 403, 431]
plt.plot(tip_coordinate_x, tip_coordinate_y, '+')
img = plt.imread('F:\\新建文件夹\\0.1\\00000000.png') # 设置的背景图片
fig, ax = plt.subplots()
ax.imshow(img, extent=[0, 1536, 1024, 0])
ax.scatter(tip_coordinate_x, tip_coordinate_y, color="#ebb734")
plt.show()
我这是细胞的运动轨迹,就不给你们观赏了。。。
别的也没啥说的
ok,那就这样吧~
欢迎各位大佬留言吐槽,也可以深入交流~