Edgelines vanish in mplot3d surf when facecolors are specified

前端 未结 1 1833
闹比i
闹比i 2020-12-18 03:11

I have produced the following surface plot in matlab:

\"Matlab

and I need to create this in .N

相关标签:
1条回答
  • 2020-12-18 03:53

    You can put the lines in the surface plot adding the keyword argument edgecolors

    # Add black lines in the edges
    surf = ax.plot_surface(X, Y, volatility, rstride=1, cstride=1, facecolors= UWR(heatmap), linewidth=1, shade=False, edgecolors='#000000')
    

    Directions over how to format the axis tick labels and locations here: http://matplotlib.sourceforge.net/api/ticker_api.html#matplotlib.ticker.FormatStrFormatter


    Solved - Moved up from comments:

    Adding surf.set_edgecolor('k') after plot_surface overrides the edge color. I think that may be related to the fact that facecolors is an option of plot_surface, but the edgecolors is an option of Poly3DCollection. More details here.

    0 讨论(0)
提交回复
热议问题