7
$\begingroup$

I have figures I want to plot, and I want the figures to be the same size despite having different ranges for the y-axis. Is it possible to automatically generate figures that are the same size, instead of manually resizing each one? I've found some similar issues but none of the solutions worked for my data.

a = Table[i, {i, 0, 10, 1}]; b = Table[i, {i, 0, 100000, 10000}]; c = Table[i, {i, 0, 1000000, 100000}]; abc = {a, b, c}; time = Table[i, {i, 0, 10, 1}]; yaxis = {"Values", "Larger Values", "The largest the world has ever seen"}; Grid[{Table[ ListLinePlot[Transpose[{time[[]], abc[[k]]}], Frame -> True, AspectRatio -> 1, ImageSize -> 250, FrameLabel -> {"time (h)", yaxis[[k]]}], {k, 1, Length[abc]}]}] 

enter image description here

$\endgroup$
1
  • 3
    $\begingroup$ Maybe add a fixed ImagePadding for each plot? Something like ImagePadding -> {{60, 10}, {40, 0}} perhaps? $\endgroup$ Commented Jan 22 at 2:54

1 Answer 1

8
$\begingroup$

ImageSize -> {Automatic, 250} will do the job:

Grid[{Table[ ListLinePlot[Transpose[{time[[]], abc[[k]]}], Frame -> True, AspectRatio -> 1, ImageSize -> {Automatic, 250}, FrameLabel -> {"time (h)", yaxis[[k]]}], {k, 1, Length[abc]}]}] 

figures

$\endgroup$
2
  • $\begingroup$ However, if you put height 180, i.e., ImageSize -> {Automatic, 180}, this will not work anymore. Then one needs to pad: ImagePadding -> {{60, 10}, {40, 40}}, ImageSize -> {Automatic, 180} $\endgroup$ Commented Jan 23 at 20:30
  • $\begingroup$ @yarchik You are completely right. In such a case, I would rather make the label smaller: yaxis = {"Values", "Larger Values", Style["The largest the world has ever seen", 9]}; $\endgroup$ Commented Jan 24 at 1:40

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.