I am plotting figures on GMT but it does not support some features in gridview. So I want stack each figure on different platforms below each other. E.g. I want to add each image like the following

Stack of figures

  • 1
    Welcome to the TeX.SX! Could you please provide a fully compilable (minimum working) example (MWE) of your efforts and data file(s) or links to them? The solvers usually cannot work from a scratch on such a big task.
    – Malipivo
    Apr 17, 2014 at 9:40
  • Refers GMT to "The Generic Mapping Tools"? You have to provide more information.
    – strpeter
    Apr 17, 2014 at 10:00
  • Its tomography maps, I plot data on GMT (Generic Mapping Tools). I want to add some features like in link below and stack it but GMT not supported vector in grid view so I plot each separate and stack on different platform dropbox.com/s/dc7282i7i3lmted/Isotropy.pdf
    – Satish
    Apr 17, 2014 at 10:20
  • Some time ago I asked a related question. But for the colorbar you need a different approach.
    – strpeter
    Apr 17, 2014 at 10:56

1 Answer 1


I'll show you how to stack external files on top of one another in the manner you want, assuming you've got the ticks, axes labels and titles of the main square images in the external files. I used the file you linked in your comment for the bottom layer, and since there were no other ones (and the higher ones are different - no axes labels), I used some random images. My approach was to adjust this answer of a similar question. Here is the code:




% Layers
\begin{scope}[x={(-0.7cm,0.4cm)}, y={(.9cm,.2cm)}, z={(0cm,1cm)}]
\node[canvas is yx plane at z=0,transform shape] at (0,0) {\includegraphics[width=5cm]{isotropy3.pdf}};
\node[canvas is yx plane at z=2,transform shape] at (0,0) {\includegraphics[width=5cm]{kitten1.jpg}};
\node[canvas is yx plane at z=4,transform shape] at (0,0) {\includegraphics[width=5cm]{kitten2.jpg}};
\node[canvas is yx plane at z=6,transform shape] at (0,0) {\includegraphics[width=5cm]{kitten3.jpg}};
% Legend
\node[draw,inner sep=.3pt,line width=2pt,anchor=south west] at (4.7,-1.2) {\includegraphics[width=3cm,height=.2cm]{gradient.jpg}};
\foreach \x\y in {0/-4,.24/-3,.48/-2,.72/-1,.96/0}{
  \draw[line width=1pt] (4.75+\x*3,-.92)--+(270:.45);
  \node[anchor=north] at (4.75+\x*3,-1.35) {$\mathsf\y$};
\node at (6.3,-2.2) {\sf dc/cprem (\%)};


You can fiddle around with the arguments for the scope environment to change the projection of the images. I also included a little drawing of one of your legends using TikZ, in case you wanted to do that, using an external image (this one) for the gradient. Here is the result:

enter image description here

The bottom file is called isotropy.pdf, the one above it is kitten1.jpg, then kitten2.jpg, and finally kitten3,jpg on top, all of which are located in the same directory as your main .tex file.

  • Thank you so much @JanisL, One error "File `standalone.cls' not found. ^^M"(I used \documentclass{article} it works) and quality of output is loss, quality is so important for me.
    – Satish
    Apr 20, 2014 at 7:19
  • You can get the standalone package here if your distribution doesn't have it. I'm assuming that you mean that the output has less quality, but I'm not sure what that exactly means. There is no compression of images done in the compiling, and if you want a larger image, simply change [width=5cm] to [width=10cm] or something larger. Apr 20, 2014 at 11:32
  • @Satish Assuming you're using a standard distribution, you can use the package manager to install standalone and this is recommended. (Much less likely to cause issues than installing a downloaded copy manually.) But, as you discovered, you don't actually need it here.
    – cfr
    Aug 12, 2016 at 11:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .