1

I'm producing a 3D scatter plot. In the background there are grey lines (pictured) which are just lined up with integer values of the coordinates. I would like to customise the locations and quantity of these lines using x,y,z vectors.

My current code is as follows:


fig = plt.figure(figsize=(20,20))
ax = fig.add_subplot(111,projection='3d')

ax.scatter(x,y,z)
ax.set_xlim3d(x_min,x_max)
ax.set_ylim3d(y_min,y_max)
ax.set_zlim3d(z_min,z_max)

ax.elev = 5.0
ax.azim = 45

ax.set_axis_on()

plt.title(''.join(['Time = ',repr(time)]),fontsize=20)
plt.savefig(os.path.join(''.join(['scatter3D_',repr(file_num).zfill(5),'.png'])), bbox_inches='tight')
plt.close('all')

for some x,y,z's. Is there a command with which I can do this?

Thanks for your comment. I tried incorporating it with the following

ax.set_xticks(x, minor=True)
ax.set_yticks(y, minor=True)
ax.set_zticks(z, minor=True)

ax.xaxis.grid(True, which='minor')
ax.yaxis.grid(True, which='minor')
ax.zaxis.grid(True, which='minor')

but was unsuccessful.

  • Possible duplicate of [How to add a grid line at a specific location in matplotlib plot?](https://stackoverflow.com/questions/14608483/how-to-add-a-grid-line-at-a-specific-location-in-matplotlib-plot) – DavidG Apr 11 '19 at 14:38

0 Answers0