-3

I have 8 tikzpictures which I need to put into one single image fitting on one A4 page such that it has 3 graphs in the top row, 3 in the second row and 2 in the bottom row. The ones in the bottom row should also be centered.

Also, I am wondering how you can delete the 1,000 comma separator so that "2000" is displayed instead of "2,000".

I also would like to have one caption for all graphs that is below the graphs.

Lastly, I would also like to have a caption for the entire figure.

Here is the code that I have thus far:

\documentclass[11pt]{report}
\usepackage{tikz}
\usepackage{pgfplots}    
\begin{document}        
    \begin{tikzpicture}
        \begin{axis}[
            title={Cluster 0},
            xlabel={Year},
            ylabel={},
            xmin=2000, xmax=2020,
            ymin=0, ymax=2,
            xtick={2000,2005,2010,2015,2020},
            ytick={0,0.25,.5,.75,1,1.25,1.5,1.75,2},
            legend pos=north west,
            ymajorgrids=true,
            grid style=dashed,
        ]
        
        \addplot[
            color=blue,
            mark=square,
            ]
            coordinates {
            (2000,0)(2001,0)(2002,0)(2003,0)(2004,0)(2005,0)(2006,0)(2007,0)(2008,0)(2009,0)(2010,0)(2011,0)(2012,0)(2013,0)(2014,0)(2015,0)(2016,0)(2017,0)(2018,0)(2019,0)(2020,0)
            };
        
        \addplot[
            color=red,
            mark=square,
            ]
            coordinates{
            (2000,0)(2001,0)(2002,0)(2003,0)(2004,0)(2005,0)(2006,0)(2007,0)(2008,0)(2009,0)(2010,0)(2011,0)(2012,0)(2013,0)(2014,0)(2015,0)(2016,0)(2017,0)(2018,0)(2019,0)(2020,0)
            };
            \legend{Acquisition, Divestment, yo}
        
        \end{axis}
        
        \end{tikzpicture}
        \begin{tikzpicture}
        \begin{axis}[
            title={Cluster 1},
            xlabel={Year},
            ylabel={},
            xmin=2000, xmax=2020,
            ymin=0, ymax=2,
            xtick={2000,2005,2010,2015,2020},
            ytick={0,0.25,.5,.75,1,1.25,1.5,1.75,2},
            legend pos=north west,
            ymajorgrids=true,
            grid style=dashed,
        ]
        
        \addplot[
            color=blue,
            mark=square,
            ]
            coordinates {
            (2000,1.604166667)(2001,0.260416667)(2002,0.104166667)(2003,0.09375)(2004,0.270833333)(2005,0.15625)(2006,0.28125)(2007,0.09375)(2008,0.104166667)(2009,0.104166667)(2010,0.072916667)(2011,0.104166667)(2012,0.052083333)(2013,0.083333333)(2014,0.041666667)(2015,0.020833333)(2016,0.0625)(2017,0.0625)(2018,0.041666667)(2019,0.104166667)(2020,0.03125)
            };
        
        \addplot[
            color=red,
            mark=square,
            ]
            coordinates{
            (2000,0)(2001,0)(2002,0.010416667)(2003,0.041666667)(2004,0)(2005,0)(2006,0.020833333)(2007,0.020833333)(2008,0)(2009,0)(2010,0.010416667)(2011,0.010416667)(2012,0.03125)(2013,0.03125)(2014,0)(2015,0.03125)(2016,0.020833333)(2017,0)(2018,0)(2019,0)(2020,0.010416667)
            };
            \legend{Acquisition, Divestment, yo}
        
        \end{axis}
        
        \end{tikzpicture}
        \begin{tikzpicture}
        \begin{axis}[
            title={Cluster 2},
            xlabel={Year},
            ylabel={},
            xmin=2000, xmax=2020,
            ymin=0, ymax=0.2,
            xtick={2000,2005,2010,2015,2020},
            ytick={0,0.05,.1,.15,.2},
            legend pos=north west,
            ymajorgrids=true,
            grid style=dashed,
        ]
        
        \addplot[
            color=blue,
            mark=square,
            ]
            coordinates {
            (2000,0.063683305)(2001,0.076592083)(2002,0.083476764)(2003,0.070567986)(2004,0.081755594)(2005,0.092943201)(2006,0.098106713)(2007,0.139414802)(2008,0.111876076)(2009,0.089500861)(2010,0.100688468)(2011,0.096385542)(2012,0.093803787)(2013,0.081755594)(2014,0.102409639)(2015,0.06626506)(2016,0.100688468)(2017,0.090361446)(2018,0.080895009)(2019,0.06454389)(2020,0.048192771)
            };
        
        \addplot[
            color=red,
            mark=square,
            ]
            coordinates{
            (2000,0.024956971)(2001,0.022375215)(2002,0.009466437)(2003,0.012048193)(2004,0.008605852)(2005,0.030981067)(2006,0.017211704)(2007,0.016351119)(2008,0.015490534)(2009,0.014629948)(2010,0.020654045)(2011,0.01979346)(2012,0.0232358)(2013,0.010327022)(2014,0.018072289)(2015,0.020654045)(2016,0.017211704)(2017,0.014629948)(2018,0.015490534)(2019,0.016351119)(2020,0.010327022)
            };
            \legend{Acquisition, Divestment, yo}
        
        \end{axis}
        
        \end{tikzpicture}
        \begin{tikzpicture}
        \begin{axis}[
            title={Cluster 3},
            xlabel={Year},
            ylabel={},
            xmin=2000, xmax=2020,
            ymin=0, ymax=1.5,
            xtick={2000,2005,2010,2015,2020},
            ytick={0,0.25,.5,.75,1,1.25,1.5},
            legend pos=north west,
            ymajorgrids=true,
            grid style=dashed,
        ]
        
        \addplot[
            color=blue,
            mark=square,
            ]
            coordinates {
            (2000,0)(2001,0)(2002,0)(2003,0.012658228)(2004,0.050632911)(2005,0)(2006,0.012658228)(2007,0.012658228)(2008,0.012658228)(2009,0.037974684)(2010,0.050632911)(2011,0)(2012,0.050632911)(2013,0.025316456)(2014,0.227848101)(2015,1.316455696)(2016,0.126582278)(2017,0.063291139)(2018,0.113924051)(2019,0.037974684)(2020,0.012658228)
            };
        
        \addplot[
            color=red,
            mark=square,
            ]
            coordinates{
            (2000,0)(2001,0)(2002,0)(2003,0)(2004,0)(2005,0)(2006,0)(2007,0)(2008,0)(2009,0)(2010,0)(2011,0)(2012,0)(2013,0)(2014,0)(2015,0)(2016,0)(2017,0.012658228)(2018,0)(2019,0)(2020,0)
            };
            \legend{Acquisition, Divestment, yo}
        
        \end{axis}
        
        \end{tikzpicture}
        \begin{tikzpicture}
        \begin{axis}[
            title={Cluster 4},
            xlabel={Year},
            ylabel={},
            xmin=2000, xmax=2020,
            ymin=0, ymax=2.25,
            xtick={2000,2005,2010,2015,2020},
            ytick={0,0.25,.5,.75,1,1.25,1.5,1.75,2, 2.25},
            legend pos=north west,
            ymajorgrids=true,
            grid style=dashed,
        ]
        
        \addplot[
            color=blue,
            mark=square,
            ]
            coordinates {
            (2000,1)(2001,2.043478261)(2002,0.739130435)(2003,1.130434783)(2004,0.695652174)(2005,0.913043478)(2006,0.608695652)(2007,0.782608696)(2008,0.47826087)(2009,0.47826087)(2010,0.260869565)(2011,0.608695652)(2012,0.782608696)(2013,0.217391304)(2014,0.391304348)(2015,0.52173913)(2016,0.304347826)(2017,0.130434783)(2018,0.434782609)(2019,0.130434783)(2020,0.130434783)
            };
        
        \addplot[
            color=red,
            mark=square,
            ]
            coordinates{
            (2000,0)(2001,0)(2002,0)(2003,0)(2004,0)(2005,0.043478261)(2006,0.173913043)(2007,0.086956522)(2008,0)(2009,0)(2010,0)(2011,0)(2012,0)(2013,0)(2014,0)(2015,0.086956522)(2016,0.043478261)(2017,0)(2018,0.086956522)(2019,0.043478261)(2020,0)
            };
            \legend{Acquisition, Divestment, yo}
        
        \end{axis}
        
        \end{tikzpicture}
        \begin{tikzpicture}
        \begin{axis}[
            title={Cluster 5},
            xlabel={Year},
            ylabel={},
            xmin=2000, xmax=2020,
            ymin=0, ymax=6.5,
            xtick={2000,2005,2010,2015,2020},
            ytick={0,0.25,.5,.75,1,1.25,1.5,1.75,2,2.5,3,3.5,4,4.5,5,5.5,6,6.5},
            legend pos=north west,
            ymajorgrids=true,
            grid style=dashed,
        ]
        
        \addplot[
            color=blue,
            mark=square,
            ]
            coordinates {
            (2000,6)(2001,1.333333333)(2002,0.888888889)(2003,1)(2004,2.333333333)(2005,2.111111111)(2006,0.777777778)(2007,1.111111111)(2008,0.777777778)(2009,0.222222222)(2010,0.777777778)(2011,0.666666667)(2012,0.111111111)(2013,0.444444444)(2014,0.111111111)(2015,0.222222222)(2016,0.111111111)(2017,0.111111111)(2018,0.222222222)(2019,0)(2020,0.111111111)
            };
        
        \addplot[
            color=red,
            mark=square,
            ]
            coordinates{
            (2000,0)(2001,0)(2002,0)(2003,0)(2004,0)(2005,0)(2006,0)(2007,0)(2008,0)(2009,0)(2010,0)(2011,0.111111111)(2012,0)(2013,0)(2014,0)(2015,0.222222222)(2016,0)(2017,0)(2018,0.111111111)(2019,0)(2020,0)
            };
            \legend{Acquisition, Divestment, yo}
        
        \end{axis}
        
        \end{tikzpicture}
        \begin{tikzpicture}
        \begin{axis}[
            title={Cluster 6},
            xlabel={Year},
            ylabel={},
            xmin=2000, xmax=2020,
            ymin=0, ymax=2,
            xtick={2000,2005,2010,2015,2020},
            ytick={0,0.25,.5,.75,1,1.25,1.5,1.75,2},
            legend pos=north west,
            ymajorgrids=true,
            grid style=dashed,
        ]
        
        \addplot[
            color=blue,
            mark=square,
            ]
            coordinates {
            (2000,1.4)(2001,1.2)(2002,0.2)(2003,2.8)(2004,2)(2005,1.8)(2006,3)(2007,3.6)(2008,1.8)(2009,1)(2010,1.2)(2011,2.6)(2012,1)(2013,1.4)(2014,1)(2015,1.8)(2016,0.6)(2017,0.8)(2018,1.8)(2019,0.4)(2020,0.4)
            };
        
        \addplot[
            color=red,
            mark=square,
            ]
            coordinates{
            (2000,0)(2001,0)(2002,0)(2003,0)(2004,0)(2005,0)(2006,0)(2007,0)(2008,0)(2009,0)(2010,0)(2011,0)(2012,0)(2013,0)(2014,0)(2015,0)(2016,0)(2017,0)(2018,0.2)(2019,0.2)(2020,0)
            };
            \legend{Acquisition, Divestment, yo}
        
        \end{axis}
        
        \end{tikzpicture}
        \begin{tikzpicture}
        \begin{axis}[
            title={Cluster 7},
            xlabel={Year},
            ylabel={},
            xmin=2000, xmax=2020,
            ymin=0, ymax=10,
            xtick={2000,2005,2010,2015,2020},
            ytick={0,1,2,3,4,5,6,7,8,9,10},
            legend pos=north west,
            ymajorgrids=true,
            grid style=dashed,
        ]
        
        \addplot[
            color=blue,
            mark=square,
            ]
            coordinates {
            (2000,4)(2001,4)(2002,9)(2003,5)(2004,6)(2005,4)(2006,1)(2007,0)(2008,2)(2009,0)(2010,0)(2011,1)(2012,1)(2013,0)(2014,0)(2015,1)(2016,2)(2017,0)(2018,0)(2019,0)(2020,0)
            };
        
        \addplot[
            color=red,
            mark=square,
            ]
            coordinates{
            (2000,0)(2001,5)(2002,0)(2003,0)(2004,0)(2005,5)(2006,0)(2007,0)(2008,0)(2009,0)(2010,0)(2011,0)(2012,0)(2013,0)(2014,0)(2015,0)(2016,0)(2017,0)(2018,0)(2019,0)(2020,0)
            };
            \legend{Acquisition, Divestment, yo}
        
        \end{axis}
        \end{tikzpicture}
    \end{document}

Could someone help me out with this? Thanks in advance!

3
  • 1
    As it is, your code isn't compilable because no packages are loaded although there should be. Please provide a Minimal Working Example. Not only is it easier for the people willing to help;, but your choice of packages can greatly influenced the potential solutions.
    – Miyase
    May 28 at 6:59
  • You could put them all in one page, However each figure will become so small unless you set a larger paper size, Why not put them on separate page? BTW, \documentclass still missing
    – Tom
    May 28 at 7:09
  • Just adjusted the code. It should be accessible now
    – xxoptionxx
    May 28 at 7:11

3 Answers 3

1

This a solution as you ask. However I still think you could separate them into different pages. The figures will be larger and readable.

\documentclass[11pt,a4paper]{report}
\usepackage{geometry}
\usepackage{pgfplots}
\pgfplotsset{compat=1.18}
\pgfkeys{
/pgf/number format/.cd,1000 sep={},
}
\usepackage{subfig}
\begin{document}
\listoffigures
\clearpage
\newgeometry{margin=0cm}
\begin{figure}[ht]
\centering
\small
\subfloat[caption 1]{
\begin{tikzpicture}
\begin{axis}[
        height=0.2\paperheight,    
        title={Cluster 0},
        xlabel={Year},
        ylabel={},
        xmin=2000, xmax=2020,
        ymin=0, ymax=2,
        xtick={2000,2005,2010,2015,2020},
        ytick={0,0.25,.5,.75,1,1.25,1.5,1.75,2},
        legend pos=north west,
        legend to name=outsidelegend,
        ymajorgrids=true,
        grid style=dashed,
    ]
    
    \addplot[
        color=blue,
        mark=square,
        ]
        coordinates {
        (2000,0)(2001,0)(2002,0)(2003,0)(2004,0)(2005,0)(2006,0)(2007,0)(2008,0)(2009,0)(2010,0)(2011,0)(2012,0)(2013,0)(2014,0)(2015,0)(2016,0)(2017,0)(2018,0)(2019,0)(2020,0)
        };
    
    \addplot[
        color=red,
        mark=square,
        ]
        coordinates{
        (2000,0)(2001,0)(2002,0)(2003,0)(2004,0)(2005,0)(2006,0)(2007,0)(2008,0)(2009,0)(2010,0)(2011,0)(2012,0)(2013,0)(2014,0)(2015,0)(2016,0)(2017,0)(2018,0)(2019,0)(2020,0)
        };
        \legend{Acquisition, Divestment, yo}
    
\end{axis}
\end{tikzpicture}}
\subfloat[caption 2]{
\begin{tikzpicture}
    \begin{axis}[
        height=0.2\paperheight,
        title={Cluster 1},
        xlabel={Year},
        ylabel={},
        xmin=2000, xmax=2020,
        ymin=0, ymax=2,
        xtick={2000,2005,2010,2015,2020},
        ytick={0,0.25,.5,.75,1,1.25,1.5,1.75,2},
        ymajorgrids=true,
        grid style=dashed,
    ]
    
    \addplot[
        color=blue,
        mark=square,
        ]
        coordinates {
        (2000,1.604166667)(2001,0.260416667)(2002,0.104166667)(2003,0.09375)(2004,0.270833333)(2005,0.15625)(2006,0.28125)(2007,0.09375)(2008,0.104166667)(2009,0.104166667)(2010,0.072916667)(2011,0.104166667)(2012,0.052083333)(2013,0.083333333)(2014,0.041666667)(2015,0.020833333)(2016,0.0625)(2017,0.0625)(2018,0.041666667)(2019,0.104166667)(2020,0.03125)
        };
    
    \addplot[
        color=red,
        mark=square,
        ]
        coordinates{
        (2000,0)(2001,0)(2002,0.010416667)(2003,0.041666667)(2004,0)(2005,0)(2006,0.020833333)(2007,0.020833333)(2008,0)(2009,0)(2010,0.010416667)(2011,0.010416667)(2012,0.03125)(2013,0.03125)(2014,0)(2015,0.03125)(2016,0.020833333)(2017,0)(2018,0)(2019,0)(2020,0.010416667)
        };
    
\end{axis}
\end{tikzpicture}}
\subfloat[caption 3]{
\begin{tikzpicture}
    \begin{axis}[
        height=0.2\paperheight,
        title={Cluster 2},
        xlabel={Year},
        ylabel={},
        xmin=2000, xmax=2020,
        ymin=0, ymax=0.2,
        xtick={2000,2005,2010,2015,2020},
        ytick={0,0.05,.1,.15,.2},
        ymajorgrids=true,
        grid style=dashed,
    ]
    
    \addplot[
        color=blue,
        mark=square,
        ]
        coordinates {
        (2000,0.063683305)(2001,0.076592083)(2002,0.083476764)(2003,0.070567986)(2004,0.081755594)(2005,0.092943201)(2006,0.098106713)(2007,0.139414802)(2008,0.111876076)(2009,0.089500861)(2010,0.100688468)(2011,0.096385542)(2012,0.093803787)(2013,0.081755594)(2014,0.102409639)(2015,0.06626506)(2016,0.100688468)(2017,0.090361446)(2018,0.080895009)(2019,0.06454389)(2020,0.048192771)
        };
    
    \addplot[
        color=red,
        mark=square,
        ]
        coordinates{
        (2000,0.024956971)(2001,0.022375215)(2002,0.009466437)(2003,0.012048193)(2004,0.008605852)(2005,0.030981067)(2006,0.017211704)(2007,0.016351119)(2008,0.015490534)(2009,0.014629948)(2010,0.020654045)(2011,0.01979346)(2012,0.0232358)(2013,0.010327022)(2014,0.018072289)(2015,0.020654045)(2016,0.017211704)(2017,0.014629948)(2018,0.015490534)(2019,0.016351119)(2020,0.010327022)
        };
\end{axis}
\end{tikzpicture}}\\[10pt]
\subfloat[caption 4]{
\begin{tikzpicture}
    \begin{axis}[
        height=0.2\paperheight,
        title={Cluster 3},
        xlabel={Year},
        ylabel={},
        xmin=2000, xmax=2020,
        ymin=0, ymax=1.5,
        xtick={2000,2005,2010,2015,2020},
        ytick={0,0.25,.5,.75,1,1.25,1.5},
        ymajorgrids=true,
        grid style=dashed,
    ]
    
    \addplot[
        color=blue,
        mark=square,
        ]
        coordinates {
        (2000,0)(2001,0)(2002,0)(2003,0.012658228)(2004,0.050632911)(2005,0)(2006,0.012658228)(2007,0.012658228)(2008,0.012658228)(2009,0.037974684)(2010,0.050632911)(2011,0)(2012,0.050632911)(2013,0.025316456)(2014,0.227848101)(2015,1.316455696)(2016,0.126582278)(2017,0.063291139)(2018,0.113924051)(2019,0.037974684)(2020,0.012658228)
        };
    
    \addplot[
        color=red,
        mark=square,
        ]
        coordinates{
        (2000,0)(2001,0)(2002,0)(2003,0)(2004,0)(2005,0)(2006,0)(2007,0)(2008,0)(2009,0)(2010,0)(2011,0)(2012,0)(2013,0)(2014,0)(2015,0)(2016,0)(2017,0.012658228)(2018,0)(2019,0)(2020,0)
        };
\end{axis}
\end{tikzpicture}}
\subfloat[caption 5]{
\begin{tikzpicture}
\begin{axis}[
        height=0.2\paperheight,
        title={Cluster 4},
        xlabel={Year},
        ylabel={},
        xmin=2000, xmax=2020,
        ymin=0, ymax=2.25,
        xtick={2000,2005,2010,2015,2020},
        ytick={0,0.25,.5,.75,1,1.25,1.5,1.75,2, 2.25},
        ymajorgrids=true,
        grid style=dashed,
    ]
    
    \addplot[
        color=blue,
        mark=square,
        ]
        coordinates {
        (2000,1)(2001,2.043478261)(2002,0.739130435)(2003,1.130434783)(2004,0.695652174)(2005,0.913043478)(2006,0.608695652)(2007,0.782608696)(2008,0.47826087)(2009,0.47826087)(2010,0.260869565)(2011,0.608695652)(2012,0.782608696)(2013,0.217391304)(2014,0.391304348)(2015,0.52173913)(2016,0.304347826)(2017,0.130434783)(2018,0.434782609)(2019,0.130434783)(2020,0.130434783)
        };
    
    \addplot[
        color=red,
        mark=square,
        ]
        coordinates{
        (2000,0)(2001,0)(2002,0)(2003,0)(2004,0)(2005,0.043478261)(2006,0.173913043)(2007,0.086956522)(2008,0)(2009,0)(2010,0)(2011,0)(2012,0)(2013,0)(2014,0)(2015,0.086956522)(2016,0.043478261)(2017,0)(2018,0.086956522)(2019,0.043478261)(2020,0)
        };
\end{axis}
\end{tikzpicture}}
\subfloat[caption 6]{
\begin{tikzpicture}
    \begin{axis}[
        height=0.2\paperheight,
        title={Cluster 5},
        xlabel={Year},
        ylabel={},
        xmin=2000, xmax=2020,
        ymin=0, ymax=6.5,
        xtick={2000,2005,2010,2015,2020},
        ytick={0,0.25,.5,.75,1,1.25,1.5,1.75,2,2.5,3,3.5,4,4.5,5,5.5,6,6.5},
        ymajorgrids=true,
        grid style=dashed,
    ]
    
    \addplot[
        color=blue,
        mark=square,
        ]
        coordinates {
        (2000,6)(2001,1.333333333)(2002,0.888888889)(2003,1)(2004,2.333333333)(2005,2.111111111)(2006,0.777777778)(2007,1.111111111)(2008,0.777777778)(2009,0.222222222)(2010,0.777777778)(2011,0.666666667)(2012,0.111111111)(2013,0.444444444)(2014,0.111111111)(2015,0.222222222)(2016,0.111111111)(2017,0.111111111)(2018,0.222222222)(2019,0)(2020,0.111111111)
        };
    
    \addplot[
        color=red,
        mark=square,
        ]
        coordinates{
        (2000,0)(2001,0)(2002,0)(2003,0)(2004,0)(2005,0)(2006,0)(2007,0)(2008,0)(2009,0)(2010,0)(2011,0.111111111)(2012,0)(2013,0)(2014,0)(2015,0.222222222)(2016,0)(2017,0)(2018,0.111111111)(2019,0)(2020,0)
        };
\end{axis}
\end{tikzpicture}}\\[10pt]
\subfloat[caption 7]{
\begin{tikzpicture}
    \begin{axis}[
        height=0.2\paperheight,
        title={Cluster 6},
        xlabel={Year},
        ylabel={},
        xmin=2000, xmax=2020,
        ymin=0, ymax=2,
        xtick={2000,2005,2010,2015,2020},
        ytick={0,0.25,.5,.75,1,1.25,1.5,1.75,2},
        ymajorgrids=true,
        grid style=dashed,
    ]
    
    \addplot[
        color=blue,
        mark=square,
        ]
        coordinates {
        (2000,1.4)(2001,1.2)(2002,0.2)(2003,2.8)(2004,2)(2005,1.8)(2006,3)(2007,3.6)(2008,1.8)(2009,1)(2010,1.2)(2011,2.6)(2012,1)(2013,1.4)(2014,1)(2015,1.8)(2016,0.6)(2017,0.8)(2018,1.8)(2019,0.4)(2020,0.4)
        };
    
    \addplot[
        color=red,
        mark=square,
        ]
        coordinates{
        (2000,0)(2001,0)(2002,0)(2003,0)(2004,0)(2005,0)(2006,0)(2007,0)(2008,0)(2009,0)(2010,0)(2011,0)(2012,0)(2013,0)(2014,0)(2015,0)(2016,0)(2017,0)(2018,0.2)(2019,0.2)(2020,0)
        };
\end{axis}
\end{tikzpicture}}
\subfloat[caption 8]{
\begin{tikzpicture}
\begin{axis}[
        height=0.2\paperheight,
        title={Cluster 7},
        xlabel={Year},
        ylabel={},
        xmin=2000, xmax=2020,
        ymin=0, ymax=10,
        xtick={2000,2005,2010,2015,2020},
        ytick={0,1,2,3,4,5,6,7,8,9,10},
        ymajorgrids=true,
        grid style=dashed,
    ]
    
    \addplot[
        color=blue,
        mark=square,
        ]
        coordinates {
        (2000,4)(2001,4)(2002,9)(2003,5)(2004,6)(2005,4)(2006,1)(2007,0)(2008,2)(2009,0)(2010,0)(2011,1)(2012,1)(2013,0)(2014,0)(2015,1)(2016,2)(2017,0)(2018,0)(2019,0)(2020,0)
        };
    
    \addplot[
        color=red,
        mark=square,
        ]
        coordinates{
        (2000,0)(2001,5)(2002,0)(2003,0)(2004,0)(2005,5)(2006,0)(2007,0)(2008,0)(2009,0)(2010,0)(2011,0)(2012,0)(2013,0)(2014,0)(2015,0)(2016,0)(2017,0)(2018,0)(2019,0)(2020,0)
        };
\end{axis}
\end{tikzpicture}}\\
\ref{outsidelegend}
\caption{final caption}
\end{figure}
\clearpage
\restoregeometry
\chapter{Foo}
rest content
\end{document}

enter image description here

7
  • Thanks so much, that helps a lot! Is there also a way to change the x-axis labeling from, for instance, "2,000" to "2000"?
    – xxoptionxx
    May 28 at 7:51
  • ...and additionally: is there a way to create an overarching legend for all 8 graphs so that all legends within the individual graphs can be deleted?
    – xxoptionxx
    May 28 at 7:57
  • @xxoptionxx I edited the answer. BTW, the previous answer was not using A4 paper. Default is letter paper for report class. So you need add a4paper option to \documentclass. Now the layout is slightly changed due paper size.
    – Tom
    May 28 at 8:15
  • This is almost it! Is there also a way to slightly shift the year values on the x-axis down so that they don't overlap with the 0 of the y axis?
    – xxoptionxx
    May 28 at 8:39
  • 1
    @xxoptionxx you could put xticklabel style={below=2pt}, in the axis option.
    – Tom
    May 28 at 9:02
1

I suggest to define shorthands for the plots, so in the final part the code is much less cluttered and more easily maintainable.

The solution scales the plots to fit in one third of the text column.

\documentclass[11pt]{report}
\usepackage{tikz}
\usepackage{pgfplots}
\usepackage{subcaption}
\usepackage{graphicx}


\begin{document}        

\begin{figure}[p]

%%% no comma in years
\pgfkeys{/pgf/number format/set thousands separator={}}

%%% define shorthands for the plots
\newcommand{\plotA}{%
    \begin{tikzpicture}
        \begin{axis}[
            title={Cluster 0},
            xlabel={Year},
            ylabel={},
            xmin=2000, xmax=2020,
            ymin=0, ymax=2,
            xtick={2000,2005,2010,2015,2020},
            ytick={0,0.25,.5,.75,1,1.25,1.5,1.75,2},
            legend pos=north west,
            ymajorgrids=true,
            grid style=dashed,
        ]
        
        \addplot[
            color=blue,
            mark=square,
            ]
            coordinates {
            (2000,0)(2001,0)(2002,0)(2003,0)(2004,0)(2005,0)(2006,0)(2007,0)(2008,0)(2009,0)(2010,0)(2011,0)(2012,0)(2013,0)(2014,0)(2015,0)(2016,0)(2017,0)(2018,0)(2019,0)(2020,0)
            };
        
        \addplot[
            color=red,
            mark=square,
            ]
            coordinates{
            (2000,0)(2001,0)(2002,0)(2003,0)(2004,0)(2005,0)(2006,0)(2007,0)(2008,0)(2009,0)(2010,0)(2011,0)(2012,0)(2013,0)(2014,0)(2015,0)(2016,0)(2017,0)(2018,0)(2019,0)(2020,0)
            };
            \legend{Acquisition, Divestment, yo}
        
        \end{axis}
        
        \end{tikzpicture}%
}
\newcommand{\plotB}{%
        \begin{tikzpicture}
        \begin{axis}[
            title={Cluster 1},
            xlabel={Year},
            ylabel={},
            xmin=2000, xmax=2020,
            ymin=0, ymax=2,
            xtick={2000,2005,2010,2015,2020},
            ytick={0,0.25,.5,.75,1,1.25,1.5,1.75,2},
            legend pos=north west,
            ymajorgrids=true,
            grid style=dashed,
        ]
        
        \addplot[
            color=blue,
            mark=square,
            ]
            coordinates {
            (2000,1.604166667)(2001,0.260416667)(2002,0.104166667)(2003,0.09375)(2004,0.270833333)(2005,0.15625)(2006,0.28125)(2007,0.09375)(2008,0.104166667)(2009,0.104166667)(2010,0.072916667)(2011,0.104166667)(2012,0.052083333)(2013,0.083333333)(2014,0.041666667)(2015,0.020833333)(2016,0.0625)(2017,0.0625)(2018,0.041666667)(2019,0.104166667)(2020,0.03125)
            };
        
        \addplot[
            color=red,
            mark=square,
            ]
            coordinates{
            (2000,0)(2001,0)(2002,0.010416667)(2003,0.041666667)(2004,0)(2005,0)(2006,0.020833333)(2007,0.020833333)(2008,0)(2009,0)(2010,0.010416667)(2011,0.010416667)(2012,0.03125)(2013,0.03125)(2014,0)(2015,0.03125)(2016,0.020833333)(2017,0)(2018,0)(2019,0)(2020,0.010416667)
            };
            \legend{Acquisition, Divestment, yo}
        
        \end{axis}
        
        \end{tikzpicture}%
}
\newcommand{\plotC}{%
        \begin{tikzpicture}
        \begin{axis}[
            title={Cluster 2},
            xlabel={Year},
            ylabel={},
            xmin=2000, xmax=2020,
            ymin=0, ymax=0.2,
            xtick={2000,2005,2010,2015,2020},
            ytick={0,0.05,.1,.15,.2},
            legend pos=north west,
            ymajorgrids=true,
            grid style=dashed,
        ]
        
        \addplot[
            color=blue,
            mark=square,
            ]
            coordinates {
            (2000,0.063683305)(2001,0.076592083)(2002,0.083476764)(2003,0.070567986)(2004,0.081755594)(2005,0.092943201)(2006,0.098106713)(2007,0.139414802)(2008,0.111876076)(2009,0.089500861)(2010,0.100688468)(2011,0.096385542)(2012,0.093803787)(2013,0.081755594)(2014,0.102409639)(2015,0.06626506)(2016,0.100688468)(2017,0.090361446)(2018,0.080895009)(2019,0.06454389)(2020,0.048192771)
            };
        
        \addplot[
            color=red,
            mark=square,
            ]
            coordinates{
            (2000,0.024956971)(2001,0.022375215)(2002,0.009466437)(2003,0.012048193)(2004,0.008605852)(2005,0.030981067)(2006,0.017211704)(2007,0.016351119)(2008,0.015490534)(2009,0.014629948)(2010,0.020654045)(2011,0.01979346)(2012,0.0232358)(2013,0.010327022)(2014,0.018072289)(2015,0.020654045)(2016,0.017211704)(2017,0.014629948)(2018,0.015490534)(2019,0.016351119)(2020,0.010327022)
            };
            \legend{Acquisition, Divestment, yo}
        
        \end{axis}
        
        \end{tikzpicture}%
}
\newcommand{\plotD}{%
        \begin{tikzpicture}
        \begin{axis}[
            title={Cluster 3},
            xlabel={Year},
            ylabel={},
            xmin=2000, xmax=2020,
            ymin=0, ymax=1.5,
            xtick={2000,2005,2010,2015,2020},
            ytick={0,0.25,.5,.75,1,1.25,1.5},
            legend pos=north west,
            ymajorgrids=true,
            grid style=dashed,
        ]
        
        \addplot[
            color=blue,
            mark=square,
            ]
            coordinates {
            (2000,0)(2001,0)(2002,0)(2003,0.012658228)(2004,0.050632911)(2005,0)(2006,0.012658228)(2007,0.012658228)(2008,0.012658228)(2009,0.037974684)(2010,0.050632911)(2011,0)(2012,0.050632911)(2013,0.025316456)(2014,0.227848101)(2015,1.316455696)(2016,0.126582278)(2017,0.063291139)(2018,0.113924051)(2019,0.037974684)(2020,0.012658228)
            };
        
        \addplot[
            color=red,
            mark=square,
            ]
            coordinates{
            (2000,0)(2001,0)(2002,0)(2003,0)(2004,0)(2005,0)(2006,0)(2007,0)(2008,0)(2009,0)(2010,0)(2011,0)(2012,0)(2013,0)(2014,0)(2015,0)(2016,0)(2017,0.012658228)(2018,0)(2019,0)(2020,0)
            };
            \legend{Acquisition, Divestment, yo}
        
        \end{axis}
        
        \end{tikzpicture}%
}
\newcommand{\plotE}{%
        \begin{tikzpicture}
        \begin{axis}[
            title={Cluster 4},
            xlabel={Year},
            ylabel={},
            xmin=2000, xmax=2020,
            ymin=0, ymax=2.25,
            xtick={2000,2005,2010,2015,2020},
            ytick={0,0.25,.5,.75,1,1.25,1.5,1.75,2, 2.25},
            legend pos=north west,
            ymajorgrids=true,
            grid style=dashed,
        ]
        
        \addplot[
            color=blue,
            mark=square,
            ]
            coordinates {
            (2000,1)(2001,2.043478261)(2002,0.739130435)(2003,1.130434783)(2004,0.695652174)(2005,0.913043478)(2006,0.608695652)(2007,0.782608696)(2008,0.47826087)(2009,0.47826087)(2010,0.260869565)(2011,0.608695652)(2012,0.782608696)(2013,0.217391304)(2014,0.391304348)(2015,0.52173913)(2016,0.304347826)(2017,0.130434783)(2018,0.434782609)(2019,0.130434783)(2020,0.130434783)
            };
        
        \addplot[
            color=red,
            mark=square,
            ]
            coordinates{
            (2000,0)(2001,0)(2002,0)(2003,0)(2004,0)(2005,0.043478261)(2006,0.173913043)(2007,0.086956522)(2008,0)(2009,0)(2010,0)(2011,0)(2012,0)(2013,0)(2014,0)(2015,0.086956522)(2016,0.043478261)(2017,0)(2018,0.086956522)(2019,0.043478261)(2020,0)
            };
            \legend{Acquisition, Divestment, yo}
        
        \end{axis}
        
        \end{tikzpicture}%
}
\newcommand{\plotF}{%
        \begin{tikzpicture}
        \begin{axis}[
            title={Cluster 5},
            xlabel={Year},
            ylabel={},
            xmin=2000, xmax=2020,
            ymin=0, ymax=6.5,
            xtick={2000,2005,2010,2015,2020},
            ytick={0,0.25,.5,.75,1,1.25,1.5,1.75,2,2.5,3,3.5,4,4.5,5,5.5,6,6.5},
            legend pos=north west,
            ymajorgrids=true,
            grid style=dashed,
        ]
        
        \addplot[
            color=blue,
            mark=square,
            ]
            coordinates {
            (2000,6)(2001,1.333333333)(2002,0.888888889)(2003,1)(2004,2.333333333)(2005,2.111111111)(2006,0.777777778)(2007,1.111111111)(2008,0.777777778)(2009,0.222222222)(2010,0.777777778)(2011,0.666666667)(2012,0.111111111)(2013,0.444444444)(2014,0.111111111)(2015,0.222222222)(2016,0.111111111)(2017,0.111111111)(2018,0.222222222)(2019,0)(2020,0.111111111)
            };
        
        \addplot[
            color=red,
            mark=square,
            ]
            coordinates{
            (2000,0)(2001,0)(2002,0)(2003,0)(2004,0)(2005,0)(2006,0)(2007,0)(2008,0)(2009,0)(2010,0)(2011,0.111111111)(2012,0)(2013,0)(2014,0)(2015,0.222222222)(2016,0)(2017,0)(2018,0.111111111)(2019,0)(2020,0)
            };
            \legend{Acquisition, Divestment, yo}
        
        \end{axis}
        
        \end{tikzpicture}%
}
\newcommand{\plotG}{%
        \begin{tikzpicture}
        \begin{axis}[
            title={Cluster 6},
            xlabel={Year},
            ylabel={},
            xmin=2000, xmax=2020,
            ymin=0, ymax=2,
            xtick={2000,2005,2010,2015,2020},
            ytick={0,0.25,.5,.75,1,1.25,1.5,1.75,2},
            legend pos=north west,
            ymajorgrids=true,
            grid style=dashed,
        ]
        
        \addplot[
            color=blue,
            mark=square,
            ]
            coordinates {
            (2000,1.4)(2001,1.2)(2002,0.2)(2003,2.8)(2004,2)(2005,1.8)(2006,3)(2007,3.6)(2008,1.8)(2009,1)(2010,1.2)(2011,2.6)(2012,1)(2013,1.4)(2014,1)(2015,1.8)(2016,0.6)(2017,0.8)(2018,1.8)(2019,0.4)(2020,0.4)
            };
        
        \addplot[
            color=red,
            mark=square,
            ]
            coordinates{
            (2000,0)(2001,0)(2002,0)(2003,0)(2004,0)(2005,0)(2006,0)(2007,0)(2008,0)(2009,0)(2010,0)(2011,0)(2012,0)(2013,0)(2014,0)(2015,0)(2016,0)(2017,0)(2018,0.2)(2019,0.2)(2020,0)
            };
            \legend{Acquisition, Divestment, yo}
        
        \end{axis}
        
        \end{tikzpicture}%
}
\newcommand{\plotH}{%
        \begin{tikzpicture}
        \begin{axis}[
            title={Cluster 7},
            xlabel={Year},
            ylabel={},
            xmin=2000, xmax=2020,
            ymin=0, ymax=10,
            xtick={2000,2005,2010,2015,2020},
            ytick={0,1,2,3,4,5,6,7,8,9,10},
            legend pos=north west,
            ymajorgrids=true,
            grid style=dashed,
        ]
        
        \addplot[
            color=blue,
            mark=square,
            ]
            coordinates {
            (2000,4)(2001,4)(2002,9)(2003,5)(2004,6)(2005,4)(2006,1)(2007,0)(2008,2)(2009,0)(2010,0)(2011,1)(2012,1)(2013,0)(2014,0)(2015,1)(2016,2)(2017,0)(2018,0)(2019,0)(2020,0)
            };
        
        \addplot[
            color=red,
            mark=square,
            ]
            coordinates{
            (2000,0)(2001,5)(2002,0)(2003,0)(2004,0)(2005,5)(2006,0)(2007,0)(2008,0)(2009,0)(2010,0)(2011,0)(2012,0)(2013,0)(2014,0)(2015,0)(2016,0)(2017,0)(2018,0)(2019,0)(2020,0)
            };
            \legend{Acquisition, Divestment, yo}
        
        \end{axis}
        \end{tikzpicture}%
}

%%% now we play with the figures
%%% first row
\begin{subfigure}{0.32\columnwidth}
  \resizebox{\textwidth}{!}{\plotA}
  \caption{Caption for plot A}
\end{subfigure}\hfill
\begin{subfigure}{0.32\columnwidth}
  \resizebox{\textwidth}{!}{\plotB}
  \caption{Caption for plot B}
\end{subfigure}\hfill
\begin{subfigure}{0.32\columnwidth}
  \resizebox{\textwidth}{!}{\plotC}
  \caption{Caption for plot C}
\end{subfigure}

\bigskip

%%% second row
\begin{subfigure}{0.32\columnwidth}
  \resizebox{\textwidth}{!}{\plotD}
  \caption{Caption for plot D}
\end{subfigure}\hfill
\begin{subfigure}{0.32\columnwidth}
  \resizebox{\textwidth}{!}{\plotE}
  \caption{Caption for plot E}
\end{subfigure}\hfill
\begin{subfigure}{0.32\columnwidth}
  \resizebox{\textwidth}{!}{\plotF}
  \caption{Caption for plot F}
\end{subfigure}

\bigskip

%%% third row
\hspace*{\fill}%
\begin{subfigure}{0.32\columnwidth}
  \resizebox{\textwidth}{!}{\plotG}
  \caption{Caption for plot G}
\end{subfigure}%
\hspace*{0.04\columnwidth}%
\begin{subfigure}{0.32\columnwidth}
  \resizebox{\textwidth}{!}{\plotH}
  \caption{Caption for plot H}
\end{subfigure}%
\hspace*{\fill}

\caption{A caption for the whole set of plots}

\end{figure}

\end{document}

enter image description here

0

Edit:

  • For sub-captions below of each plots they need to be inserted in subfigure or subfloats environments, which enables writing of sub.captions.
  • The recent version (v 1.3) of the subcaption package define the both environments.
  • In my MWE below I decide to use subfloat due to its shorter code.
  • Since subfigures have many of the same settings for their styles, it makes sense to group them into a common \pgfplotsset. This makes the code much shorter and clearer.

enter image description here

\documentclass{article}
\usepackage[margin=20mm]{geometry}
\usepackage{pgfplots}
\pgfplotsset{compat=1.18}

\usepackage[aboveskip=0.5ex, belowskip=2ex]{subcaption}


\begin{document}
    \begin{figure}
    \centering
\pgfplotsset{width=0.33\linewidth, 
             height=0.4\linewidth,
    xlabel={Year},
    ylabel={},
    xmin=2000, xmax=2020,
    ymin=0,
    xtick={2000,2005,2010,2015,2020},
    yticklabel style = {font=\small, xshift=-1pt,
                        /pgf/number format/fixed zerofill},
    xticklabel style = {font=\small,
                        /pgf/number format/1000 sep=},
    legend style={legend pos=north east, anchor=north east, font=\footnotesize},
    ymajorgrids=true,
    grid style=dashed}
    
\subfloat[caption of sub figure a]{
    \begin{tikzpicture}
\begin{axis}[title={Cluster 0},
             ytick={0,.25,...,2},
             ymax=2]
%
\addplot +[mark=square] coordinates {
        (2000,0)(2001,0)(2002,0)(2003,0)(2004,0)(2005,0)(2006,0)(2007,0)(2008,0)(2009,0)(2010,0)
        (2011,0)(2012,0)(2013,0)(2014,0)(2015,0)(2016,0)(2017,0)(2018,0)(2019,0)(2020,0)
                    };
\addplot +[mark=square] coordinates{
        (2000,0)(2001,0)(2002,0)(2003,0)(2004,0)(2005,0)(2006,0)(2007,0)(2008,0)(2009,0)(2010,0)
        (2011,0)(2012,0)(2013,0)(2014,0)(2015,0)(2016,0)(2017,0)(2018,0)(2019,0)(2020,0)
                    };
        \legend{Acquisition, Divestment, yo}
    \end{axis}
    \end{tikzpicture}
}
\hfill
\subfloat[caption of sub figure b]{
    \begin{tikzpicture}
\begin{axis}[title={Cluster 1},
             ytick={0,.25,...,2},
             ymax=2]
%
\addplot +[mark=square] coordinates {
(2000,1.604166667)(2001,0.260416667)(2002,0.104166667)(2003,0.09375) (2004,0.270833333)(2005,0.15625)
        (2006,0.28125)(2007,0.09375)(2008,0.104166667)(2009,0.104166667)(2010,0.072916667)
        (2011,0.104166667)(2012,0.052083333)(2013,0.083333333)(2014,0.041666667)(2015,0.020833333)
        (2016,0.0625)(2017,0.0625)(2018,0.041666667)(2019,0.104166667)(2020,0.03125)
        };
\addplot +[mark=square] coordinates {
(2000,0)(2001,0)(2002,0.010416667)(2003,0.041666667)(2004,0)(2005,0)
        (2006,0.020833333)(2007,0.020833333)(2008,0)(2009,0)(2010,0.010416667)
        (2011,0.010416667)(2012,0.03125)(2013,0.03125)(2014,0)(2015,0.03125)
        (2016,0.020833333)(2017,0)(2018,0)(2019,0)(2020,0.010416667)
        };
        \legend{Acquisition, Divestment, yo}
\end{axis}
    \end{tikzpicture}
}
\hfill
\subfloat[caption of sub figure c]{
    \begin{tikzpicture}
\begin{axis}[title={Cluster 2},
             ytick={0,.025,...,0.2},
             ymax=0.2,   
             yticklabel style = {font=\small,
                                 /pgf/number format/.cd,fixed, fixed zerofill,
                                 precision=3},
            ]
%
\addplot +[mark=square] coordinates {
(2000,0.063683305)(2001,0.076592083)(2002,0.083476764)(2003,0.070567986)(2004,0.081755594)(2005,0.092943201)
        (2006,0.098106713)(2007,0.139414802)(2008,0.111876076)(2009,0.089500861)(2010,0.100688468)
        (2011,0.096385542)(2012,0.093803787)(2013,0.081755594)(2014,0.102409639)(2015,0.06626506)
        (2016,0.100688468)(2017,0.090361446)(2018,0.080895009)(2019,0.06454389)(2020,0.048192771)
        };
\addplot +[mark=square] coordinates {
(2000,0.024956971)(2001,0.022375215)(2002,0.009466437)(2003,0.012048193)(2004,0.008605852)(2005,0.030981067)
    (2006,0.017211704)(2007,0.016351119)(2008,0.015490534)(2009,0.014629948)(2010,0.020654045)
    (2011,0.01979346)(2012,0.0232358)(2013,0.010327022)(2014,0.018072289)(2015,0.020654045)
    (2016,0.017211704)(2017,0.014629948)(2018,0.015490534)(2019,0.016351119)(2020,0.010327022)
        };
        \legend{Acquisition, Divestment, yo}
\end{axis}
    \end{tikzpicture}
}
    
\subfloat[caption of sub figure d]{
    \begin{tikzpicture}
\begin{axis}[title={Cluster 3},
             ytick={0,.25,...,2},
             ymax=2]
%
\addplot +[mark=square] coordinates {
        (2000,0)(2001,0)(2002,0)(2003,0.012658228)(2004,0.050632911)(2005,0)
        (2006,0.012658228)(2007,0.012658228)(2008,0.012658228)(2009,0.037974684) (2010,0.050632911)
        (2011,0)(2012,0.050632911)(2013,0.025316456)(2014,0.227848101) (2015,1.316455696)
        (2016,0.126582278)(2017,0.063291139)(2018,0.113924051)(2019,0.037974684)(2020,0.012658228)
        };
\addplot +[mark=square] coordinates{
        (2000,0)(2001,0)(2002,0)(2003,0)(2004,0)(2005,0)(2006,0)(2007,0)(2008,0)(2009,0)(2010,0)
        (2011,0)(2012,0)(2013,0)(2014,0)(2015,0)(2016,0)(2017,0.012658228)(2018,0)(2019,0)(2020,0)
        };
        \legend{Acquisition, Divestment, yo}
\end{axis}
    \end{tikzpicture}
}
\hfill
\subfloat[caption of sub figure e]{
    \begin{tikzpicture}
\begin{axis}[title={Cluster 4},
             ytick={0,0.25,...,2.5},
             ymax=2.5]
%
\addplot +[mark=square] coordinates {
(2000,1)(2001,2.043478261)(2002,0.739130435)(2003,1.130434783)(2004,0.695652174)
    (2005,0.913043478)(2006,0.608695652)(2007,0.782608696)(2008,0.47826087)(2009,0.47826087)
    (2010,0.260869565)(2011,0.608695652)(2012,0.782608696)(2013,0.217391304)(2014,0.391304348)
    (2015,0.52173913)(2016,0.304347826)(2017,0.130434783)(2018,0.434782609)(2019,0.130434783)(2020,0.130434783)
                    };
\addplot +[mark=square] coordinates {
(2000,0)(2001,0)(2002,0)(2003,0)(2004,0)(2005,0.043478261)
    (2006,0.173913043)(2007,0.086956522)(2008,0)(2009,0)(2010,0)
    (2011,0)(2012,0)(2013,0)(2014,0)(2015,0.086956522)
    (2016,0.043478261)(2017,0)(2018,0.086956522)(2019,0.043478261)(2020,0)
        };
        \legend{Acquisition, Divestment, yo}
\end{axis}
    \end{tikzpicture}
}
\hfill
\subfloat[caption of sub figure f]{
    \begin{tikzpicture}
    \begin{axis}[title={Cluster 5},
             ytick={0,1,...,7},
             ymax=7]
%
\addplot +[mark=square] coordinates {
(2000,6)(2001,1.333333333)(2002,0.888888889)(2003,1)(2004,2.333333333)(2005,2.111111111)
    (2006,0.777777778)(2007,1.111111111)(2008,0.777777778)(2009,0.222222222)(2010,0.777777778)
    (2011,0.666666667)(2012,0.111111111)(2013,0.444444444)(2014,0.111111111)(2015,0.222222222)
    (2016,0.111111111)(2017,0.111111111)(2018,0.222222222)(2019,0)(2020,0.111111111)
        };
\addplot +[mark=square] coordinates{
        (2000,0)(2001,0)(2002,0)(2003,0)(2004,0)(2005,0)(2006,0)(2007,0)(2008,0)(2009,0)(2010,0)
        (2011,0.111111111)(2012,0)(2013,0)(2014,0)(2015,0.222222222)
        (2016,0)(2017,0)(2018,0.111111111)(2019,0)(2020,0)
        };
        \legend{Acquisition, Divestment, yo}
\end{axis}
    \end{tikzpicture}
}

\subfloat[caption of sub figure g]{
    \begin{tikzpicture}
\begin{axis}[title={Cluster 6},
             ytick={0,.5,...,4},
             ymax=4]
%
\addplot +[mark=square] coordinates {
    (2000,1.4)(2001,1.2)(2002,0.2)(2003,2.8)(2004,2)(2005,1.8)(2006,3)(2007,3.6)(2008,1.8)(2009,1)
    (2010,1.2)(2011,2.6)(2012,1)(2013,1.4)(2014,1)(2015,1.8)(2016,0.6)(2017,0.8)(2018,1.8)(2019,0.4)(2020,0.4)
        };
\addplot +[mark=square] coordinates {
        (2000,0)(2001,0)(2002,0)(2003,0)(2004,0)(2005,0)(2006,0)(2007,0)(2008,0)(2009,0)(2010,0)
        (2011,0)(2012,0)(2013,0)(2014,0)(2015,0)(2016,0)(2017,0)(2018,0.2)(2019,0.2)(2020,0)
        };
        \legend{Acquisition, Divestment, yo}
\end{axis}
    \end{tikzpicture}
}
\hfil
\subfloat[caption of sub figure h]{
    \begin{tikzpicture}
\begin{axis}[title={Cluster 7},
             ytick={0,2,...,10},
             ymax=10
             ]
%
\addplot +[mark=square]coordinates {
        (2000,4)(2001,4)(2002,9)(2003,5)(2004,6)(2005,4)(2006,1)(2007,0)(2008,2)(2009,0)(2010,0)
        (2011,1)(2012,1)(2013,0)(2014,0)(2015,1)(2016,2)(2017,0)(2018,0)(2019,0)(2020,0)
        };
\addplot +[mark=square]coordinates{
        (2000,0)(2001,5)(2002,0)(2003,0)(2004,0)(2005,5)(2006,0)(2007,0)(2008,0)(2009,0)(2010,0)
        (2011,0)(2012,0)(2013,0)(2014,0)(2015,0)(2016,0)(2017,0)(2018,0)(2019,0)(2020,0)
        };
        \legend{Acquisition, Divestment, yo}
\end{axis}
    \end{tikzpicture}
}
\caption{My diagrams ...}
\label{tab:my table}
    \end{figure}
\end{document}

Addendum:

  • According to my taste figure should not be wider than text area width. If for some reason (for example that images can be larger), it should protrude out of text area only on its outside border as is shown in the following MWE.
  • You may consider to have a common legend for all plots. It can be placed, for example, right from last sub-figure, see MWE below.
\documentclass{article}
\usepackage[margin=25mm]{geometry}
%---------------- show page layout. don't use in a real document!
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%
\usepackage{lipsum}% For dummy text. Don't needed in a real document
\renewcommand{\topfraction}{.95}
\renewcommand{\textfraction}{.05}

\usepackage{pgfplots}
\pgfplotsset{compat=1.18}

\usepackage[aboveskip=0.5ex, belowskip=2ex]{subcaption}
\usepackage[strict]{changepage}

\begin{document}
    \begin{figure}[htb]
\pgfplotsset{width=0.33\linewidth,
             ymajorgrids=true,
             grid style=dashed,
    xlabel={Year},
    ylabel={},
    xmin=2000, xmax=2020,
    ymin=0,
    xtick={2000,2005,2010,2015,2020},
    yticklabel style = {font=\small, xshift=-1pt,
                        /pgf/number format/fixed zerofill
                        },
    xticklabel style = {font=\small, yshift=-1pt,
                        /pgf/number format/1000 sep=},
            }
\begin{adjustwidth*}{}{-\marginparwidth}
\subfloat[caption of sub figure a   \label{subtab:mytable-a}]%
{
    \begin{tikzpicture}
\begin{axis}[title={Cluster 0},
             ytick={0,.25,...,2},
             ymax=2]
%
\addplot +[mark=square] coordinates {
        (2000,0)(2001,0)(2002,0)(2003,0)(2004,0)(2005,0)(2006,0)(2007,0)(2008,0)(2009,0)(2010,0)
        (2011,0)(2012,0)(2013,0)(2014,0)(2015,0)(2016,0)(2017,0)(2018,0)(2019,0)(2020,0)
                    };
\addplot +[mark=square] coordinates{
        (2000,0)(2001,0)(2002,0)(2003,0)(2004,0)(2005,0)(2006,0)(2007,0)(2008,0)(2009,0)(2010,0)
        (2011,0)(2012,0)(2013,0)(2014,0)(2015,0)(2016,0)(2017,0)(2018,0)(2019,0)(2020,0)
                    };
    \end{axis}
    \end{tikzpicture}
}
\hfill
\subfloat[caption of sub figure b   \label{subtab:mytable-b}]%
{
    \begin{tikzpicture}
\begin{axis}[title={Cluster 1},
             ytick={0,.25,...,2},
             ymax=2]
%
\addplot +[mark=square] coordinates {
(2000,1.604166667)(2001,0.260416667)(2002,0.104166667)(2003,0.09375) (2004,0.270833333)(2005,0.15625)
        (2006,0.28125)(2007,0.09375)(2008,0.104166667)(2009,0.104166667)(2010,0.072916667)
        (2011,0.104166667)(2012,0.052083333)(2013,0.083333333)(2014,0.041666667)(2015,0.020833333)
        (2016,0.0625)(2017,0.0625)(2018,0.041666667)(2019,0.104166667)(2020,0.03125)
        };
\addplot +[mark=square] coordinates {
(2000,0)(2001,0)(2002,0.010416667)(2003,0.041666667)(2004,0)(2005,0)
        (2006,0.020833333)(2007,0.020833333)(2008,0)(2009,0)(2010,0.010416667)
        (2011,0.010416667)(2012,0.03125)(2013,0.03125)(2014,0)(2015,0.03125)
        (2016,0.020833333)(2017,0)(2018,0)(2019,0)(2020,0.010416667)
        };
\end{axis}
    \end{tikzpicture}
}
\hfill
\subfloat[caption of sub figure c   \label{subtab:mytable-c}]%
{
    \begin{tikzpicture}
\begin{axis}[title={Cluster 2},
             ytick={0,.025,...,0.2},
             ymax=0.2,
             yticklabel style = {font=\small,
                                 /pgf/number format/.cd,fixed, fixed zerofill,
                                 precision=3},
            ]
%
\addplot +[mark=square] coordinates {
(2000,0.063683305)(2001,0.076592083)(2002,0.083476764)(2003,0.070567986)(2004,0.081755594)(2005,0.092943201)
        (2006,0.098106713)(2007,0.139414802)(2008,0.111876076)(2009,0.089500861)(2010,0.100688468)
        (2011,0.096385542)(2012,0.093803787)(2013,0.081755594)(2014,0.102409639)(2015,0.06626506)
        (2016,0.100688468)(2017,0.090361446)(2018,0.080895009)(2019,0.06454389)(2020,0.048192771)
        };
\addplot +[mark=square] coordinates {
(2000,0.024956971)(2001,0.022375215)(2002,0.009466437)(2003,0.012048193)(2004,0.008605852)(2005,0.030981067)
    (2006,0.017211704)(2007,0.016351119)(2008,0.015490534)(2009,0.014629948)(2010,0.020654045)
    (2011,0.01979346)(2012,0.0232358)(2013,0.010327022)(2014,0.018072289)(2015,0.020654045)
    (2016,0.017211704)(2017,0.014629948)(2018,0.015490534)(2019,0.016351119)(2020,0.010327022)
        };
\end{axis}
    \end{tikzpicture}
}

\subfloat[caption of sub figure d   \label{subtab:mytable-d}]%
{
    \begin{tikzpicture}
\begin{axis}[title={Cluster 3},
             ytick={0,.25,...,2},
             ymax=2]
%
\addplot +[mark=square] coordinates {
        (2000,0)(2001,0)(2002,0)(2003,0.012658228)(2004,0.050632911)(2005,0)
        (2006,0.012658228)(2007,0.012658228)(2008,0.012658228)(2009,0.037974684) (2010,0.050632911)
        (2011,0)(2012,0.050632911)(2013,0.025316456)(2014,0.227848101) (2015,1.316455696)
        (2016,0.126582278)(2017,0.063291139)(2018,0.113924051)(2019,0.037974684)(2020,0.012658228)
        };
\addplot +[mark=square] coordinates{
        (2000,0)(2001,0)(2002,0)(2003,0)(2004,0)(2005,0)(2006,0)(2007,0)(2008,0)(2009,0)(2010,0)
        (2011,0)(2012,0)(2013,0)(2014,0)(2015,0)(2016,0)(2017,0.012658228)(2018,0)(2019,0)(2020,0)
        };
\end{axis}
    \end{tikzpicture}
}
\hfill
\subfloat[caption of sub figure e   \label{subtab:mytable-e}]%
{
    \begin{tikzpicture}
\begin{axis}[title={Cluster 4},
             ytick={0,0.25,...,2.5},
             ymax=2.5]
%
\addplot +[mark=square] coordinates {
(2000,1)(2001,2.043478261)(2002,0.739130435)(2003,1.130434783)(2004,0.695652174)
    (2005,0.913043478)(2006,0.608695652)(2007,0.782608696)(2008,0.47826087)(2009,0.47826087)
    (2010,0.260869565)(2011,0.608695652)(2012,0.782608696)(2013,0.217391304)(2014,0.391304348)
    (2015,0.52173913)(2016,0.304347826)(2017,0.130434783)(2018,0.434782609)(2019,0.130434783)(2020,0.130434783)
                    };
\addplot +[mark=square] coordinates {
(2000,0)(2001,0)(2002,0)(2003,0)(2004,0)(2005,0.043478261)
    (2006,0.173913043)(2007,0.086956522)(2008,0)(2009,0)(2010,0)
    (2011,0)(2012,0)(2013,0)(2014,0)(2015,0.086956522)
    (2016,0.043478261)(2017,0)(2018,0.086956522)(2019,0.043478261)(2020,0)
        };
\end{axis}
    \end{tikzpicture}
}
\hfill
\subfloat[caption of sub figure f   \label{subtab:mytable-f}]%
{
    \begin{tikzpicture}
    \begin{axis}[title={Cluster 5},
             ytick={0,1,...,7},
             /pgf/number format/precision=0,
             ymax=7]
%
\addplot +[mark=square] coordinates {
(2000,6)(2001,1.333333333)(2002,0.888888889)(2003,1)(2004,2.333333333)(2005,2.111111111)
    (2006,0.777777778)(2007,1.111111111)(2008,0.777777778)(2009,0.222222222)(2010,0.777777778)
    (2011,0.666666667)(2012,0.111111111)(2013,0.444444444)(2014,0.111111111)(2015,0.222222222)
    (2016,0.111111111)(2017,0.111111111)(2018,0.222222222)(2019,0)(2020,0.111111111)
        };
\addplot +[mark=square] coordinates{
        (2000,0)(2001,0)(2002,0)(2003,0)(2004,0)(2005,0)(2006,0)(2007,0)(2008,0)(2009,0)(2010,0)
        (2011,0.111111111)(2012,0)(2013,0)(2014,0)(2015,0.222222222)
        (2016,0)(2017,0)(2018,0.111111111)(2019,0)(2020,0)
        };
\end{axis}
    \end{tikzpicture}
}

\subfloat[caption of sub figure g   \label{subtab:mytable-g}]%
{
    \begin{tikzpicture}
\begin{axis}[title={Cluster 6},
             ytick={0,.5,...,4},
             ymax=4]
%
\addplot +[mark=square] coordinates {
    (2000,1.4)(2001,1.2)(2002,0.2)(2003,2.8)(2004,2)(2005,1.8)(2006,3)(2007,3.6)(2008,1.8)(2009,1)
    (2010,1.2)(2011,2.6)(2012,1)(2013,1.4)(2014,1)(2015,1.8)(2016,0.6)(2017,0.8)(2018,1.8)(2019,0.4)(2020,0.4)
        };
\addplot +[mark=square] coordinates {
        (2000,0)(2001,0)(2002,0)(2003,0)(2004,0)(2005,0)(2006,0)(2007,0)(2008,0)(2009,0)(2010,0)
        (2011,0)(2012,0)(2013,0)(2014,0)(2015,0)(2016,0)(2017,0)(2018,0.2)(2019,0.2)(2020,0)
        };
\end{axis}
    \end{tikzpicture}
}
\quad
\subfloat[caption of sub figure h   \label{subtab:mytable-h}]%
{
    \begin{tikzpicture}[trim right=(current axis.south east)]
\begin{axis}[title = {Cluster 7},
             ymax=10,
             /pgf/number format/precision=0,
    legend entries = {Acquisition, Divestment, yo},
      legend style = {at={(1.6,.5)}, anchor=west,
                      font=\footnotesize}
             ]
%
\addplot +[mark=square]coordinates {
        (2000,4)(2001,4)(2002,9)(2003,5)(2004,6)(2005,4)(2006,1)(2007,0)(2008,2)(2009,0)(2010,0)
        (2011,1)(2012,1)(2013,0)(2014,0)(2015,1)(2016,2)(2017,0)(2018,0)(2019,0)(2020,0)
        };
\addplot +[mark=square]coordinates{
        (2000,0)(2001,5)(2002,0)(2003,0)(2004,0)(2005,5)(2006,0)(2007,0)(2008,0)(2009,0)(2010,0)
        (2011,0)(2012,0)(2013,0)(2014,0)(2015,0)(2016,0)(2017,0)(2018,0)(2019,0)(2020,0)
        };
\end{axis}
    \end{tikzpicture}
}

\caption{My diagrams collected in table}
\label{tab:mytable}
\end{adjustwidth*}
    \end{figure}

Now works referencing of subfigures too, for example see subfigures \ref{subtab:mytable-a} and  \ref{subtab:mytable-b} in figure \ref{tab:mytable}

\lipsum[66]
\end{document}

\lipsum[66]
\end{document}

enter image description here

(red lines indicate page layout)

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.