3
$\begingroup$

The following use of Show produces an error (Could not combine the graphics objects in Show) even though the two graphics objects are constructed just fine.

g1 = Graphics[{Line[{{0, 0}, {0, 1}, {1, 1}}]}]
g2 = Rotate[g1, \[Pi]]
Show[{g1, g2}]

Can Show somehow be used to combine graphics objects, where some are rotated?

Note: even Show[{g2}] fails.

$\endgroup$
4
$\begingroup$

Or take the graphic details with First, Rotate them, then plot again with Graphic:

    g1 = Graphics[{Line[{{0, 0}, {0, 1}, {1, 1}}]}]
    g2 = Graphics[Rotate[First@g1, \[Pi]]]
    Show[{g1, g2}]
$\endgroup$
  • $\begingroup$ Thanks. This gives a more accurate layout than Overlay. $\endgroup$ – Alan Dec 7 '15 at 22:01
2
$\begingroup$

g2 has head Rotate, so use Overlay

Overlay[{g1, g2}]

enter image description here

$\endgroup$
0
$\begingroup$

For 3D figure, if the function Overlay is used, the obtained figure is two dimensional. It cann't be rotated using the mouse. To solve this problem, we can take other methodes. Giving an example

myBox = Graphics3D[Cuboid[{-40, 40, 0}, {40, 60, 10}]];

myBox = Graphics3D[Rotate[myBox[[1]], Pi/4, {0, 0, 1}, {0, 0, 0}]]

Then, you can use the Show[]. It is very simple. You can do like this to apply to other situations.

$\endgroup$
  • $\begingroup$ This is what accepted answer uses, is it not? $\endgroup$ – Kuba Jan 18 '18 at 12:16
  • $\begingroup$ Aming at the above answer, just for a clearer explanation of the problems of the Overlay and a clear answer to the 3D figure. $\endgroup$ – laizhianzhi Jan 19 '18 at 0:56
  • $\begingroup$ I keep reading MyBox in this thread and it keeps appearing in the SERPs for Self Storage searches. Any Chance we can remove this keyword from this thread or make this page noindex? $\endgroup$ – Jay Jan 27 '18 at 18:44

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.