3

When we use ListPlot3D or Plot3D in Mathematica, a box is generated to contain the plot, as shown below. In the drawings below, I intentionally did not draw any plot in the box for the sake of clarity and generality; however in my problem I am using ListPlot3D.

Empty box

I show three axes as they would be generated by e.g. Plot3D[f[x, y], {x, 0, 2}, {y, 0, 3}]].

I would like to draw enclosed numbers on the faces of this box at the following coordinates:

① -> {1.5,   0,  0}
② -> {2.0, 1.5,  0}
③ -> {1.0, 3.0,  0}
④ -> {  0, 1.5,  0}
⑤ -> {1.0, 1.5, -1}

Here is a rough approximation of what I would like the end result to look like:

box with axes and numbers

MarcoB
  • 67,153
  • 18
  • 91
  • 189
Unbelievable
  • 4,847
  • 1
  • 20
  • 46

2 Answers2

3
Clear[circle]
circle[n_Integer /; 1 <= n <= 10] :=
 Style[FromCharacterCode[9311 + n], FontFamily -> "Arial Unicode MS"]
circle[n_Integer /; 1 <= n <= 10, size_Integer?(# > 0 &)] :=
 Style[FromCharacterCode[9311 + n], size, FontFamily -> "Arial Unicode MS"]

Show[
 Plot3D[f[x, y],
   {x, 0, 2}, {y, 0, 3},
   ViewAngle -> 0.50, ViewPoint -> {2, -2.5, 0.7}
 ],
 Graphics3D[{
    Black,
    Text[circle[1, 24], {1.5, 0, 0}],
    Text[circle[2, 24], {2, 1.5, 0}],
    Lighter@Gray,
    Text[circle[3, 24], {1, 3, 0}],
    Gray,
    Text[circle[4, 24], {0, 1.5, 0}],
    Style[Text[circle[5, 24], {1, 1.5, -1}], FontSlant -> Italic]
  }]
]

Mathematica graphics

MarcoB
  • 67,153
  • 18
  • 91
  • 189
1

A generic solution is to combine the plot and text with Show.

img = Plot3D[Exp[-x^2 - y^2], {x, -1, 1}, {y, -1, 1}];
Show[img,
 Graphics3D[{Text[Style["Top", Red, 25], {0, 0, 1}], 
   Text[Style["Left", Red, 25], {-1, 0, 0.5}],
   Text[Style["Front", Red, 25], {0, -1,0.5}]}]]

enter image description here

You can always add additional feature to your text.

Sumit
  • 15,912
  • 2
  • 31
  • 73