1. 程式人生 > >【每日coding】繪製點線

【每日coding】繪製點線

def draw(path):
    from PIL import  Image
    from matplotlib import  pyplot as plt

    image = Image.open(path)

    x = [100, 100, 400, 400]
    y = [200, 500, 200, 500]


    plt.imshow(image)
    plt.plot(x, y, 'r*')
    plt.plot(x[:2], y[:2])
    plt.pause(3)






if __name__ == '__main__':
    path = '../data/imgs/hdrplus.png'
    draw(path)