# Align Array Plots

I have two ArrayPlots that I would like to align but my "tweaking" failed yet. I would like each "row" to be aligned.

lista = RandomReal[{0, 1}, 10];
listb = Table[RandomReal[{0, 1}, 10], {1000}];

Row[{ArrayPlot[{Table[0, {Length@lista}], lista}\[Transpose],
Frame -> False,
AspectRatio -> 6/1,
ImageSize -> {100, 700}],
ArrayPlot[listb\[Transpose],
AspectRatio -> 3.5/6,
ImageSize -> {1200, 700},
Frame -> False]}]


-
@500 Hi 500! What are those plots? – Dr. belisarius Apr 10 '12 at 17:55
@belisarius. Effect of a basis at first. But just cool things I find :-) Please check : leah.psych.nyu.edu/~laehNYU/main.html I am sure you will understand a lot of other questions ;-) I just really love "visual abstraction". – 500 Apr 11 '12 at 0:23
Damn! You are playing! :D ... nice work! – Dr. belisarius Apr 11 '12 at 0:58
@belisarius, Thank You :-) – 500 Apr 11 '12 at 16:19

In this particular instance, you can align the two array plots within a row by specifying each ImageSize to have the form {Automatic, h}, for some common h, and also making PlotRangePadding and ImagePadding both be none, like so:

Row[{
ArrayPlot[List /@ lista, ImageSize -> {Automatic, 250},
Frame -> False,
ArrayPlot[Transpose@listb, AspectRatio -> 1/GoldenRatio,
ImageSize -> {Automatic, 250}, Frame -> None]}
]


This yields:

-

Simply use the options ImageSize -> {Automatic, 300}, PlotRangePadding -> 0 in both plots. Adjust the height to your liking, 700 pixels is much too large for my screen, so I used 300. If you have labels/axes, also set ImagePadding to a non-Automatic value.

-
Can you check if it's a dupe of the above two questions I linked to? I don't have an mma to test. – R. M. Apr 10 '12 at 15:43
At least on my machine, I still needed to set ImagePadding without frames or axes. – Pillsy Apr 10 '12 at 15:47
@R.M Well, it's closely related, but I wouldn't close as a dupe this time ... my question was focusing on making sure that both graphics fit tightly in their cells, while the more recent question needs ImagePadding, while here PlotRangePadding is the key. – Szabolcs Apr 10 '12 at 15:53
@Pillsy On WinXP it works fine without an explicit ImagePadding (there's a margin but they're the same for the two figures), but yes, I can imagine that it is fragile without that. – Szabolcs Apr 10 '12 at 15:53
+1 It is what I was going to answer, and looks good enogh in Mma 8.0.0 Win Xp – Dr. belisarius Apr 10 '12 at 17:54