I want to draw a picture with GraphicsRow
function in Mathematica. A simple example shows as follows
data1 = RandomInteger[5, {16, 16}];
data2 = RandomInteger[1000000000, {16, 16}];
fig1 = MatrixPlot[data1, PlotLegends -> Placed[Automatic, {0, 0.5}],
FrameTicks -> {{Automatic, None}, {Automatic, None}},
ImageSize -> 400];
fig2 = MatrixPlot[data2, PlotLegends -> Placed[Automatic, {1, 0.5}],
FrameTicks -> {{None, Automatic}, {Automatic, None}},
ImageSize -> 400];
GraphicsRow[{fig1, fig2}, Spacings -> -2]
The execution result is
where the two graphs are not of the same size. I then add
AspectRatio -> Full
action inside MatrixPlot
. The result becomes
But now the two graphs have different widths. I think the size of the two graphs does not agree because their legends are different. Since when I remove the
PlotLegend
option, the result becomes
So how can I let the two pictures agree in size while keeping the legends?
My $Version
result is 13.1.0 for Microsoft Windows (64-bit) (June 16, 2022)
.
$Version
result is13.1.0 for Microsoft Windows (64-bit) (June 16, 2022)
. Do you mean if I install version 13.2 the problem will be fixed? $\endgroup$PlotMatrix
does not have the option"PlotLayout"
) $\endgroup$