# Indicate scale with label close to an edge

I used the following code to plot three 3D boxes:

x = Graphics3D[{Blue, Opacity[0.2
], Parallelepiped[{0, 0,
0}, {{.3, 0, 0}, {0, .3, 0}, {0, 0, 1}}]}, Axes -> True,
AxesEdge -> {{-1, -1}, {-1, -1}, {-1, -1}}]
y = Graphics3D[{Blue, Opacity[0.2
], Parallelepiped[{2, 0,
0}, {{.3, 0, 0}, {0, .3, 0}, {0, 0, 1}}]}, Axes -> True,
AxesEdge -> {{-1, -1}, {-1, -1}, {-1, -1}}]
z = Graphics3D[{Blue, Opacity[0.2
], Parallelepiped[{1, 2,
0}, {{.3, 0, 0}, {0, .3, 0}, {0, 0, 1}}]}, Axes -> True,
AxesEdge -> {{-1, -1}, {-1, -1}, {-1, -1}}]
Show[x, y, z, Boxed -> False, Ticks -> False,
PlotStyle -> Opacity[.5]]


I'm trying to give a generic indication of scale for the edges. Is it possible to add labels near each edge? Maybe with a curly bracket, or just a letter close to it? For example, the small side is $$\delta$$ and the big one is $$\lambda$$.

• I'm a little uncertain. You want labels next each box appearing along an edge for each dimension? You mention axes, whose scales could be changed (but why change them?) and whose scales can be given arbitrary descriptions with custom Ticks and AxesLabel options. So do you want your labels to appear on the axes or near each box? Commented Apr 10, 2022 at 15:53
• I see, you are right, I will edit the question. I would like the labels to appear near each box, not on the axes.
– ibr_
Commented Apr 10, 2022 at 16:01

One quick and dirty way is to add text halfway onto the edges $$x+v_i$$ of the Parallelepiped, here using a new Method defined for this purpose LabeledParallelepiped:

LabeledParallelepiped[x_,vi_,lables_,styles_]:=Module[{l,p},
p=Flatten[{styles,Parallelepiped[x,vi]}];
Graphics3D[{p,Black,l}]
]

x=LabeledParallelepiped[{0,0,0},{{.3,0,0},{0,.3,0},{0,0,1}},{"\[Delta]","\[Beta]","\[Lambda]"},{Blue,Opacity[0.2]}];
y=LabeledParallelepiped[{2,0,0},{{.3,0,0},{0,.3,0},{0,0,1}},{"\[Delta]","\[Beta]","\[Lambda]"},{Blue,Opacity[0.2]}];
z=LabeledParallelepiped[{1,2,0},{{.3,0,0},{0,.3,0},{0,0,1}},{"\[Delta]","\[Beta]","\[Lambda]"},{Blue,Opacity[0.2]}];

Show[x,y,z,Boxed->False,Ticks->False,Axes->True,AxesEdge->{{-1,-1},{-1,-1},{-1,-1}}]


which generates

This is arguably not the nicest looking plot/diagram for the intended visualization but improvements would probably require additional parameters (like specifying the edge onto which a label should be placed, an offset (see e.g. the Offset option for Text) or even distance markers (like curly brackets or lines). But the present solution might be a good starting point.

• It does the job! Thanks!
– ibr_
Commented Apr 12, 2022 at 18:42