1
$\begingroup$

I use the following codes to produce to related graphics.

(*first code*)
gRecA = Graphics[{FaceForm[GrayLevel[1]], 
    EdgeForm[Directive[Thick, Black]], 
    Rectangle[{-12.5, 0}, {-2.5, 10}]}];
gRecB = Graphics[{FaceForm[GrayLevel[1]], 
    EdgeForm[Directive[Dotted, Black]], Rectangle[{0, 0}, {10, 10}]}];
gRecC = Graphics[{FaceForm[GrayLevel[0.8]], 
    EdgeForm[Directive[Thick, Black]], 
    Rectangle[{12.5, 0}, {22.5, 10}]}];
plusequalA = 
  Graphics[{Line[{{-1.5, 5}, {-0.5, 5}}], 
    Line[{{-1.0, 5.6}, {-1.0, 4.4}}], Line[{{-1.5, 5}, {-0.5, 5}}], 
    Line[{{10.5, 5.2}, {11.5, 5.2}}], 
    Line[{{10.5, 4.8}, {11.5, 4.8}}]}];
textA = Graphics[{Text[Style["pure matrix", 14], {-7.5, -2}], 
    Text[Style["fillers", 14], {5, -2}], 
    Text[Style["substitute matrix", 14], {17.5, -2}]}];
Show[{gRecA, gRecB, gRecC, plusequalA, textA}, PlotRange -> All, 
 PlotRangePadding -> 2, ImageSize -> Scaled[.4], Frame -> True]

(*second code*)
g2 = Graphics[{FaceForm[GrayLevel[0.9]], 
    EdgeForm[Directive[Thick, Black]], Rectangle[{0, 0}, {10, 10}]}];
g3a = Graphics[{FaceForm[GrayLevel[0.6]], EdgeForm[Black], 
    Disk[{11.3, 10.5 - 2}, 0.15]}];
g3b = Graphics[{FaceForm[GrayLevel[0.6]], EdgeForm[Black], 
    Disk[{12.7, 10.2 - 2}, 0.15]}];
g3c = Graphics[{FaceForm[GrayLevel[0.6]], EdgeForm[Black], 
    Disk[{12, 9.7 - 2}, 0.15]}];
g3d = Graphics[{FaceForm[GrayLevel[0.6]], EdgeForm[Black], 
    Disk[{13.5, 9.5 - 2}, 0.15]}];
g3e = Graphics[{FaceForm[GrayLevel[0.6]], EdgeForm[Black], 
    Disk[{13.5, 10.7 - 2}, 0.15]}];
g4 = Graphics[{FaceForm[GrayLevel[0.8]], 
    EdgeForm[Directive[Thick, Black]], 
    Rectangle[{11, 9 - 2}, {14, 11 - 2}]}];
g5 = Graphics[{Line[{{8, 8}, {11, 7}}], Line[{{8, 8}, {11, 9}}]}];
g6 = Graphics[{FaceForm[GrayLevel[0.6]], EdgeForm[Black], 
    Disk[{11.5, 6.05}, 0.25]}];
g7 = Graphics[Text[Style["Fillers", 14], {13, 6.}]];
Legended[Show[{g2, g4, g3a, g3b, g3c, g3d, g3e, g5, g6, g7}, 
  ImageSize -> Scaled[.4], Frame -> True], 
 Placed[LineLegend[{Thick, 
    Dashed}, {Style["Bundles of carbon fibers", 14], 
    Style["Bundles of glass fibers", 14]}, LegendFunction -> "Frame", 
   LegendLayout -> "Column"], Bottom]]

which produce, respectively, the following outputs

enter image description here enter image description here

As you see the square of the second graphic is bigger than those of the first graphic. So, (I do not know if I use the correct wording here) I want the square of the second graphic to match the scaling of the squares of the first one.

$\endgroup$
3
$\begingroup$

One simple way, perhaps, is to match the plot range widths and heights in both cases, e.g.:

rect = Rectangle[{0, 0}, {1, 1}];
range = {{0, 5}, {1, 2}};
g1 = Graphics[Translate[rect, #] & /@ {{0, 1}, {2, 1}, {4, 1}}, Axes -> True, PlotRange -> range]
g2 = Graphics[Translate[rect, {5, 5}], Axes -> True, PlotRange -> range + {5, 4}]

enter image description here

$\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.