Minipage/subfigure issue - creating a set of 4x3 graphs (12 total)











up vote
2
down vote

favorite












I am trying to fix a 4 by 3 set of graphs, with caption, on a .tex file. The result I want to achieve is the following:



enter image description here



(this was done in Word. Yes, that's lame, I know.)



The code for each small graph is the following:



begin{tikzpicture}
draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
end{tikzpicture}


I've tried a bunch of subfigure/minipage options but the result I am getting is far from ideal (below)



begin{minipage}[b]{0.3linewidth}
centering
begin{tikzpicture}
draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
end{tikzpicture}
end{minipage}%%
begin{minipage}[b]{0.3linewidth}
centering
begin{tikzpicture}
draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
end{tikzpicture}
end{minipage}
begin{minipage}[b]{0.3linewidth}
centering
begin{tikzpicture}
draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
end{tikzpicture}
end{minipage}%%


enter image description here



EDIT



I've fixed the positioning, but not (yet) the caption. Can someone give me a hint?



newpage
begin{figure}[H]
begin{tikzpicture}[scale=0.36]
draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
end{tikzpicture} hfill
begin{tikzpicture}[scale=0.36]
draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
end{tikzpicture} hfill
begin{tikzpicture}[scale=0.36]
draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
end{tikzpicture}
end{figure}

begin{figure}[H]
begin{tikzpicture}[scale=0.36]
draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
end{tikzpicture} hfill
begin{tikzpicture}[scale=0.36]
draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
end{tikzpicture} hfill
begin{tikzpicture}[scale=0.36]
draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
end{tikzpicture}
end{figure}

begin{figure}[H]
begin{tikzpicture}[scale=0.36]
draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
end{tikzpicture} hfill
begin{tikzpicture}[scale=0.36]
draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
end{tikzpicture} hfill
begin{tikzpicture}[scale=0.36]
draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
end{tikzpicture}
end{figure}

begin{figure}[H]
begin{tikzpicture}[scale=0.36]
draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
end{tikzpicture} hfill
begin{tikzpicture}[scale=0.36]
draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
end{tikzpicture} hfill
begin{tikzpicture}[scale=0.36]
draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
end{tikzpicture}
end{figure}


Result:



enter image description here










share|improve this question
























  • Use minipage like you did but add a hfill between them. To start a new row just add a linebreak. You can add a caption with captionof{figure}{your caption} from the caption package or from KOMA-Script if you're using it
    – faltfe
    Aug 8 at 13:05










  • you don't need subfigure or minipages or anything, just put the tikzpicture one after the other and latex will arrange them into lines, just as it does any other paragraph
    – David Carlisle
    Aug 8 at 13:07










  • @faltfe you mean like this? begin{minipage}[b]{0.32linewidth} centering begin{tikzpicture} draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9); draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$}; draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};... end{tikzpicture} end{minipage}hfill begin{minipage}[b]{0.32linewidth} centering ... (didn't work)
    – bru1987
    Aug 8 at 13:10






  • 1




    The problem is that tikzpicture works with actual paper dimensions (default is cm), so you explicitly told it to make a picture larger than textwidth/3. You probably want resizebox...
    – Phelype Oleinik
    Aug 8 at 13:13








  • 2




    please do not edit solutions in to the question it makes it very hard to answer. Also you have not provided an example document that makes it easy for people to see the problem or test answers.
    – David Carlisle
    Aug 8 at 13:30















up vote
2
down vote

favorite












I am trying to fix a 4 by 3 set of graphs, with caption, on a .tex file. The result I want to achieve is the following:



enter image description here



(this was done in Word. Yes, that's lame, I know.)



The code for each small graph is the following:



begin{tikzpicture}
draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
end{tikzpicture}


I've tried a bunch of subfigure/minipage options but the result I am getting is far from ideal (below)



begin{minipage}[b]{0.3linewidth}
centering
begin{tikzpicture}
draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
end{tikzpicture}
end{minipage}%%
begin{minipage}[b]{0.3linewidth}
centering
begin{tikzpicture}
draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
end{tikzpicture}
end{minipage}
begin{minipage}[b]{0.3linewidth}
centering
begin{tikzpicture}
draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
end{tikzpicture}
end{minipage}%%


enter image description here



EDIT



I've fixed the positioning, but not (yet) the caption. Can someone give me a hint?



newpage
begin{figure}[H]
begin{tikzpicture}[scale=0.36]
draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
end{tikzpicture} hfill
begin{tikzpicture}[scale=0.36]
draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
end{tikzpicture} hfill
begin{tikzpicture}[scale=0.36]
draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
end{tikzpicture}
end{figure}

begin{figure}[H]
begin{tikzpicture}[scale=0.36]
draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
end{tikzpicture} hfill
begin{tikzpicture}[scale=0.36]
draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
end{tikzpicture} hfill
begin{tikzpicture}[scale=0.36]
draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
end{tikzpicture}
end{figure}

begin{figure}[H]
begin{tikzpicture}[scale=0.36]
draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
end{tikzpicture} hfill
begin{tikzpicture}[scale=0.36]
draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
end{tikzpicture} hfill
begin{tikzpicture}[scale=0.36]
draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
end{tikzpicture}
end{figure}

begin{figure}[H]
begin{tikzpicture}[scale=0.36]
draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
end{tikzpicture} hfill
begin{tikzpicture}[scale=0.36]
draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
end{tikzpicture} hfill
begin{tikzpicture}[scale=0.36]
draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
end{tikzpicture}
end{figure}


Result:



enter image description here










share|improve this question
























  • Use minipage like you did but add a hfill between them. To start a new row just add a linebreak. You can add a caption with captionof{figure}{your caption} from the caption package or from KOMA-Script if you're using it
    – faltfe
    Aug 8 at 13:05










  • you don't need subfigure or minipages or anything, just put the tikzpicture one after the other and latex will arrange them into lines, just as it does any other paragraph
    – David Carlisle
    Aug 8 at 13:07










  • @faltfe you mean like this? begin{minipage}[b]{0.32linewidth} centering begin{tikzpicture} draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9); draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$}; draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};... end{tikzpicture} end{minipage}hfill begin{minipage}[b]{0.32linewidth} centering ... (didn't work)
    – bru1987
    Aug 8 at 13:10






  • 1




    The problem is that tikzpicture works with actual paper dimensions (default is cm), so you explicitly told it to make a picture larger than textwidth/3. You probably want resizebox...
    – Phelype Oleinik
    Aug 8 at 13:13








  • 2




    please do not edit solutions in to the question it makes it very hard to answer. Also you have not provided an example document that makes it easy for people to see the problem or test answers.
    – David Carlisle
    Aug 8 at 13:30













up vote
2
down vote

favorite









up vote
2
down vote

favorite











I am trying to fix a 4 by 3 set of graphs, with caption, on a .tex file. The result I want to achieve is the following:



enter image description here



(this was done in Word. Yes, that's lame, I know.)



The code for each small graph is the following:



begin{tikzpicture}
draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
end{tikzpicture}


I've tried a bunch of subfigure/minipage options but the result I am getting is far from ideal (below)



begin{minipage}[b]{0.3linewidth}
centering
begin{tikzpicture}
draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
end{tikzpicture}
end{minipage}%%
begin{minipage}[b]{0.3linewidth}
centering
begin{tikzpicture}
draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
end{tikzpicture}
end{minipage}
begin{minipage}[b]{0.3linewidth}
centering
begin{tikzpicture}
draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
end{tikzpicture}
end{minipage}%%


enter image description here



EDIT



I've fixed the positioning, but not (yet) the caption. Can someone give me a hint?



newpage
begin{figure}[H]
begin{tikzpicture}[scale=0.36]
draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
end{tikzpicture} hfill
begin{tikzpicture}[scale=0.36]
draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
end{tikzpicture} hfill
begin{tikzpicture}[scale=0.36]
draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
end{tikzpicture}
end{figure}

begin{figure}[H]
begin{tikzpicture}[scale=0.36]
draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
end{tikzpicture} hfill
begin{tikzpicture}[scale=0.36]
draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
end{tikzpicture} hfill
begin{tikzpicture}[scale=0.36]
draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
end{tikzpicture}
end{figure}

begin{figure}[H]
begin{tikzpicture}[scale=0.36]
draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
end{tikzpicture} hfill
begin{tikzpicture}[scale=0.36]
draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
end{tikzpicture} hfill
begin{tikzpicture}[scale=0.36]
draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
end{tikzpicture}
end{figure}

begin{figure}[H]
begin{tikzpicture}[scale=0.36]
draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
end{tikzpicture} hfill
begin{tikzpicture}[scale=0.36]
draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
end{tikzpicture} hfill
begin{tikzpicture}[scale=0.36]
draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
end{tikzpicture}
end{figure}


Result:



enter image description here










share|improve this question















I am trying to fix a 4 by 3 set of graphs, with caption, on a .tex file. The result I want to achieve is the following:



enter image description here



(this was done in Word. Yes, that's lame, I know.)



The code for each small graph is the following:



begin{tikzpicture}
draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
end{tikzpicture}


I've tried a bunch of subfigure/minipage options but the result I am getting is far from ideal (below)



begin{minipage}[b]{0.3linewidth}
centering
begin{tikzpicture}
draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
end{tikzpicture}
end{minipage}%%
begin{minipage}[b]{0.3linewidth}
centering
begin{tikzpicture}
draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
end{tikzpicture}
end{minipage}
begin{minipage}[b]{0.3linewidth}
centering
begin{tikzpicture}
draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
end{tikzpicture}
end{minipage}%%


enter image description here



EDIT



I've fixed the positioning, but not (yet) the caption. Can someone give me a hint?



newpage
begin{figure}[H]
begin{tikzpicture}[scale=0.36]
draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
end{tikzpicture} hfill
begin{tikzpicture}[scale=0.36]
draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
end{tikzpicture} hfill
begin{tikzpicture}[scale=0.36]
draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
end{tikzpicture}
end{figure}

begin{figure}[H]
begin{tikzpicture}[scale=0.36]
draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
end{tikzpicture} hfill
begin{tikzpicture}[scale=0.36]
draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
end{tikzpicture} hfill
begin{tikzpicture}[scale=0.36]
draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
end{tikzpicture}
end{figure}

begin{figure}[H]
begin{tikzpicture}[scale=0.36]
draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
end{tikzpicture} hfill
begin{tikzpicture}[scale=0.36]
draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
end{tikzpicture} hfill
begin{tikzpicture}[scale=0.36]
draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
end{tikzpicture}
end{figure}

begin{figure}[H]
begin{tikzpicture}[scale=0.36]
draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
end{tikzpicture} hfill
begin{tikzpicture}[scale=0.36]
draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
end{tikzpicture} hfill
begin{tikzpicture}[scale=0.36]
draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
end{tikzpicture}
end{figure}


Result:



enter image description here







graphics minipage plot






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Aug 8 at 13:26

























asked Aug 8 at 12:55









bru1987

1931314




1931314












  • Use minipage like you did but add a hfill between them. To start a new row just add a linebreak. You can add a caption with captionof{figure}{your caption} from the caption package or from KOMA-Script if you're using it
    – faltfe
    Aug 8 at 13:05










  • you don't need subfigure or minipages or anything, just put the tikzpicture one after the other and latex will arrange them into lines, just as it does any other paragraph
    – David Carlisle
    Aug 8 at 13:07










  • @faltfe you mean like this? begin{minipage}[b]{0.32linewidth} centering begin{tikzpicture} draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9); draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$}; draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};... end{tikzpicture} end{minipage}hfill begin{minipage}[b]{0.32linewidth} centering ... (didn't work)
    – bru1987
    Aug 8 at 13:10






  • 1




    The problem is that tikzpicture works with actual paper dimensions (default is cm), so you explicitly told it to make a picture larger than textwidth/3. You probably want resizebox...
    – Phelype Oleinik
    Aug 8 at 13:13








  • 2




    please do not edit solutions in to the question it makes it very hard to answer. Also you have not provided an example document that makes it easy for people to see the problem or test answers.
    – David Carlisle
    Aug 8 at 13:30


















  • Use minipage like you did but add a hfill between them. To start a new row just add a linebreak. You can add a caption with captionof{figure}{your caption} from the caption package or from KOMA-Script if you're using it
    – faltfe
    Aug 8 at 13:05










  • you don't need subfigure or minipages or anything, just put the tikzpicture one after the other and latex will arrange them into lines, just as it does any other paragraph
    – David Carlisle
    Aug 8 at 13:07










  • @faltfe you mean like this? begin{minipage}[b]{0.32linewidth} centering begin{tikzpicture} draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9); draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$}; draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};... end{tikzpicture} end{minipage}hfill begin{minipage}[b]{0.32linewidth} centering ... (didn't work)
    – bru1987
    Aug 8 at 13:10






  • 1




    The problem is that tikzpicture works with actual paper dimensions (default is cm), so you explicitly told it to make a picture larger than textwidth/3. You probably want resizebox...
    – Phelype Oleinik
    Aug 8 at 13:13








  • 2




    please do not edit solutions in to the question it makes it very hard to answer. Also you have not provided an example document that makes it easy for people to see the problem or test answers.
    – David Carlisle
    Aug 8 at 13:30
















Use minipage like you did but add a hfill between them. To start a new row just add a linebreak. You can add a caption with captionof{figure}{your caption} from the caption package or from KOMA-Script if you're using it
– faltfe
Aug 8 at 13:05




Use minipage like you did but add a hfill between them. To start a new row just add a linebreak. You can add a caption with captionof{figure}{your caption} from the caption package or from KOMA-Script if you're using it
– faltfe
Aug 8 at 13:05












you don't need subfigure or minipages or anything, just put the tikzpicture one after the other and latex will arrange them into lines, just as it does any other paragraph
– David Carlisle
Aug 8 at 13:07




you don't need subfigure or minipages or anything, just put the tikzpicture one after the other and latex will arrange them into lines, just as it does any other paragraph
– David Carlisle
Aug 8 at 13:07












@faltfe you mean like this? begin{minipage}[b]{0.32linewidth} centering begin{tikzpicture} draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9); draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$}; draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};... end{tikzpicture} end{minipage}hfill begin{minipage}[b]{0.32linewidth} centering ... (didn't work)
– bru1987
Aug 8 at 13:10




@faltfe you mean like this? begin{minipage}[b]{0.32linewidth} centering begin{tikzpicture} draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9); draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$}; draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};... end{tikzpicture} end{minipage}hfill begin{minipage}[b]{0.32linewidth} centering ... (didn't work)
– bru1987
Aug 8 at 13:10




1




1




The problem is that tikzpicture works with actual paper dimensions (default is cm), so you explicitly told it to make a picture larger than textwidth/3. You probably want resizebox...
– Phelype Oleinik
Aug 8 at 13:13






The problem is that tikzpicture works with actual paper dimensions (default is cm), so you explicitly told it to make a picture larger than textwidth/3. You probably want resizebox...
– Phelype Oleinik
Aug 8 at 13:13






2




2




please do not edit solutions in to the question it makes it very hard to answer. Also you have not provided an example document that makes it easy for people to see the problem or test answers.
– David Carlisle
Aug 8 at 13:30




please do not edit solutions in to the question it makes it very hard to answer. Also you have not provided an example document that makes it easy for people to see the problem or test answers.
– David Carlisle
Aug 8 at 13:30










3 Answers
3






active

oldest

votes

















up vote
0
down vote













does it work? Just replace the example image with your tikz code



documentclass{article}

usepackage{graphicx}
usepackage{subcaption}
usepackage{mwe}

begin{document}
begin{figure*}
centering
%%%%%%%%%start of 1st row%%%%%%%%%%%%%%
begin{subfigure}[b]{0.3textwidth}
centering
includegraphics[width=textwidth]{example.eps}
caption{your caption}
label{im1}
end{subfigure}
hfill
begin{subfigure}[b]{0.3textwidth}
centering
includegraphics[width=textwidth]{example.eps}
caption{your caption}
label{im2}
end{subfigure}
hfill
begin{subfigure}[b]{0.3textwidth}
centering
includegraphics[width=textwidth]{example.eps}
caption{your caption}
label{im3}
end{subfigure}
%%%%%%%%%%%%%End of 1st row %%%%%%%%%%%%%%%%%%%%%%%%
vskipbaselineskip
%%%%%%%%%%%%start of 2nd row%%%%%%%%%%%%%%%
begin{subfigure}[b]{0.3textwidth}
centering
includegraphics[width=textwidth]{example.eps}
caption{your caption}
label{im4}
end{subfigure}
hfill
begin{subfigure}[b]{0.3textwidth}
centering
includegraphics[width=textwidth]{example.eps}
caption{your caption}
label{im5}
end{subfigure}
hfill
begin{subfigure}[b]{0.3textwidth}
centering
includegraphics[width=textwidth]{example.eps}
caption{your caption}
label{im6}
end{subfigure}
%%%%%%%%%%%%% End of 2nd row %%%%%%%%%%%%%%%%%%%%%
vskipbaselineskip
%%%%%%%%%%%%start of 3rd row%%%%%%%%%%%%%%%
begin{subfigure}[b]{0.3textwidth}
centering
includegraphics[width=textwidth]{example.eps}
caption{your caption}
label{im7}
end{subfigure}
hfill
begin{subfigure}[b]{0.3textwidth}
centering
includegraphics[width=textwidth]{example.eps}
caption{your caption}
label{im8}
end{subfigure}
hfill
begin{subfigure}[b]{0.3textwidth}
centering
includegraphics[width=textwidth]{example.eps}
caption{your caption}
label{im9}
end{subfigure}
%%%%%%%%%%%%%End of 3rd row %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
vskipbaselineskip
%%%%%%%%%%%%start of 4th row%%%%%%%%%%%%%%%
begin{subfigure}[b]{0.3textwidth}
centering
includegraphics[width=textwidth]{example.eps}
caption{your caption}
label{im10}
end{subfigure}
hfill
begin{subfigure}[b]{0.3textwidth}
centering
includegraphics[width=textwidth]{example.eps}
caption{your caption}
label{im11}
end{subfigure}
hfill
begin{subfigure}[b]{0.3textwidth}
centering
includegraphics[width=textwidth]{example.eps}
caption{your caption}
label{im12}
end{subfigure}
%%%%%%%%%%%%%End of 4th row %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
end{figure*}
end{document}





share|improve this answer




























    up vote
    0
    down vote













    Using the hint from @PhelypeOleinik that one need resizebox the following will do the basic grid layout.



    documentclass{article}
    usepackage{graphicx, tikz, caption}

    begin{document}
    begin{minipage}{.3linewidth}
    resizebox{linewidth}{!}{%
    begin{tikzpicture}
    draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
    draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
    draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
    end{tikzpicture}
    }
    captionof{figure}{test}
    end{minipage}
    hfill
    begin{minipage}{.3linewidth}
    resizebox{linewidth}{!}{%
    begin{tikzpicture}
    draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
    draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
    draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
    end{tikzpicture}
    }
    captionof{figure}{test}
    end{minipage}
    hfill
    begin{minipage}{.3linewidth}
    resizebox{linewidth}{!}{%
    begin{tikzpicture}
    draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
    draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
    draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
    end{tikzpicture}
    }
    captionof{figure}{test}
    end{minipage}

    begin{minipage}{.3linewidth}
    resizebox{linewidth}{!}{%
    begin{tikzpicture}
    draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
    draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
    draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
    end{tikzpicture}
    }
    captionof{figure}{test}
    end{minipage}
    dots
    end{document}


    Each minipage is using 30 % of the available linewidth. The gap between the minipages get automatically filled by hfill.






    share|improve this answer




























      up vote
      0
      down vote













      little late ... but it may help someone :-)



      i would draw your diagrams with the pgfplots package. using it is simple to define size of diagrams in dependency from textwidth and preserve drawn functions' domains independent from diagram size. it also enable adding diagrams titles with option title:



      documentclass{article}
      usepackage[margin=30mm]{geometry} % define page layout

      usepackage{pgfplots}
      pgfplotsset{compat=1.16}

      %---------------- show page layout. don't use in a real document!
      usepackage{showframe}
      renewcommandShowFrameLinethickness{0.15pt}
      renewcommand*ShowFrameColor{color{red}}
      %---------------------------------------------------------------%

      begin{document}
      begin{figure}[htbp]
      pgfplotsset{width=0.3linewidth, % digrams' size
      scale only axis,
      axis lines = middle,
      grid,
      grid style = {very thin, densely dashed},
      xmin=-4.8, xmax=4.8, xtick={-4,-3,...,4}, xticklabels={},
      ymin=-4.8, ymax=4.8, ytick={-4,-3,...,4}, yticklabels={},
      xlabel=$x$, ylabel=$y$,
      xlabel style = {anchor=west, font=footnotesize},
      ylabel style = {anchor=south, font=footnotesize},
      title style = {yshift=1mm},
      %
      every axis plot post/.append style={very thick, color=blue!50, smooth},
      }
      begin{tikzpicture}
      begin{axis}[title={$y=x$}]
      addplot [domain=-4:4] {x};
      end{axis}
      end{tikzpicture} hfill
      begin{tikzpicture}
      begin{axis}[title={$y=x^2$}]
      addplot [domain=-4:4] {x^2};
      end{axis}
      end{tikzpicture} hfill
      begin{tikzpicture}
      begin{axis}[title={$y=x^3$}]
      addplot [domain=-4:4] {x^3};
      end{axis}
      end{tikzpicture}

      medskip
      begin{tikzpicture}
      begin{axis}[title={$y=x$}]
      addplot [domain=-4:4] {x};
      end{axis}
      end{tikzpicture} hfill
      begin{tikzpicture}
      begin{axis}[title={$y=x^2$}]
      addplot [domain=-4:4] {x^2};
      end{axis}
      end{tikzpicture} hfill
      begin{tikzpicture}
      begin{axis}[title={$y=x^3$}]
      addplot [domain=-4:4] {x^3};
      end{axis}
      end{tikzpicture}

      medskip
      begin{tikzpicture}
      begin{axis}[title={$y=x$}]
      addplot [domain=-4:4] {x};
      end{axis}
      end{tikzpicture} hfill
      begin{tikzpicture}
      begin{axis}[title={$y=x^2$}]
      addplot [domain=-4:4] {x^2};
      end{axis}
      end{tikzpicture} hfill
      begin{tikzpicture}
      begin{axis}[title={$y=x^3$}]
      addplot [domain=-4:4] {x^3};
      end{axis}
      end{tikzpicture}

      medskip
      begin{tikzpicture}
      begin{axis}[title={$y=x$}]
      addplot [domain=-4:4] {x};
      end{axis}
      end{tikzpicture} hfill
      begin{tikzpicture}
      begin{axis}[title={$y=x^2$}]
      addplot [domain=-4:4] {x^2};
      end{axis}
      end{tikzpicture} hfill
      begin{tikzpicture}
      begin{axis}[title={$y=x^3$}]
      addplot [domain=-4:4] {x^3};
      end{axis}
      end{tikzpicture}
      caption{Twelve diagrams}
      label{fig:twelve}
      end{figure}
      end{document}


      enter image description here



      (red lines indicate page layout)






      share|improve this answer























        Your Answer








        StackExchange.ready(function() {
        var channelOptions = {
        tags: "".split(" "),
        id: "85"
        };
        initTagRenderer("".split(" "), "".split(" "), channelOptions);

        StackExchange.using("externalEditor", function() {
        // Have to fire editor after snippets, if snippets enabled
        if (StackExchange.settings.snippets.snippetsEnabled) {
        StackExchange.using("snippets", function() {
        createEditor();
        });
        }
        else {
        createEditor();
        }
        });

        function createEditor() {
        StackExchange.prepareEditor({
        heartbeatType: 'answer',
        convertImagesToLinks: false,
        noModals: true,
        showLowRepImageUploadWarning: true,
        reputationToPostImages: null,
        bindNavPrevention: true,
        postfix: "",
        imageUploader: {
        brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
        contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
        allowUrls: true
        },
        onDemand: true,
        discardSelector: ".discard-answer"
        ,immediatelyShowMarkdownHelp:true
        });


        }
        });














        draft saved

        draft discarded


















        StackExchange.ready(
        function () {
        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f445140%2fminipage-subfigure-issue-creating-a-set-of-4x3-graphs-12-total%23new-answer', 'question_page');
        }
        );

        Post as a guest















        Required, but never shown

























        3 Answers
        3






        active

        oldest

        votes








        3 Answers
        3






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes








        up vote
        0
        down vote













        does it work? Just replace the example image with your tikz code



        documentclass{article}

        usepackage{graphicx}
        usepackage{subcaption}
        usepackage{mwe}

        begin{document}
        begin{figure*}
        centering
        %%%%%%%%%start of 1st row%%%%%%%%%%%%%%
        begin{subfigure}[b]{0.3textwidth}
        centering
        includegraphics[width=textwidth]{example.eps}
        caption{your caption}
        label{im1}
        end{subfigure}
        hfill
        begin{subfigure}[b]{0.3textwidth}
        centering
        includegraphics[width=textwidth]{example.eps}
        caption{your caption}
        label{im2}
        end{subfigure}
        hfill
        begin{subfigure}[b]{0.3textwidth}
        centering
        includegraphics[width=textwidth]{example.eps}
        caption{your caption}
        label{im3}
        end{subfigure}
        %%%%%%%%%%%%%End of 1st row %%%%%%%%%%%%%%%%%%%%%%%%
        vskipbaselineskip
        %%%%%%%%%%%%start of 2nd row%%%%%%%%%%%%%%%
        begin{subfigure}[b]{0.3textwidth}
        centering
        includegraphics[width=textwidth]{example.eps}
        caption{your caption}
        label{im4}
        end{subfigure}
        hfill
        begin{subfigure}[b]{0.3textwidth}
        centering
        includegraphics[width=textwidth]{example.eps}
        caption{your caption}
        label{im5}
        end{subfigure}
        hfill
        begin{subfigure}[b]{0.3textwidth}
        centering
        includegraphics[width=textwidth]{example.eps}
        caption{your caption}
        label{im6}
        end{subfigure}
        %%%%%%%%%%%%% End of 2nd row %%%%%%%%%%%%%%%%%%%%%
        vskipbaselineskip
        %%%%%%%%%%%%start of 3rd row%%%%%%%%%%%%%%%
        begin{subfigure}[b]{0.3textwidth}
        centering
        includegraphics[width=textwidth]{example.eps}
        caption{your caption}
        label{im7}
        end{subfigure}
        hfill
        begin{subfigure}[b]{0.3textwidth}
        centering
        includegraphics[width=textwidth]{example.eps}
        caption{your caption}
        label{im8}
        end{subfigure}
        hfill
        begin{subfigure}[b]{0.3textwidth}
        centering
        includegraphics[width=textwidth]{example.eps}
        caption{your caption}
        label{im9}
        end{subfigure}
        %%%%%%%%%%%%%End of 3rd row %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
        vskipbaselineskip
        %%%%%%%%%%%%start of 4th row%%%%%%%%%%%%%%%
        begin{subfigure}[b]{0.3textwidth}
        centering
        includegraphics[width=textwidth]{example.eps}
        caption{your caption}
        label{im10}
        end{subfigure}
        hfill
        begin{subfigure}[b]{0.3textwidth}
        centering
        includegraphics[width=textwidth]{example.eps}
        caption{your caption}
        label{im11}
        end{subfigure}
        hfill
        begin{subfigure}[b]{0.3textwidth}
        centering
        includegraphics[width=textwidth]{example.eps}
        caption{your caption}
        label{im12}
        end{subfigure}
        %%%%%%%%%%%%%End of 4th row %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
        end{figure*}
        end{document}





        share|improve this answer

























          up vote
          0
          down vote













          does it work? Just replace the example image with your tikz code



          documentclass{article}

          usepackage{graphicx}
          usepackage{subcaption}
          usepackage{mwe}

          begin{document}
          begin{figure*}
          centering
          %%%%%%%%%start of 1st row%%%%%%%%%%%%%%
          begin{subfigure}[b]{0.3textwidth}
          centering
          includegraphics[width=textwidth]{example.eps}
          caption{your caption}
          label{im1}
          end{subfigure}
          hfill
          begin{subfigure}[b]{0.3textwidth}
          centering
          includegraphics[width=textwidth]{example.eps}
          caption{your caption}
          label{im2}
          end{subfigure}
          hfill
          begin{subfigure}[b]{0.3textwidth}
          centering
          includegraphics[width=textwidth]{example.eps}
          caption{your caption}
          label{im3}
          end{subfigure}
          %%%%%%%%%%%%%End of 1st row %%%%%%%%%%%%%%%%%%%%%%%%
          vskipbaselineskip
          %%%%%%%%%%%%start of 2nd row%%%%%%%%%%%%%%%
          begin{subfigure}[b]{0.3textwidth}
          centering
          includegraphics[width=textwidth]{example.eps}
          caption{your caption}
          label{im4}
          end{subfigure}
          hfill
          begin{subfigure}[b]{0.3textwidth}
          centering
          includegraphics[width=textwidth]{example.eps}
          caption{your caption}
          label{im5}
          end{subfigure}
          hfill
          begin{subfigure}[b]{0.3textwidth}
          centering
          includegraphics[width=textwidth]{example.eps}
          caption{your caption}
          label{im6}
          end{subfigure}
          %%%%%%%%%%%%% End of 2nd row %%%%%%%%%%%%%%%%%%%%%
          vskipbaselineskip
          %%%%%%%%%%%%start of 3rd row%%%%%%%%%%%%%%%
          begin{subfigure}[b]{0.3textwidth}
          centering
          includegraphics[width=textwidth]{example.eps}
          caption{your caption}
          label{im7}
          end{subfigure}
          hfill
          begin{subfigure}[b]{0.3textwidth}
          centering
          includegraphics[width=textwidth]{example.eps}
          caption{your caption}
          label{im8}
          end{subfigure}
          hfill
          begin{subfigure}[b]{0.3textwidth}
          centering
          includegraphics[width=textwidth]{example.eps}
          caption{your caption}
          label{im9}
          end{subfigure}
          %%%%%%%%%%%%%End of 3rd row %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
          vskipbaselineskip
          %%%%%%%%%%%%start of 4th row%%%%%%%%%%%%%%%
          begin{subfigure}[b]{0.3textwidth}
          centering
          includegraphics[width=textwidth]{example.eps}
          caption{your caption}
          label{im10}
          end{subfigure}
          hfill
          begin{subfigure}[b]{0.3textwidth}
          centering
          includegraphics[width=textwidth]{example.eps}
          caption{your caption}
          label{im11}
          end{subfigure}
          hfill
          begin{subfigure}[b]{0.3textwidth}
          centering
          includegraphics[width=textwidth]{example.eps}
          caption{your caption}
          label{im12}
          end{subfigure}
          %%%%%%%%%%%%%End of 4th row %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
          end{figure*}
          end{document}





          share|improve this answer























            up vote
            0
            down vote










            up vote
            0
            down vote









            does it work? Just replace the example image with your tikz code



            documentclass{article}

            usepackage{graphicx}
            usepackage{subcaption}
            usepackage{mwe}

            begin{document}
            begin{figure*}
            centering
            %%%%%%%%%start of 1st row%%%%%%%%%%%%%%
            begin{subfigure}[b]{0.3textwidth}
            centering
            includegraphics[width=textwidth]{example.eps}
            caption{your caption}
            label{im1}
            end{subfigure}
            hfill
            begin{subfigure}[b]{0.3textwidth}
            centering
            includegraphics[width=textwidth]{example.eps}
            caption{your caption}
            label{im2}
            end{subfigure}
            hfill
            begin{subfigure}[b]{0.3textwidth}
            centering
            includegraphics[width=textwidth]{example.eps}
            caption{your caption}
            label{im3}
            end{subfigure}
            %%%%%%%%%%%%%End of 1st row %%%%%%%%%%%%%%%%%%%%%%%%
            vskipbaselineskip
            %%%%%%%%%%%%start of 2nd row%%%%%%%%%%%%%%%
            begin{subfigure}[b]{0.3textwidth}
            centering
            includegraphics[width=textwidth]{example.eps}
            caption{your caption}
            label{im4}
            end{subfigure}
            hfill
            begin{subfigure}[b]{0.3textwidth}
            centering
            includegraphics[width=textwidth]{example.eps}
            caption{your caption}
            label{im5}
            end{subfigure}
            hfill
            begin{subfigure}[b]{0.3textwidth}
            centering
            includegraphics[width=textwidth]{example.eps}
            caption{your caption}
            label{im6}
            end{subfigure}
            %%%%%%%%%%%%% End of 2nd row %%%%%%%%%%%%%%%%%%%%%
            vskipbaselineskip
            %%%%%%%%%%%%start of 3rd row%%%%%%%%%%%%%%%
            begin{subfigure}[b]{0.3textwidth}
            centering
            includegraphics[width=textwidth]{example.eps}
            caption{your caption}
            label{im7}
            end{subfigure}
            hfill
            begin{subfigure}[b]{0.3textwidth}
            centering
            includegraphics[width=textwidth]{example.eps}
            caption{your caption}
            label{im8}
            end{subfigure}
            hfill
            begin{subfigure}[b]{0.3textwidth}
            centering
            includegraphics[width=textwidth]{example.eps}
            caption{your caption}
            label{im9}
            end{subfigure}
            %%%%%%%%%%%%%End of 3rd row %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
            vskipbaselineskip
            %%%%%%%%%%%%start of 4th row%%%%%%%%%%%%%%%
            begin{subfigure}[b]{0.3textwidth}
            centering
            includegraphics[width=textwidth]{example.eps}
            caption{your caption}
            label{im10}
            end{subfigure}
            hfill
            begin{subfigure}[b]{0.3textwidth}
            centering
            includegraphics[width=textwidth]{example.eps}
            caption{your caption}
            label{im11}
            end{subfigure}
            hfill
            begin{subfigure}[b]{0.3textwidth}
            centering
            includegraphics[width=textwidth]{example.eps}
            caption{your caption}
            label{im12}
            end{subfigure}
            %%%%%%%%%%%%%End of 4th row %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
            end{figure*}
            end{document}





            share|improve this answer












            does it work? Just replace the example image with your tikz code



            documentclass{article}

            usepackage{graphicx}
            usepackage{subcaption}
            usepackage{mwe}

            begin{document}
            begin{figure*}
            centering
            %%%%%%%%%start of 1st row%%%%%%%%%%%%%%
            begin{subfigure}[b]{0.3textwidth}
            centering
            includegraphics[width=textwidth]{example.eps}
            caption{your caption}
            label{im1}
            end{subfigure}
            hfill
            begin{subfigure}[b]{0.3textwidth}
            centering
            includegraphics[width=textwidth]{example.eps}
            caption{your caption}
            label{im2}
            end{subfigure}
            hfill
            begin{subfigure}[b]{0.3textwidth}
            centering
            includegraphics[width=textwidth]{example.eps}
            caption{your caption}
            label{im3}
            end{subfigure}
            %%%%%%%%%%%%%End of 1st row %%%%%%%%%%%%%%%%%%%%%%%%
            vskipbaselineskip
            %%%%%%%%%%%%start of 2nd row%%%%%%%%%%%%%%%
            begin{subfigure}[b]{0.3textwidth}
            centering
            includegraphics[width=textwidth]{example.eps}
            caption{your caption}
            label{im4}
            end{subfigure}
            hfill
            begin{subfigure}[b]{0.3textwidth}
            centering
            includegraphics[width=textwidth]{example.eps}
            caption{your caption}
            label{im5}
            end{subfigure}
            hfill
            begin{subfigure}[b]{0.3textwidth}
            centering
            includegraphics[width=textwidth]{example.eps}
            caption{your caption}
            label{im6}
            end{subfigure}
            %%%%%%%%%%%%% End of 2nd row %%%%%%%%%%%%%%%%%%%%%
            vskipbaselineskip
            %%%%%%%%%%%%start of 3rd row%%%%%%%%%%%%%%%
            begin{subfigure}[b]{0.3textwidth}
            centering
            includegraphics[width=textwidth]{example.eps}
            caption{your caption}
            label{im7}
            end{subfigure}
            hfill
            begin{subfigure}[b]{0.3textwidth}
            centering
            includegraphics[width=textwidth]{example.eps}
            caption{your caption}
            label{im8}
            end{subfigure}
            hfill
            begin{subfigure}[b]{0.3textwidth}
            centering
            includegraphics[width=textwidth]{example.eps}
            caption{your caption}
            label{im9}
            end{subfigure}
            %%%%%%%%%%%%%End of 3rd row %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
            vskipbaselineskip
            %%%%%%%%%%%%start of 4th row%%%%%%%%%%%%%%%
            begin{subfigure}[b]{0.3textwidth}
            centering
            includegraphics[width=textwidth]{example.eps}
            caption{your caption}
            label{im10}
            end{subfigure}
            hfill
            begin{subfigure}[b]{0.3textwidth}
            centering
            includegraphics[width=textwidth]{example.eps}
            caption{your caption}
            label{im11}
            end{subfigure}
            hfill
            begin{subfigure}[b]{0.3textwidth}
            centering
            includegraphics[width=textwidth]{example.eps}
            caption{your caption}
            label{im12}
            end{subfigure}
            %%%%%%%%%%%%%End of 4th row %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
            end{figure*}
            end{document}






            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Aug 8 at 13:25









            Aritra

            83




            83






















                up vote
                0
                down vote













                Using the hint from @PhelypeOleinik that one need resizebox the following will do the basic grid layout.



                documentclass{article}
                usepackage{graphicx, tikz, caption}

                begin{document}
                begin{minipage}{.3linewidth}
                resizebox{linewidth}{!}{%
                begin{tikzpicture}
                draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
                draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
                draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
                end{tikzpicture}
                }
                captionof{figure}{test}
                end{minipage}
                hfill
                begin{minipage}{.3linewidth}
                resizebox{linewidth}{!}{%
                begin{tikzpicture}
                draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
                draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
                draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
                end{tikzpicture}
                }
                captionof{figure}{test}
                end{minipage}
                hfill
                begin{minipage}{.3linewidth}
                resizebox{linewidth}{!}{%
                begin{tikzpicture}
                draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
                draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
                draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
                end{tikzpicture}
                }
                captionof{figure}{test}
                end{minipage}

                begin{minipage}{.3linewidth}
                resizebox{linewidth}{!}{%
                begin{tikzpicture}
                draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
                draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
                draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
                end{tikzpicture}
                }
                captionof{figure}{test}
                end{minipage}
                dots
                end{document}


                Each minipage is using 30 % of the available linewidth. The gap between the minipages get automatically filled by hfill.






                share|improve this answer

























                  up vote
                  0
                  down vote













                  Using the hint from @PhelypeOleinik that one need resizebox the following will do the basic grid layout.



                  documentclass{article}
                  usepackage{graphicx, tikz, caption}

                  begin{document}
                  begin{minipage}{.3linewidth}
                  resizebox{linewidth}{!}{%
                  begin{tikzpicture}
                  draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
                  draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
                  draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
                  end{tikzpicture}
                  }
                  captionof{figure}{test}
                  end{minipage}
                  hfill
                  begin{minipage}{.3linewidth}
                  resizebox{linewidth}{!}{%
                  begin{tikzpicture}
                  draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
                  draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
                  draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
                  end{tikzpicture}
                  }
                  captionof{figure}{test}
                  end{minipage}
                  hfill
                  begin{minipage}{.3linewidth}
                  resizebox{linewidth}{!}{%
                  begin{tikzpicture}
                  draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
                  draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
                  draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
                  end{tikzpicture}
                  }
                  captionof{figure}{test}
                  end{minipage}

                  begin{minipage}{.3linewidth}
                  resizebox{linewidth}{!}{%
                  begin{tikzpicture}
                  draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
                  draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
                  draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
                  end{tikzpicture}
                  }
                  captionof{figure}{test}
                  end{minipage}
                  dots
                  end{document}


                  Each minipage is using 30 % of the available linewidth. The gap between the minipages get automatically filled by hfill.






                  share|improve this answer























                    up vote
                    0
                    down vote










                    up vote
                    0
                    down vote









                    Using the hint from @PhelypeOleinik that one need resizebox the following will do the basic grid layout.



                    documentclass{article}
                    usepackage{graphicx, tikz, caption}

                    begin{document}
                    begin{minipage}{.3linewidth}
                    resizebox{linewidth}{!}{%
                    begin{tikzpicture}
                    draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
                    draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
                    draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
                    end{tikzpicture}
                    }
                    captionof{figure}{test}
                    end{minipage}
                    hfill
                    begin{minipage}{.3linewidth}
                    resizebox{linewidth}{!}{%
                    begin{tikzpicture}
                    draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
                    draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
                    draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
                    end{tikzpicture}
                    }
                    captionof{figure}{test}
                    end{minipage}
                    hfill
                    begin{minipage}{.3linewidth}
                    resizebox{linewidth}{!}{%
                    begin{tikzpicture}
                    draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
                    draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
                    draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
                    end{tikzpicture}
                    }
                    captionof{figure}{test}
                    end{minipage}

                    begin{minipage}{.3linewidth}
                    resizebox{linewidth}{!}{%
                    begin{tikzpicture}
                    draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
                    draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
                    draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
                    end{tikzpicture}
                    }
                    captionof{figure}{test}
                    end{minipage}
                    dots
                    end{document}


                    Each minipage is using 30 % of the available linewidth. The gap between the minipages get automatically filled by hfill.






                    share|improve this answer












                    Using the hint from @PhelypeOleinik that one need resizebox the following will do the basic grid layout.



                    documentclass{article}
                    usepackage{graphicx, tikz, caption}

                    begin{document}
                    begin{minipage}{.3linewidth}
                    resizebox{linewidth}{!}{%
                    begin{tikzpicture}
                    draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
                    draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
                    draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
                    end{tikzpicture}
                    }
                    captionof{figure}{test}
                    end{minipage}
                    hfill
                    begin{minipage}{.3linewidth}
                    resizebox{linewidth}{!}{%
                    begin{tikzpicture}
                    draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
                    draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
                    draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
                    end{tikzpicture}
                    }
                    captionof{figure}{test}
                    end{minipage}
                    hfill
                    begin{minipage}{.3linewidth}
                    resizebox{linewidth}{!}{%
                    begin{tikzpicture}
                    draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
                    draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
                    draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
                    end{tikzpicture}
                    }
                    captionof{figure}{test}
                    end{minipage}

                    begin{minipage}{.3linewidth}
                    resizebox{linewidth}{!}{%
                    begin{tikzpicture}
                    draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
                    draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
                    draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};...
                    end{tikzpicture}
                    }
                    captionof{figure}{test}
                    end{minipage}
                    dots
                    end{document}


                    Each minipage is using 30 % of the available linewidth. The gap between the minipages get automatically filled by hfill.







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Aug 8 at 13:33









                    faltfe

                    32918




                    32918






















                        up vote
                        0
                        down vote













                        little late ... but it may help someone :-)



                        i would draw your diagrams with the pgfplots package. using it is simple to define size of diagrams in dependency from textwidth and preserve drawn functions' domains independent from diagram size. it also enable adding diagrams titles with option title:



                        documentclass{article}
                        usepackage[margin=30mm]{geometry} % define page layout

                        usepackage{pgfplots}
                        pgfplotsset{compat=1.16}

                        %---------------- show page layout. don't use in a real document!
                        usepackage{showframe}
                        renewcommandShowFrameLinethickness{0.15pt}
                        renewcommand*ShowFrameColor{color{red}}
                        %---------------------------------------------------------------%

                        begin{document}
                        begin{figure}[htbp]
                        pgfplotsset{width=0.3linewidth, % digrams' size
                        scale only axis,
                        axis lines = middle,
                        grid,
                        grid style = {very thin, densely dashed},
                        xmin=-4.8, xmax=4.8, xtick={-4,-3,...,4}, xticklabels={},
                        ymin=-4.8, ymax=4.8, ytick={-4,-3,...,4}, yticklabels={},
                        xlabel=$x$, ylabel=$y$,
                        xlabel style = {anchor=west, font=footnotesize},
                        ylabel style = {anchor=south, font=footnotesize},
                        title style = {yshift=1mm},
                        %
                        every axis plot post/.append style={very thick, color=blue!50, smooth},
                        }
                        begin{tikzpicture}
                        begin{axis}[title={$y=x$}]
                        addplot [domain=-4:4] {x};
                        end{axis}
                        end{tikzpicture} hfill
                        begin{tikzpicture}
                        begin{axis}[title={$y=x^2$}]
                        addplot [domain=-4:4] {x^2};
                        end{axis}
                        end{tikzpicture} hfill
                        begin{tikzpicture}
                        begin{axis}[title={$y=x^3$}]
                        addplot [domain=-4:4] {x^3};
                        end{axis}
                        end{tikzpicture}

                        medskip
                        begin{tikzpicture}
                        begin{axis}[title={$y=x$}]
                        addplot [domain=-4:4] {x};
                        end{axis}
                        end{tikzpicture} hfill
                        begin{tikzpicture}
                        begin{axis}[title={$y=x^2$}]
                        addplot [domain=-4:4] {x^2};
                        end{axis}
                        end{tikzpicture} hfill
                        begin{tikzpicture}
                        begin{axis}[title={$y=x^3$}]
                        addplot [domain=-4:4] {x^3};
                        end{axis}
                        end{tikzpicture}

                        medskip
                        begin{tikzpicture}
                        begin{axis}[title={$y=x$}]
                        addplot [domain=-4:4] {x};
                        end{axis}
                        end{tikzpicture} hfill
                        begin{tikzpicture}
                        begin{axis}[title={$y=x^2$}]
                        addplot [domain=-4:4] {x^2};
                        end{axis}
                        end{tikzpicture} hfill
                        begin{tikzpicture}
                        begin{axis}[title={$y=x^3$}]
                        addplot [domain=-4:4] {x^3};
                        end{axis}
                        end{tikzpicture}

                        medskip
                        begin{tikzpicture}
                        begin{axis}[title={$y=x$}]
                        addplot [domain=-4:4] {x};
                        end{axis}
                        end{tikzpicture} hfill
                        begin{tikzpicture}
                        begin{axis}[title={$y=x^2$}]
                        addplot [domain=-4:4] {x^2};
                        end{axis}
                        end{tikzpicture} hfill
                        begin{tikzpicture}
                        begin{axis}[title={$y=x^3$}]
                        addplot [domain=-4:4] {x^3};
                        end{axis}
                        end{tikzpicture}
                        caption{Twelve diagrams}
                        label{fig:twelve}
                        end{figure}
                        end{document}


                        enter image description here



                        (red lines indicate page layout)






                        share|improve this answer



























                          up vote
                          0
                          down vote













                          little late ... but it may help someone :-)



                          i would draw your diagrams with the pgfplots package. using it is simple to define size of diagrams in dependency from textwidth and preserve drawn functions' domains independent from diagram size. it also enable adding diagrams titles with option title:



                          documentclass{article}
                          usepackage[margin=30mm]{geometry} % define page layout

                          usepackage{pgfplots}
                          pgfplotsset{compat=1.16}

                          %---------------- show page layout. don't use in a real document!
                          usepackage{showframe}
                          renewcommandShowFrameLinethickness{0.15pt}
                          renewcommand*ShowFrameColor{color{red}}
                          %---------------------------------------------------------------%

                          begin{document}
                          begin{figure}[htbp]
                          pgfplotsset{width=0.3linewidth, % digrams' size
                          scale only axis,
                          axis lines = middle,
                          grid,
                          grid style = {very thin, densely dashed},
                          xmin=-4.8, xmax=4.8, xtick={-4,-3,...,4}, xticklabels={},
                          ymin=-4.8, ymax=4.8, ytick={-4,-3,...,4}, yticklabels={},
                          xlabel=$x$, ylabel=$y$,
                          xlabel style = {anchor=west, font=footnotesize},
                          ylabel style = {anchor=south, font=footnotesize},
                          title style = {yshift=1mm},
                          %
                          every axis plot post/.append style={very thick, color=blue!50, smooth},
                          }
                          begin{tikzpicture}
                          begin{axis}[title={$y=x$}]
                          addplot [domain=-4:4] {x};
                          end{axis}
                          end{tikzpicture} hfill
                          begin{tikzpicture}
                          begin{axis}[title={$y=x^2$}]
                          addplot [domain=-4:4] {x^2};
                          end{axis}
                          end{tikzpicture} hfill
                          begin{tikzpicture}
                          begin{axis}[title={$y=x^3$}]
                          addplot [domain=-4:4] {x^3};
                          end{axis}
                          end{tikzpicture}

                          medskip
                          begin{tikzpicture}
                          begin{axis}[title={$y=x$}]
                          addplot [domain=-4:4] {x};
                          end{axis}
                          end{tikzpicture} hfill
                          begin{tikzpicture}
                          begin{axis}[title={$y=x^2$}]
                          addplot [domain=-4:4] {x^2};
                          end{axis}
                          end{tikzpicture} hfill
                          begin{tikzpicture}
                          begin{axis}[title={$y=x^3$}]
                          addplot [domain=-4:4] {x^3};
                          end{axis}
                          end{tikzpicture}

                          medskip
                          begin{tikzpicture}
                          begin{axis}[title={$y=x$}]
                          addplot [domain=-4:4] {x};
                          end{axis}
                          end{tikzpicture} hfill
                          begin{tikzpicture}
                          begin{axis}[title={$y=x^2$}]
                          addplot [domain=-4:4] {x^2};
                          end{axis}
                          end{tikzpicture} hfill
                          begin{tikzpicture}
                          begin{axis}[title={$y=x^3$}]
                          addplot [domain=-4:4] {x^3};
                          end{axis}
                          end{tikzpicture}

                          medskip
                          begin{tikzpicture}
                          begin{axis}[title={$y=x$}]
                          addplot [domain=-4:4] {x};
                          end{axis}
                          end{tikzpicture} hfill
                          begin{tikzpicture}
                          begin{axis}[title={$y=x^2$}]
                          addplot [domain=-4:4] {x^2};
                          end{axis}
                          end{tikzpicture} hfill
                          begin{tikzpicture}
                          begin{axis}[title={$y=x^3$}]
                          addplot [domain=-4:4] {x^3};
                          end{axis}
                          end{tikzpicture}
                          caption{Twelve diagrams}
                          label{fig:twelve}
                          end{figure}
                          end{document}


                          enter image description here



                          (red lines indicate page layout)






                          share|improve this answer

























                            up vote
                            0
                            down vote










                            up vote
                            0
                            down vote









                            little late ... but it may help someone :-)



                            i would draw your diagrams with the pgfplots package. using it is simple to define size of diagrams in dependency from textwidth and preserve drawn functions' domains independent from diagram size. it also enable adding diagrams titles with option title:



                            documentclass{article}
                            usepackage[margin=30mm]{geometry} % define page layout

                            usepackage{pgfplots}
                            pgfplotsset{compat=1.16}

                            %---------------- show page layout. don't use in a real document!
                            usepackage{showframe}
                            renewcommandShowFrameLinethickness{0.15pt}
                            renewcommand*ShowFrameColor{color{red}}
                            %---------------------------------------------------------------%

                            begin{document}
                            begin{figure}[htbp]
                            pgfplotsset{width=0.3linewidth, % digrams' size
                            scale only axis,
                            axis lines = middle,
                            grid,
                            grid style = {very thin, densely dashed},
                            xmin=-4.8, xmax=4.8, xtick={-4,-3,...,4}, xticklabels={},
                            ymin=-4.8, ymax=4.8, ytick={-4,-3,...,4}, yticklabels={},
                            xlabel=$x$, ylabel=$y$,
                            xlabel style = {anchor=west, font=footnotesize},
                            ylabel style = {anchor=south, font=footnotesize},
                            title style = {yshift=1mm},
                            %
                            every axis plot post/.append style={very thick, color=blue!50, smooth},
                            }
                            begin{tikzpicture}
                            begin{axis}[title={$y=x$}]
                            addplot [domain=-4:4] {x};
                            end{axis}
                            end{tikzpicture} hfill
                            begin{tikzpicture}
                            begin{axis}[title={$y=x^2$}]
                            addplot [domain=-4:4] {x^2};
                            end{axis}
                            end{tikzpicture} hfill
                            begin{tikzpicture}
                            begin{axis}[title={$y=x^3$}]
                            addplot [domain=-4:4] {x^3};
                            end{axis}
                            end{tikzpicture}

                            medskip
                            begin{tikzpicture}
                            begin{axis}[title={$y=x$}]
                            addplot [domain=-4:4] {x};
                            end{axis}
                            end{tikzpicture} hfill
                            begin{tikzpicture}
                            begin{axis}[title={$y=x^2$}]
                            addplot [domain=-4:4] {x^2};
                            end{axis}
                            end{tikzpicture} hfill
                            begin{tikzpicture}
                            begin{axis}[title={$y=x^3$}]
                            addplot [domain=-4:4] {x^3};
                            end{axis}
                            end{tikzpicture}

                            medskip
                            begin{tikzpicture}
                            begin{axis}[title={$y=x$}]
                            addplot [domain=-4:4] {x};
                            end{axis}
                            end{tikzpicture} hfill
                            begin{tikzpicture}
                            begin{axis}[title={$y=x^2$}]
                            addplot [domain=-4:4] {x^2};
                            end{axis}
                            end{tikzpicture} hfill
                            begin{tikzpicture}
                            begin{axis}[title={$y=x^3$}]
                            addplot [domain=-4:4] {x^3};
                            end{axis}
                            end{tikzpicture}

                            medskip
                            begin{tikzpicture}
                            begin{axis}[title={$y=x$}]
                            addplot [domain=-4:4] {x};
                            end{axis}
                            end{tikzpicture} hfill
                            begin{tikzpicture}
                            begin{axis}[title={$y=x^2$}]
                            addplot [domain=-4:4] {x^2};
                            end{axis}
                            end{tikzpicture} hfill
                            begin{tikzpicture}
                            begin{axis}[title={$y=x^3$}]
                            addplot [domain=-4:4] {x^3};
                            end{axis}
                            end{tikzpicture}
                            caption{Twelve diagrams}
                            label{fig:twelve}
                            end{figure}
                            end{document}


                            enter image description here



                            (red lines indicate page layout)






                            share|improve this answer














                            little late ... but it may help someone :-)



                            i would draw your diagrams with the pgfplots package. using it is simple to define size of diagrams in dependency from textwidth and preserve drawn functions' domains independent from diagram size. it also enable adding diagrams titles with option title:



                            documentclass{article}
                            usepackage[margin=30mm]{geometry} % define page layout

                            usepackage{pgfplots}
                            pgfplotsset{compat=1.16}

                            %---------------- show page layout. don't use in a real document!
                            usepackage{showframe}
                            renewcommandShowFrameLinethickness{0.15pt}
                            renewcommand*ShowFrameColor{color{red}}
                            %---------------------------------------------------------------%

                            begin{document}
                            begin{figure}[htbp]
                            pgfplotsset{width=0.3linewidth, % digrams' size
                            scale only axis,
                            axis lines = middle,
                            grid,
                            grid style = {very thin, densely dashed},
                            xmin=-4.8, xmax=4.8, xtick={-4,-3,...,4}, xticklabels={},
                            ymin=-4.8, ymax=4.8, ytick={-4,-3,...,4}, yticklabels={},
                            xlabel=$x$, ylabel=$y$,
                            xlabel style = {anchor=west, font=footnotesize},
                            ylabel style = {anchor=south, font=footnotesize},
                            title style = {yshift=1mm},
                            %
                            every axis plot post/.append style={very thick, color=blue!50, smooth},
                            }
                            begin{tikzpicture}
                            begin{axis}[title={$y=x$}]
                            addplot [domain=-4:4] {x};
                            end{axis}
                            end{tikzpicture} hfill
                            begin{tikzpicture}
                            begin{axis}[title={$y=x^2$}]
                            addplot [domain=-4:4] {x^2};
                            end{axis}
                            end{tikzpicture} hfill
                            begin{tikzpicture}
                            begin{axis}[title={$y=x^3$}]
                            addplot [domain=-4:4] {x^3};
                            end{axis}
                            end{tikzpicture}

                            medskip
                            begin{tikzpicture}
                            begin{axis}[title={$y=x$}]
                            addplot [domain=-4:4] {x};
                            end{axis}
                            end{tikzpicture} hfill
                            begin{tikzpicture}
                            begin{axis}[title={$y=x^2$}]
                            addplot [domain=-4:4] {x^2};
                            end{axis}
                            end{tikzpicture} hfill
                            begin{tikzpicture}
                            begin{axis}[title={$y=x^3$}]
                            addplot [domain=-4:4] {x^3};
                            end{axis}
                            end{tikzpicture}

                            medskip
                            begin{tikzpicture}
                            begin{axis}[title={$y=x$}]
                            addplot [domain=-4:4] {x};
                            end{axis}
                            end{tikzpicture} hfill
                            begin{tikzpicture}
                            begin{axis}[title={$y=x^2$}]
                            addplot [domain=-4:4] {x^2};
                            end{axis}
                            end{tikzpicture} hfill
                            begin{tikzpicture}
                            begin{axis}[title={$y=x^3$}]
                            addplot [domain=-4:4] {x^3};
                            end{axis}
                            end{tikzpicture}

                            medskip
                            begin{tikzpicture}
                            begin{axis}[title={$y=x$}]
                            addplot [domain=-4:4] {x};
                            end{axis}
                            end{tikzpicture} hfill
                            begin{tikzpicture}
                            begin{axis}[title={$y=x^2$}]
                            addplot [domain=-4:4] {x^2};
                            end{axis}
                            end{tikzpicture} hfill
                            begin{tikzpicture}
                            begin{axis}[title={$y=x^3$}]
                            addplot [domain=-4:4] {x^3};
                            end{axis}
                            end{tikzpicture}
                            caption{Twelve diagrams}
                            label{fig:twelve}
                            end{figure}
                            end{document}


                            enter image description here



                            (red lines indicate page layout)







                            share|improve this answer














                            share|improve this answer



                            share|improve this answer








                            edited Dec 6 at 19:08

























                            answered Dec 6 at 18:48









                            Zarko

                            119k865155




                            119k865155






























                                draft saved

                                draft discarded




















































                                Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


                                • Please be sure to answer the question. Provide details and share your research!

                                But avoid



                                • Asking for help, clarification, or responding to other answers.

                                • Making statements based on opinion; back them up with references or personal experience.


                                To learn more, see our tips on writing great answers.





                                Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                                Please pay close attention to the following guidance:


                                • Please be sure to answer the question. Provide details and share your research!

                                But avoid



                                • Asking for help, clarification, or responding to other answers.

                                • Making statements based on opinion; back them up with references or personal experience.


                                To learn more, see our tips on writing great answers.




                                draft saved


                                draft discarded














                                StackExchange.ready(
                                function () {
                                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f445140%2fminipage-subfigure-issue-creating-a-set-of-4x3-graphs-12-total%23new-answer', 'question_page');
                                }
                                );

                                Post as a guest















                                Required, but never shown





















































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown

































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown







                                Popular posts from this blog

                                How to change which sound is reproduced for terminal bell?

                                Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

                                Can I use Tabulator js library in my java Spring + Thymeleaf project?