1
$\begingroup$

A simple illustration:

chess = Array[RandomInteger[20] &, {10, 10}];
poly = Polygon[{{0, 0, 0}, {0, 0, 10}, {0, 10, 10}, {0, 10, 0}}, VertexTextureCoordinates -> {{1, 0, 1}, {1, 1, 1}, {0, 1, 1}, {0, 0, 1}}];
arrow = Sequence @@ {Red, Thickness[Large], Arrow[{{1, .5, .5}, {1, 9.5, 9.5}}]};

The coordinate setting of Arrow is consistent with ArrayPlot:

Graphics3D[{Texture@ArrayPlot[chess], poly, poly, arrow}]

without

Once the FrameTicks option is set, the frame is rescaling the chessboard and the coordinates for Arrow and ArrayPlot are no longer consistent:

Graphics3D[{Texture@ArrayPlot[chess, FrameTicks -> All], poly, arrow}]

with

I tried a variety of settings e.g. PlotRangePadding -> 0, ImagePadding -> 0 which resolves the scaling but makes the labels disappear.

Looking at FullForm it seems the internal Raster is unchanged, so this did not give me clue on how to resolve. There is an option DefaultBoundaryStyle but I could not find anything on this in the documentation.

How can I keep the coordinates consistent AND have a labelled frame?

$\endgroup$
  • $\begingroup$ apologies, struggling with fixing the pictures. $\endgroup$ – Sander Apr 10 '19 at 3:51
  • $\begingroup$ Graphics3D[{Texture@ArrayPlot[chess, FrameTicks -> All], poly, Red, Thickness[Large], Scale[Arrow[{{1, .5, .5}, {1, 9.5, 9.5}}], {1, .9, .9}, {1, 5, 5}]}]? $\endgroup$ – kglr Apr 10 '19 at 3:56
  • $\begingroup$ Wow ... problem easier to fix than getting the pictures to show up. Thanks! $\endgroup$ – Sander Apr 10 '19 at 3:59
2
$\begingroup$

Thanks to @kglr, answering myself for completeness: use Scale[Arrow[...]] to ensure re-scaling to remain consistent with the ArrayPlot coordinates.

Graphics3D[{Texture@ArrayPlot[chess, FrameTicks -> All], poly, Red,Thickness[Large], Scale[Arrow[{{1, .5, .5}, {1, 9.5, 9.5}}], {1, .9, .9}, {1, 5, 5}]}]
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for?Browse other questions tagged or ask your own question.