7
$\begingroup$

When I execute the lines

data1 = Table[i + j, {i, 10}, {j, 1}];
data10 = Table[i + j, {i, 10}, {j, 10}];
opts = {ImageSize -> {Automatic, 300}, BaseStyle -> {FontSize -> 14}, ImagePadding -> 25};
bothPlots = Row[{ArrayPlot[data1, opts], ArrayPlot[data10, opts]}]

I get the following picture:

enter image description here

The space between plot data and frame of the 1x10 array is much smaller than the space between the plot data and frame of the 10x10 matrix. Is there a possibility to avoide that or to set that space manually?

$\endgroup$
10
$\begingroup$

This can be fixed by specifying the PlotRangePadding option:

data1 = Table[i + j, {i, 10}, {j, 1}];
data10 = Table[i + j, {i, 10}, {j, 10}];
opts = {ImageSize -> {Automatic, 300}, BaseStyle -> {FontSize -> 14}, 
   ImagePadding -> 25, PlotRangePadding -> .2};
bothPlots = Row[{ArrayPlot[data1, opts], ArrayPlot[data10, opts]}]

padding

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