0

Could somebody please give me a hint of how can I do this using grouplots and tikz. I have done it using subfigure and \includegraphics, however, I am facing problems to arrange the borders of the plots relatively to the other plots.

enter image description here

\begin{figure}
\centering
\begin{subfigure}[b]{0.45\linewidth}
    \includegraphics[width=\linewidth]{./Figures/c11.tex}
    \caption{}
\end{subfigure} \quad
\begin{subfigure}[b]{0.45\linewidth}
    \includegraphics[width=\linewidth]{./Figures/c22.tex}       
    \caption{}
\end{subfigure} \\
\begin{subfigure}[b]{0.45\linewidth}
    \centering
    \includegraphics[width=\linewidth]{./Figures/c33.tex}
    \caption{}
\end{subfigure}\quad
\begin{subfigure}[b]{0.45\linewidth}
    \begin{tabular}[b]{@{}c@{}}
        \includegraphics[width=.45\linewidth]{./Figures/c44-1.tex}  \quad
        \includegraphics[width=.45\linewidth]{./Figures/c44-2.tex}\\[-3pt]
        \includegraphics[width=.45\linewidth]{./Figures/c44-3.tex}  \quad
        \includegraphics[width=.45\linewidth]{./Figures/c44-4.tex} \\[-3pt]
    \end{tabular}
    \caption{}
\end{subfigure}
\caption{bla bla}
\label{Figure1} 
\end{figure}

When I use this code, I get the following Figure. I want it to be perfectly aligned.

enter image description here

I tried to use groupplots but I am not sure how to set the subfigure that is built with 4 subplots. This is a MWE.

\documentclass[10pt,a4paper]{article}
\usepackage{tikz}
\usepackage{pgfplots}
\usepgfplotslibrary{groupplots}
\begin{document}    
\begin{figure}
   \begin{tikzpicture}
      \begin{groupplot}[
             group style={group size=2 by 2},
             cycle multiindex* list = {very thick\nextlist red\nextlist only 
             marks\nextlist}
       ] 
       \nextgroupplot \addplot {x}; \addplot {x^2};
       \nextgroupplot[cycle list = {red, blue}] \addplot {x}; \addplot {x^2};
       \nextgroupplot \addplot[green] {x}; \addplot {x^2};
       \nextgrouplot %Here I am not sure what to do
                \begin{groupplot}[
                                group style={group size=2 by 2},
                                cycle multiindex* list = {very 
                                thick\nextlist red\nextlist only 
                                marks\nextlist}
                                ]
                \nextgroupplot \addplot {x}; \addplot {x^2};
                \nextgroupplot \addplot {x}; \addplot {x^2};
                \nextgroupplot \addplot {x}; \addplot {x^2};
                \nextgroupplot \addplot {x}; \addplot {x^2};
            \end{groupplot}
      \end{groupplot}
   \end{tikzpicture}
\end{figure}
\end{document}
  • Please provide us with an MWE that shows what you have tried. (Or do you expect us to make up a group plot from scratch?) – marmot Mar 19 at 2:47
  • @marmot, I did a modification of the question, I hope it can give you an idea of what I am looking for. Thank you very much. – John Fontecha Mar 19 at 3:16
  • 1
    Thanks for improving your question! However, usually we post minimal working examples, which start with \documentclass, end with \end{document} and can be compiled. Even if I added the preamble to your code, I would not be able to run it because of \includegraphics[width=.45\linewidth]{./Figures/c44-1.tex} and the like. Apart from the fact that I do not have c44-1.tex, one cannot include TeX files via \includegraphics. – marmot Mar 19 at 4:23
  • Thank you, I can put all the code, but it is long. So, what I am looking for is a hint of how can I use groupplot inside \nextgroupplot. I do not want you to solve it, just an idea. – John Fontecha Mar 19 at 13:12
  • @marmot, I have updated the question again. I put a MWE to explain what I am looking for. Thank you – John Fontecha Mar 19 at 13:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.