1

I want disks of equal size to be depicted the same size on different outputs of Graphics and at the same time images should be nicely clipped without any unnecessary white area.

The first two images are nicely clipped but disks are not depicted the size.

The second two images depict the disks the same size but the second is not clipped nicely.

What I want can be seen in the fifth image (images sizes are of course different, but that does not matter for me).

o1 = Disk[#] & /@ {{0, 0}, {8, 2}};
o2 = Disk[#] & /@ {{0, 0}, {5, 0}};
Graphics[o1, Frame -> True]
Graphics[o2, Frame -> True]
b = RegionBounds[RegionUnion[Flatten@{o1, o2}]];
Graphics[o1, Frame -> True, PlotRange -> b]
Graphics[o2, PlotRange -> b, Frame -> True]
Clear[o1, o2, b]

enter image description here


enter image description here


enter image description here


enter image description here



enter image description here

azerbajdzan
  • 15,863
  • 1
  • 16
  • 48

1 Answers1

4
o1 = Disk[#] & /@ {{0, 0}, {8, 2}};
o2 = Disk[#] & /@ {{0, 0}, {5, 0}};

You can use the still-undocumented form ImageSize -> a -> b (which makes $a$ user units correspond to $b$ printer's points):

Graphics[o1, Frame -> True, ImageSize -> 1 -> 30]

Graphics[o2, Frame -> True, ImageSize -> 1 -> 30]

enter image description here

kglr
  • 394,356
  • 18
  • 477
  • 896