3
$\begingroup$

I want to plot four ellipses on the same graphics, along with some vectors and disks. I am using the Graphics command to create the arrows, ellipses and disks, and then the GraphicsGrid command to put the three figures together. The problem that I have is that they all appear with different scaling.

Here is a sample of my Mathematica code:

G0 = Graphics[{{Thick, 
     Arrow[{{0, 0}, {Cos[Pi/2 - Pi/10], Sin[Pi/2 - Pi/10]}}], 
     Arrow[{{0, 0}, {-Cos[Pi/2 - Pi/10], Sin[Pi/2 - Pi/10]}}], 
     Arrow[{{0, 0}, {0, 1}}]}, {Circle[{0, 0}, {1/Sqrt[v[Pi/10]], 
       Sqrt[v[Pi/10]]}]}, {Gray, Opacity[0.3], 
     Disk[{0, 0}, 1, {Pi/2 - Pi/10, Pi/2 + Pi/10}]}}, Axes -> True, 
   Ticks -> None];
G1 = Graphics[{{Thick, 
     Arrow[{{0, 0}, {Cos[Pi/2 - Pi/4], Sin[Pi/2 - Pi/4]}}], 
     Arrow[{{0, 0}, {-Cos[Pi/2 - Pi/4], Sin[Pi/2 - Pi/4]}}], 
     Arrow[{{0, 0}, {0, 1}}]}, {Circle[{0, 0}, {1/Sqrt[v[Pi/4]], Sqrt[
       v[Pi/4]]}]}, {Gray, Opacity[0.3], 
     Disk[{0, 0}, 1, {Pi/2 - Pi/4, Pi/2 + Pi/4}]}}, Axes -> True, 
   Ticks -> None];

GraphicsGrid[{{G0, G3}, {G1, G2}}]

where the code for G2, G3 is identical to the one for G0 (and G1), apart from replacing Pi/10 with different angles, and v[x] is a function that returns a real number for each angle.

This is what my result looks like:

enter image description here

All arrows are of length 1 and so the vectors in all four graphics should be equal in a correct 1-1 scaling. I have tried using the option "ContentSelectable -> False" but it does not help.

Can anyone provide help on how to correct this? If necessary, I could drop the graphic on the top right.

$\endgroup$
2
$\begingroup$

This reproduces your plot,

v[x_] := x/3 // N
{theta, theta2} = {\[Pi]/2, \[Pi]};
G0 = Graphics[{{Thick, 
     Arrow[{{0, 0}, {Cos[Pi/2 - Pi/10], Sin[Pi/2 - Pi/10]}}], 
     Arrow[{{0, 0}, {-Cos[Pi/2 - Pi/10], Sin[Pi/2 - Pi/10]}}], 
     Arrow[{{0, 0}, {0, 1}}]}, {Circle[{0, 0}, {1/Sqrt[v[Pi/10]], 
       Sqrt[v[Pi/10]]}]}, {Gray, Opacity[0.3], 
     Disk[{0, 0}, 1, {Pi/2 - Pi/10, Pi/2 + Pi/10}]}}, Axes -> True, 
   Ticks -> None];
G2 = Graphics[{{Thick, 
    Arrow[{{0, 0}, {Cos[Pi/2 - theta], Sin[Pi/2 - theta]}}], 
    Arrow[{{0, 0}, {-Cos[Pi/2 - theta], Sin[Pi/2 - theta]}}], 
    Arrow[{{0, 0}, {0, 1}}]}, {Circle[{0, 0}, {1/Sqrt[v[theta]], 
      Sqrt[v[theta]]}]}, {Gray, Opacity[0.3], 
    Disk[{0, 0}, 1, {Pi/2 - theta, Pi/2 + theta}]}}, Axes -> True, 
  Ticks -> None]; G1 = 
 Graphics[{{Thick, 
    Arrow[{{0, 0}, {Cos[Pi/2 - Pi/4], Sin[Pi/2 - Pi/4]}}], 
    Arrow[{{0, 0}, {-Cos[Pi/2 - Pi/4], Sin[Pi/2 - Pi/4]}}], 
    Arrow[{{0, 0}, {0, 1}}]}, {Circle[{0, 0}, {1/Sqrt[v[Pi/4]], 
      Sqrt[v[Pi/4]]}]}, {Gray, Opacity[0.3], 
    Disk[{0, 0}, 1, {Pi/2 - Pi/4, Pi/2 + Pi/4}]}}, Axes -> True, 
  Ticks -> None];
G3 = Graphics[{{Thick, 
      Arrow[{{0, 0}, {Cos[Pi/2 - theta2], Sin[Pi/2 - theta2]}}], 
      Arrow[{{0, 0}, {-Cos[Pi/2 - theta2], Sin[Pi/2 - theta2]}}], 
      Arrow[{{0, 0}, {0, 1}}]}, {Circle[{0, 0}, {1/Sqrt[v[theta2]], 
        Sqrt[v[theta2]]}]}, {Gray, Opacity[0.3], 
      Disk[{0, 0}, 1, {Pi/2 - theta2, Pi/2 + theta2}]}}, Axes -> True,
     Ticks -> None];;
GraphicsGrid[{{G0, G3}, {G1, G2}}, ImageSize -> 500]

enter image description here

The trouble is that when you defined each Graphics object, you let the system decide on the PlotRange value, which determines how big the arrow is relative to the plot. You can fix this by giving each unit the same PlotRange,

GraphicsGrid[
 Map[Show[#, PlotRange -> {{-2, 2}, {-1, 1}}] &, {{G0, G3}, {G1, 
    G2}}, {2}], ImageSize -> 500]

enter image description here

$\endgroup$
  • $\begingroup$ My pleasure. In the future, you should try to add all the code necessary to reproduce the problem. I had to toy around with it and write my own copies of your graphics to do this. That can discourage others from helping if it seems it will take too much effort :-) $\endgroup$ – Jason B. Dec 11 '15 at 15:35
  • $\begingroup$ Yep, that makes sense. Thanks! $\endgroup$ – AG1123 Dec 11 '15 at 15:50

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.