Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I want to plot a 3D graphic and I want facegrids at the ticks that I specify. I've tried several solutions but I cannot get this working. The result with the code provided below is that it does its job except in the x-axis where it only draws a facegrid at the middle coordinate (and not in all ticks). Any advice is most welcome.

Here is my code:

Plot3D[exp[R, bn, 50], {R, 2, 100}, {bn, 1, 5},
       AxesStyle -> Thickness[0.005],
       Ticks -> {{2, 10, 20, 30, 50, 100}, {1, 2, 3, 4, 5}, 
                 {0.5, 1.0,1.5, 2.0, 2.5}}, 
       Boxed -> False,
       Mesh -> {{0, 2, 5, 10, 15, 20, 30, 40, 50, 60, 70, 80, 90, 100}, 
                {1,1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5}}, 
       PerformanceGoal -> "Quality",
       FaceGrids -> All,
       AxesLabel -> {"X","Y","Z"}
]

Mathematica graphics

share|improve this question
1  
Related: stackoverflow.com/q/8115848 –  rm -rf Mar 29 '12 at 22:09

1 Answer 1

up vote 12 down vote accepted

This can be found on the 'More Information' section of the FaceGrid doc page though it may not be very easy to grasp. Here's an example:

Plot3D[Sin[R bn/10], {R, 2, 100}, {bn, 1, 5}, 
 AxesStyle -> Thickness[0.005], 
 Ticks -> {{2, 10, 20, 30, 50, 100}, {1, 2, 3, 4, 5}, {0.5, 1.0, 1.5, 2.0, 2.5}},
 Boxed -> False, 
 Mesh -> {{0, 2, 5, 10, 15, 20, 30, 40, 50, 60, 70, 80, 90, 100}, 
          {1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5}}, 
 PerformanceGoal -> "Quality", 
 FaceGrids -> 
   {{{0, -1, 0}, {{2, 10, 20, 30, 50, 100}, {0.5, 1.0, 1.5, 2.0, 2.5}}}, 
    {{1,  0, 0}, {{1, 2, 3, 4, 5}, {0.5, 1.0, 1.5, 2.0, 2.5}}}, 
    {{0, 0,  1}, {{2, 10, 20, 30, 50, 100}, {1, 2, 3, 4, 5}}}
   }
]

Mathematica graphics

Basically what Facegrid specifies here is which faces to draw and what lines to draw in each face. For each face, we need one list. An identification of the grid we are talking about is the first element of each face grid specification. This specification can be thought of the unit vector pointing straight to the grid you want to indicate, so {1,0,0} would be the $+x$ face grid, and {0,-1,0} would be the $-y$ grid. The next element of the grid specification list is a specification of the grid lines, a list with tick values for each of the remaining coordinates. So, if the $+x$ grid is being specified this list contains a specification for the $y$ and $z$ ticks.

share|improve this answer
    
Thanks a lot! I was about to hit my head into the wall! :) –  jpcgandre Mar 29 '12 at 22:14

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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