Montage is simple to use like so:
montage -mode concatenate -tile 2x3 *.png -resize 1024x1024 outfile.png
But if you run it a second time this command will also include outfile.png as part of the new montage, of course.
Montage is smart enough to change formats properly, so the command can be changed to:
montage -mode concatenate -tile 2x3 *.png -resize 1024x1024 outfile.jpg
Which results in a file that is 2048 pixels wide.
If the input files are they are all of uniform size, the simplest way is to use it like so:
montage -mode concatenate -tile 2x3 *.jpg outfile.jpg
To the point of the question:
In gnuplot
with the png
terminal the default canvas size is 640x480, so a 2x3 montage to a proper JPG
results in a file that is 1280 pixels wide.
Displayed on a web page that is too wide to print. Print boundaries are roughly 640 pixels wide (depending on how the margins are set), so it will usually work well with:
montage -mode concatenate -tile 2x3 -resize 320x240 *.png outfile.jpg
Using 320x240 preserves the aspect ratio of the original plot.
Forcing it to be square should be done in the set terminal
command inside gnuplot
if that is the desired outcome.
Best practice for image post-processing is to avoid distorting the image beyond the intent of the program which generates the originals.