# How to preserve scaled circular shapes when combining graphics?

The following code

g1 = Graphics[{Thickness[0.01], Line[{{0, 0}, {10, 10}}], Disk[{5, 3}, Scaled[0.1]]}, Frame -> True]


produces the following output

I then create another graphic with a non-square aspect ratio, and then combine the two graphics together:

g2 = Graphics[{Blue, Thickness[0.01], Arrow[{{0, 0}, {20, 10}}]}];
Show[g1, g2]


In this case, I obtain the following output with a squashed disk:

This can, of course, be fixed by specifying an aspect ratio of 1:

Show[g1, g2, AspectRatio -> 1]


But this gives rise to various other problems when combining multiple graphics and then forcing the combined graphic to have an aspect ratio of 1 (in particular when the coordinate height and width of the combined graphics are very different).

So, I'm wondering if there is a way to preserve scaled circular shapes when combing graphics without needing to adjust the aspect ratio. Thanks!

In the case of Disk you can use Offset radius specification, but it will make the radius independent from the scale of the plot:

g1 = Graphics[{Thickness[0.01], Line[{{0, 0}, {10, 10}}],
Disk[{5, 3}, Offset[20]]}, Frame -> True];
g2 = Graphics[{Blue, Thickness[0.01], Arrow[{{0, 0}, {20, 10}}]}];
Show[g1, g2]


Inset offers more flexibility:

g1 = Graphics[{Thickness[0.01], Line[{{0, 0}, {10, 10}}],
Inset[Graphics[{Disk[{0, 0}, 1]}], {5, 3}, {0, 0}, 2.5]},
Frame -> True];
g2 = Graphics[{Blue, Thickness[0.01], Arrow[{{0, 0}, {20, 10}}]}];
Show[g1, g2]


(Note that you can specify the size of Inset also in Scaled and Offset forms.)

When you need exactly filled disks, you can use Point instead of Disk to get what you want (this also is beneficial from the performance viewpoint):

g1 = Graphics[{Thickness[0.01], Line[{{0, 0}, {10, 10}}],
PointSize[0.1], Point[{5, 3}]}, Frame -> True];
g2 = Graphics[{Blue, Thickness[0.01], Arrow[{{0, 0}, {20, 10}}]}];
Show[g1, g2]


• Thanks for the response. What would you suggest doing if one of the various graphics to be combined included many disks (say, hundreds)? Would a single inset work for all of them, or would I need to have a different inset for each of them? Jun 26, 2018 at 18:46
• @AnInquiringMind I would suggest to use Translate with Inset as the argument (if all disks should be the same). If the disks should be different, then probably you need separate Inset for each of them. But you could also try to experiment with a single Inset containing a lot of disks if the performance is critical for you. Jun 26, 2018 at 18:49
• @AnInquiringMind I've updated the answer. Jun 26, 2018 at 18:57
• Thanks for the update. I had actually shifted away from using Point a while ago, in part because of the greater flexibility allowed by Disk, but this might get me to move back. Will explore further. Jun 26, 2018 at 19:08