Plot 3D Contour from an Image using extent with Matplotlib

前端 未结 1 765
鱼传尺愫
鱼传尺愫 2021-01-28 23:15

As I present here (in 2D), I\'m wondering if how I could \"scale\" an image input to be plotted to a range in the plot. To be more clear, this is what I need:

I have a 4

相关标签:
1条回答
  • 2021-01-28 23:49

    Try this insted:

    fig = plt.figure()
    ax = fig.gca(projection='3d')
    row = np.linspace(-1, 1, 400)
    X,Y = np.meshgrid(row,row)
    CS = ax.contour(X, Y, im, cmap=cm.coolwarm)
    plt.clabel(CS, inline=1, fontsize=10)
    plt.savefig("ContourLevel3D.png")
    
    0 讨论(0)
提交回复
热议问题