1
$\begingroup$

The bottom part of my axis ticks are truncated below, what is right padding option to make them show up properly?

cylinder[t_] := 
  With[{x = Cos[t], y = Sin[t]}, 
   Graphics3D@Cylinder[{{x, y, 0}, {x, y, x^2 + 3 y^2}}, 1/100]];
plot3da = 
  Plot3D[{0, x^2 + 3 y^2}, {x, -1, 1}, {y, -1, 1}, 
   RegionFunction -> Function[{x, y, z}, x^2 + y^2 <= 1], 
   MeshFunctions -> {#3 &}, Boxed -> False, Axes -> None, 
   PlotStyle -> Opacity[0.5], PlotPoints -> 50];
plot3d[t_] := Show[plot3da, cylinder[t]]
blue = ColorData[97, "ColorList"][[1]];
plot2da = 
  Plot[{Callout[Cos[t]^2 + 3 Sin[t]^2, 
     "\!\(\*SubscriptBox[\(\[Lambda]\), \(1\)]\)", Above], 
    Callout[Cos[t]^2 + 3 Sin[t]^2, 
     "\!\(\*SubscriptBox[\(\[Lambda]\), \(2\)]\)", Below], 
    Callout[2, "\!\(\*SubscriptBox[\(\[Lambda]\), \(ave\)]\)", 
     Above]}, {t, 0, 2 Pi}, PlotStyle -> {blue, blue, Dashed}, 
   AxesOrigin -> {0, 0}];
point[t_] := 
 ListPlot[With[{x = Cos[t], y = Sin[t]}, {{t, x^2 + 3 y^2}}], 
  PlotStyle -> PointSize[Large], Filling -> Axis, 
  FillingStyle -> Directive[Orange, Opacity[0.8]]]
plot2d[t_] := Show[plot2da, point[t], ImageSize -> 400];
plotCombined[t_] := 
 GraphicsRow[{Show[plot3d[t], ImageSize -> 600], 
   Show[plot2d[t], ImageSize -> 500]}]
plotCombined[0]

enter image description here

$\endgroup$
6
  • $\begingroup$ For me (12.1.1 for Linux x86, 64 bit) the ticks appear ok. $\endgroup$
    – demm
    Commented Aug 5, 2021 at 8:55
  • $\begingroup$ plotCombined[t_] := GraphicsRow[{Show[plot3d[t], ImageSize -> 600], Show[plot2d[t], ImageSize -> 500, PlotRangePadding -> Scaled[0.1]]}] $\endgroup$
    – cvgmt
    Commented Aug 5, 2021 at 9:07
  • $\begingroup$ @cvgmt hm, if I do this, the lambda_1 callout is truncated $\endgroup$ Commented Aug 5, 2021 at 9:10
  • $\begingroup$ @demm I did 12.1.0 on Macos, but same problem on 12.3.0 on Linux -- wolframcloud.com/obj/f5733b22-d087-4b13-84a2-7fc93a02a0f9 $\endgroup$ Commented Aug 5, 2021 at 12:38
  • 1
    $\begingroup$ GraphicsRow[{Show[plot3d[t], ImageSize -> 600], Show[plot2d[t], ImageSize -> 500, ImagePadding->Scaled[.005]]}]? $\endgroup$
    – kglr
    Commented Aug 6, 2021 at 1:45

1 Answer 1

2
$\begingroup$

Use the option ImagePadding in the second Show in definition of plotCombined:

plotCombined[t_] := GraphicsRow[{Show[plot3d[t], ImageSize -> 600], 
      Show[plot2d[t], ImageSize -> 500, ImagePadding -> Scaled[.005]]}]

plotCombined[0] 

enter image description here

$\endgroup$

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.