pythongridplotmatplotlib

python meshgrid size and line thickness


I am trying to make a grid on the surface of my surfaceplot, now I know that wireframe does not work and the grid command is something else entirely. But I don't seem to be able to get grids like this enter image description here but rather grids like thisenter image description here and changing rstride and cstride only makes it look like modern art: enter image description here

Here is the plot command I am using

fig = plt.figure()
ax = fig.add_subplot(111,projection="3d")

plot = ax.plot_surface(x,y,z, rstride=1, cstride=1, cmap=cm.jet, shade=True,
                       linewidth=1, antialiased=False)

Solution

  • It would be helpful if you were clearer with what you are trying to achieve. The grid in your second plot looks fine to me - what were you expecting? How exactly do you want the grid to appear?

    You say you are not happy with the result of changing the values of the rstride and cstride arguments, but you don't say what you are changing these to or from. Have you read the documentation on these arguments?

    Also, please post a minimal, self-contained working example of your code, since the grids drawn will depend on how you constructed your data (how many points in each dimension etc.). Don't make us go looking through your previous questions

    Anyway, rant over. Simply doubling the rstride and cstride values gives me

    enter image description here

    It is not the third figure in the question. Is the above one more like what you are after?