0
$\begingroup$

As the title says, I would like to combine a Plot3D object with a Graphics3D object. However, it seems that Show is recalculating the dimensions of the box.

So two questions:

  1. Why is Show recalculating the box? I assumed that the box is created in the Plot3D object?

  2. How do I prevent this? The Graphics3D object is supposed to be a custom-placed axes label, see the example below.

Alternatively, I'd be happy with a solution how to position AxesLabel freely.

P.S.: the only thing I could find was How to have one or multiple Boxed graphics, mixed with non Boxed, in the same Graphics3D but that doesn't explain the issue and is 9 years old so my hope was that some simpler solution popped up since then.

MWE:

some3dplot = Plot3D[x + y, {x, -1, 1}, {y, -1, 1}, Boxed -> True];
someXAyesLabel = Graphics3D[Text["some label", {1, -2, -2}]];
plt = Show[some3dplot, someXAyesLabel, PlotRange -> All]

$\endgroup$
4
  • 1
    $\begingroup$ Welcome to Mathematica StackExchange! The "box" is being "recalculated", because you set PlotRange -> All. If you omit this, then Show will use options from the first of its arguments, namely from your some3dplot, and will not "recalculate" the box. As for the positioning of labels: see Axes Origin & Labels in 3D Plot and Manually assigning Axes label position in Plot3D. $\endgroup$
    – Domen
    Commented Aug 2 at 10:13
  • $\begingroup$ Thank you for your answer. I noticed that PlotRange->All causes this, however, if I leave it out I don't see the "some label" anymore... $\endgroup$ Commented Aug 2 at 10:38
  • 1
    $\begingroup$ Well, of course you don't see it, because you positioned it at {1, -2, -2}, which is outside of the box :) Put it at, for example, position Scaled[{1, 0, 0}]. $\endgroup$
    – Domen
    Commented Aug 2 at 10:39
  • $\begingroup$ Well I want to position it outside of the box since it should be an AxesLabel... $\endgroup$ Commented Aug 2 at 13:40

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.