2
$\begingroup$

From the documentation, you can create face grids in a graphic with:

Graphics3D[Cylinder[], Axes -> True, FaceGrids -> All]

But it says nothing about increasing the number of lines in the grid. As you see, there is a line every $0.5$. What if I need a line every $.1$ or anything else? How do you change this?

$\endgroup$
1

1 Answer 1

4
$\begingroup$

If you don't use the Automatic, None or All methods, then you must specify all the gridlines yourself.

The Details section of the FaceGrids documentation page says how to do this. You specify the face grids as {{face1,{xgrid1,ygrid1}},…}. Here face_i is {1,0,0}, {-1,0,0}, {0,1,0} etc, and the xgrid_i are a list of numbers specifying where to put the lines.

fineGrid = Range[-1, 1, 0.1];
faces = Flatten[Permutations /@ {{0, 0, 1}, {0, 0, -1}}, 1];

faceGrids = {#, {fineGrid, fineGrid}} & /@ faces;

Graphics3D[Cylinder[], Axes -> True, FaceGrids -> faceGrids]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.