3
$\begingroup$

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

$\endgroup$
3
  • $\begingroup$ Have you tried using Inset? If your problem is how to get the circle-enclosed numbers, see How to input a number with a ring. $\endgroup$
    – MarcoB
    Mar 24, 2016 at 12:41
  • $\begingroup$ We have to play with theta in Rotate[Style["enclosed(number)"], theta] to lie on exact on a surface. but without that desired case is automatically lies on a surface. $\endgroup$ Mar 24, 2016 at 13:21
  • $\begingroup$ Take a look at Framed with the RoundingRadius option. A suitably large RoundingRadius will result in a circled expression. See e.g. mathematica.stackexchange.com/q/18823/131 $\endgroup$
    – Yves Klett
    Mar 25, 2016 at 17:20

2 Answers 2

3
$\begingroup$
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

$\endgroup$
1
$\begingroup$

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.

$\endgroup$
2
  • $\begingroup$ Unfortunately I could not put them in circles! although MarcoB commented. $\endgroup$ Mar 24, 2016 at 12:54
  • $\begingroup$ @Ackaran, have a look at CharacterRange["\:2460", "\:2468"]. $\endgroup$ Mar 24, 2016 at 14:16

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.