2
$\begingroup$
 mat11 = {{1.875`, 1.8919`, 1.9543`, 2.1989`}, 
         {1.7227`, 1.7352`, 1.7792`, 1.8996`}, 
         {1.42`, 1.4253`, 1.4427`, 1.4778`},
         {1.2479`, 1.2508`, 1.26`, 1.2769`}}


    min = Round[Min@{mat11}, .01];
    max = Round[Max@{mat11}, .01];
    minmax = {min, max}

    Table[
 Legended[
  ListPlot3D[MATRIX, 
   ColorFunction -> ColorData[{"DarkRainbow", minmax}],
   ColorFunctionScaling -> False,
   Mesh -> Automatic,
   MeshStyle -> Directive[GrayLevel[0], Dotted],
   PlotLabel -> Framed[Style[Row[{"Spring const. ratios: ",
        Subscript[\[Kappa], 1], " = 1, 1000 and ", 
        Subscript[\[Kappa], 2], " = 1"}], FontFamily -> "Times", 25, 
      Black, Background -> None]],
  InterpolationOrder -> 3,
  PlotRange -> {{1, 4}, {1, 4}, {0.75, 2.25}},
  ImageSize -> 500,
  AxesLabel -> {Style[\[Mu], 30, FontFamily -> "Times", Bold, Red], 
              Style[\[Eta], 30, FontFamily -> "Times", Bold, Blue]},
  PlotStyle -> Opacity[0.9],

  ViewPoint -> {-3, -2.9, 2},
  FaceGrids -> {{1, 0, 0}, {0, 1, 0}, {0, 0, -1}},
  FaceGridsStyle -> Directive[Black, Bold, Dashed],

  Ticks -> {{{1, "0"}, {2, "0.2"}, {3, "0.4"}, {4, "0.6"}}, {{1, 
   "0"}, {2, "0.1"}, {3, "0.5"}, {4, "1"}}, {0.75, 1, 1.25, 1.5, 
  1.75, 2, 2.25}}, 
  TicksStyle -> 
  Directive[Black, FontFamily -> "Times", FontSize -> 18]],
  Placed[BarLegend[{"DarkRainbow", minmax}, 9, LegendMarkerSize -> 500,
  LegendLayout -> "Row", 
  LabelStyle -> 
    Directive[Black, Bold, FontFamily -> "Times", FontSize -> 18]], 
 Below]],
{MATRIX, {{mat11} }}][![plot for code above][1]][1]

I want to find out a way of inserting face grids at specified intervals in ListPlot3d. These interval are specified in Ticks. The intervals show in the figure below are whole numbers only.

Mathematica graphics

$\endgroup$
1
$\begingroup$

Let

ticks = {{{1, "0"}, {2, "0.2"}, {3, "0.4"}, {4, "0.6"}}, 
         {{1, "0"}, {2, "0.1"}, {3, "0.5"}, {4, "1"}}, 
         {0.75, 1, 1.25, 1.5, 1.75, 2, 2.25}};
xticks = ticks[[1, All, 1]];
yticks = ticks[[2, All, 1]];
zticks = ticks[[3]];

and change the specification of FaceGrids to

FaceGrids -> {{{1, 0, 0}, {yticks, zticks}}, {{0, 1, 0}, {xticks, zticks}}, {0, 0, -1}}

Using the relevant part of your code:

Legended[ListPlot3D[mat11, 
  ColorFunction -> ColorData[{"DarkRainbow", minmax}], 
  ColorFunctionScaling -> False, Mesh -> Automatic, 
  MeshStyle -> Directive[GrayLevel[0], Dotted], 
  PlotLabel -> Framed[Style[Row[{"Spring const. ratios: ", Subscript[κ, 1], 
       " = 1, 1000 and ", Subscript[κ, 2], " = 1"}], 
     FontFamily -> "Times", 25, Black, Background -> None]], 
  InterpolationOrder -> 3, 
  PlotRange -> {{1, 4}, {1, 4}, {0.75, 2.25}}, ImageSize -> 500, 
  AxesLabel -> {Style[μ, 30, FontFamily -> "Times", Bold, Red], 
    Style[η, 30, FontFamily -> "Times", Bold, Blue]}, 
  PlotStyle -> Opacity[0.9], ViewPoint -> {-3, -2.9, 2}, 
  FaceGrids -> {{{1, 0, 0}, {{0}, zticks}}, {{0, 1, 0}, {{0}, zticks}}, {0, 0, -1}}, 
  FaceGridsStyle -> Directive[Black, Bold, Dashed], Ticks -> ticks, 
  TicksStyle -> Directive[Black, FontFamily -> "Times", FontSize -> 18]], 
 Placed[BarLegend[{"DarkRainbow", minmax}, 9, LegendMarkerSize -> 500,
    LegendLayout -> "Row", 
   LabelStyle -> Directive[Black, Bold, FontFamily -> "Times", FontSize -> 18]], Below]]

Mathematica graphics

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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