When using ImageAssemble
to combine several images, the size difference between them is a big problem. This problem contains the following parts
ImageSize
option may not generate the exact size you want. As shown in the code, two images have the same setting withImageSize->22*22
but the actual dimensions of them are different. fig1 is {484,329} while fig2 is {484,323}.How to keep them in an exactly same size ?ClearAll[fig1, fig2]; fig1 = Plot[Sin[x], {x, 0, 2 \[Pi]}, PlotRange -> {-1, 1}, ImageSize -> 22 22, Frame -> True, AspectRatio -> 2/3]; fig2 = Plot[Sin[x], {x, -\[Pi], 2.1 \[Pi]}, PlotRange -> {-1.2, 1.2},ImageSize -> 22 22, Frame -> True, AspectRatio -> 2/3]; ImageDimensions@fig1 ImageDimensions@fig2
The margin of
Framelabel
andFrameTicks
is also included in the calculation ofImageSize
, which means two images with differentFramelabel
orFrameTicks
may have different exact size even if theirImageSize
is set to be the same. fig1 shows {484,338} while fig2 shows {323}. How to resize the images so that the exact size of image is not affect by the margin of frame ?ClearAll[fig1, fig2, tickX1, tickX2]; tickX1 = Transpose[{Table[\[Pi]*i, {i, 0, 2}],Table[Style[ToString[i*2] <> "\[Pi]", 25], {i, 0, 2}]}]; fig1 = Plot[Sin[x], {x, 0, 2 \[Pi]}, PlotRange -> {-1, 1},ImageSize -> 22 22, Frame -> True, AspectRatio -> 2/3,FrameTicks -> {{Automatic, None}, {tickX1, None}}] fig2 = Plot[Sin[x], {x, 0, 2 \[Pi]}, PlotRange -> {-1.2, 1.2},ImageSize -> 22 22, Frame -> True, AspectRatio -> 2/3]; ImageDimensions@fig1 ImageDimensions@fig2
To sum up, I just want to combine several images using ImageAssemble
or ImageCollege
. Any solution that solve my problem is welcome. Thank you !
ConformImages
? $\endgroup$