Combine picture and plot with Python Matplotlib

后端 未结 2 1773
被撕碎了的回忆
被撕碎了的回忆 2020-12-13 07:33

I have a plot which has timestamps on the x-axis and some signal data on the y-axis. As a documentation I want to put timestamped pictures in relation to specific points in

2条回答
  •  忘掉有多难
    2020-12-13 07:51

    If I understand the question correctly, then perhaps this may help:

    import scipy
    import pylab
    fig = pylab.figure()
    axplot = fig.add_axes([0.07,0.25,0.90,0.70])
    axplot.plot(scipy.randn(100))
    numicons = 8
    for k in range(numicons):
        axicon = fig.add_axes([0.07+0.11*k,0.05,0.1,0.1])
        axicon.imshow(scipy.rand(4,4),interpolation='nearest')
        axicon.set_xticks([])
        axicon.set_yticks([])
    fig.show()
    fig.savefig('iconsbelow.png')
    

    alt text

提交回复
热议问题