In matplotlib 3d-plotting the function plot_wireframe
takes parameters - rcount
, ccount
, rstride
and cstride
respectively. I went through the documentation for them in the matplotlib documentation but it was not very clear what they did. I played around changing the parameter values of rcount
and ccount
a bit and have a sense that it has to do with how many rows and columns from the meshgrids X and Y are used for placing the wires (X and Y are the meshgrids input to plot_wireframe
). I guess a clear understanding of rstride and cstride will follow after understanding rcount and ccount. Hence I request a better explanation of this with an example maybe.
Here is my code for reference (ran in Jupyter notebook)-
import numpy as np
import matplotlib.pyplot as plt
# Because I would want to rotate the plots manually
%matplotlib notebook
x = np.linspace(-3,3,7)
y = np.linspace(-3,3,7)
X,Y = np.meshgrid(x,y)
Z = X**2 + Y**2
fig = plt.figure()
ax = fig.add_subplot(projection='3d')
ax.plot_wireframe(X,Y,Z,rcount=3, ccount=5)
ax.set_xlabel('x')
ax.set_ylabel('y')
ax.set_zlabel('z')