6
$\begingroup$

Bug persisting through 11.2.0


When I use ShrinkWrap to remove the white space around my 3D graphics, it always removes any text around the edges. Say for example I plot a sphere and some text:

Show[Graphics3D[{Sphere[], Text[Style["ABC", 24], {1, 1, 1}]}], Boxed -> False]

enter image description here

And if I use ShrinkWrap, it removed the text and part of the sphere

Show[Graphics3D[{Sphere[], Text[Style["ABC", 24], {1, 1, 1}]}], Boxed -> False,
 Method -> {"ShrinkWrap" -> True}]

enter image description here

How to prevent this?

$\endgroup$
4
  • 1
    $\begingroup$ This is a bug. Please report it to the support. BTW, with version 8.0.4 the ball isn't cropped: screenshot. $\endgroup$ Commented Nov 26, 2017 at 6:53
  • $\begingroup$ @AlexeyPopkov OK, where do I report this bug? $\endgroup$
    – 2ub
    Commented Nov 26, 2017 at 7:27
  • $\begingroup$ You send email to [email protected] with MWE and information about your OS, version number, etc... you'l' get back a CASE number. $\endgroup$
    – Nasser
    Commented Nov 26, 2017 at 7:35
  • $\begingroup$ Nasser already answered about support. They'll ask you for output of {$Version, $ReleaseNumber, $LicenseID}, so I recommend to include this in the original report. $\endgroup$ Commented Nov 26, 2017 at 7:49

1 Answer 1

4
$\begingroup$

Try this to see if it works for you.

Show[Graphics3D[{Sphere[],Text[Style["ABC",24],{1,1,1}]}],
  Boxed->False,
  Method->{"ShrinkWrap"->True},
  ViewVector->{{9,2,2},{0,0,0}}
]

Mathematica graphics

Update

Using ImagePadding -> 0, PlotRangePadding -> 0 helps a little, as given by comment by Simon woods in method-shrinkwrap-messes-up-editting-graphics But the text is still missing, but sphere is not cropped.

Show[Graphics3D[{Sphere[],Text[Style["ABC",24],{1,1,1}]}],
Boxed->False,Method->{"ShrinkWrap"->True},
ImagePadding->0,PlotRangePadding->0]

Mathematica graphics

$\endgroup$
5
  • $\begingroup$ (+1) Can you explain why specifying ViewVector helps in this case? $\endgroup$ Commented Nov 26, 2017 at 6:58
  • 1
    $\begingroup$ @AlexeyPopkov I just noticed that by moving the image with the mouse did bring the text back. So by trial and error, this view vector was the best to show the text in this case. $\endgroup$
    – Nasser
    Commented Nov 26, 2017 at 7:01
  • $\begingroup$ How do I know which specification for ViewVector to use though? Can it be done when there are multiple texts at several different margins? $\endgroup$
    – 2ub
    Commented Nov 26, 2017 at 7:24
  • $\begingroup$ @L.Quen as I said, this was by trial and error for this case. This is just a workaround for the example you showed. This looks like a bug as was suggested. I could not find a general workaround for all cases at this time. The text is there. (you can see that by moving the image with the mouse). It is just that the view gets messed up and needs manual adjustment. $\endgroup$
    – Nasser
    Commented Nov 26, 2017 at 7:25
  • $\begingroup$ OK thanks for the help $\endgroup$
    – 2ub
    Commented Nov 26, 2017 at 7:27

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.