I hope to align multiple figures plotted by tikzpictures.
As shown in the below codes, I draw eight figures, they are automatically shown in 4 rows and 2 columns, but I want them to be in 2 rows and 4 columns. Are there related methods to align them as we want, for example in 2 rows and 4 columns in this example?
Besides, I want to have them in one single PDF file and with no or narrow borders, so I use {standalone} for \documentclass.
Thank you very much
\documentclass[varwidth]{standalone}%border=3mm,
\usepackage{tikz}
\usepackage{subfigure}
\usepackage{pgfplotstable}
\pgfplotsset{compat=newest}
\usepgfplotslibrary{units}
\begin{document}
\pgfplotsset{width=5cm,height=5cm,grid style={dashed}}
\begin{filecontents}{plottedtata.txt}
x y1 y2 y3 y4 y5 y6 y7 y8
x m m m m m m m m
1 0.6951 0.6678 0.6753 0.9160 0.4609 0.4714 0.4735 0.1917
2 0.0680 0.8444 0.0067 0.0012 0.7702 0.0358 0.1527 0.7384
3 0.2548 0.3445 0.6022 0.4624 0.3225 0.1759 0.3411 0.2428
4 0.2240 0.7805 0.3868 0.4243 0.7847 0.7218 0.6074 0.9174
\end{filecontents}
\pgfplotstableread[
skip first n=6, % 2+4 for filecontents header
]{plottedtata.txt}{\plottedtata}
\begin{figure}
\begin{tikzpicture}
\begin{axis}
[color=black,grid=major,use units, y unit=m,xlabel=(1), ylabel=y,
every major tick/.append style={thick, major tick length=3pt, black},
every minor tick/.append style={thick, minor tick length=1.7pt, black},
xmin=1, xmax=4, xtick={1,2,3,4}, tick align=outside, minor x tick num=1,
ymin=0, ymax=1, minor y tick num=1]
\addplot[draw=red,line width=1,mark=*,mark options={fill=red}] table [x index=0,y index=1,]{\plottedtata};
\end{axis}
\end{tikzpicture}
\begin{tikzpicture}
\begin{axis}
[color=black,grid=major,use units, y unit=m,xlabel=(2), ylabel=y,
every major tick/.append style={thick, major tick length=3pt, black},
every minor tick/.append style={thick, minor tick length=1.7pt, black},
xmin=1, xmax=4, xtick={1,2,3,4}, tick align=outside, minor x tick num=1,
ymin=0, ymax=1, minor y tick num=1]
\addplot[draw=red,line width=1,mark=*,mark options={fill=red}] table [x index=0,y index=2,]{\plottedtata};
\end{axis}
\end{tikzpicture}
\begin{tikzpicture}
\begin{axis}
[color=black,grid=major,use units, y unit=m,xlabel=(3), ylabel=y,
every major tick/.append style={thick, major tick length=3pt, black},
every minor tick/.append style={thick, minor tick length=1.7pt, black},
xmin=1, xmax=4, xtick={1,2,3,4}, tick align=outside, minor x tick num=1,
ymin=0, ymax=1, minor y tick num=1]
\addplot[draw=red,line width=1,mark=*,mark options={fill=red}] table [x index=0,y index=3,]{\plottedtata};
\end{axis}
\end{tikzpicture}
\begin{tikzpicture}
\begin{axis}
[color=black,grid=major,use units, y unit=m,xlabel=(4), ylabel=y,
every major tick/.append style={thick, major tick length=3pt, black},
every minor tick/.append style={thick, minor tick length=1.7pt, black},
xmin=1, xmax=4, xtick={1,2,3,4}, tick align=outside, minor x tick num=1,
ymin=0, ymax=1, minor y tick num=1]
\addplot[draw=red,line width=1,mark=*,mark options={fill=red}] table [x index=0,y index=4,]{\plottedtata};
\end{axis}
\end{tikzpicture}
\begin{tikzpicture}
\begin{axis}
[color=black,grid=major,use units, y unit=m,xlabel=(5), ylabel=y,
every major tick/.append style={thick, major tick length=3pt, black},
every minor tick/.append style={thick, minor tick length=1.7pt, black},
xmin=1, xmax=4, xtick={1,2,3,4}, tick align=outside, minor x tick num=1,
ymin=0, ymax=1, minor y tick num=1]
\addplot[draw=red,line width=1,mark=*,mark options={fill=red}] table [x index=0,y index=5,]{\plottedtata};
\end{axis}
\end{tikzpicture}
\begin{tikzpicture}
\begin{axis}
[color=black,grid=major,use units, y unit=m,xlabel=(6), ylabel=y,
every major tick/.append style={thick, major tick length=3pt, black},
every minor tick/.append style={thick, minor tick length=1.7pt, black},
xmin=1, xmax=4, xtick={1,2,3,4}, tick align=outside, minor x tick num=1,
ymin=0, ymax=1, minor y tick num=1]
\addplot[draw=red,line width=1,mark=*,mark options={fill=red}] table [x index=0,y index=6,]{\plottedtata};
\end{axis}
\end{tikzpicture}
\begin{tikzpicture}
\begin{axis}
[color=black,grid=major,use units, y unit=m,xlabel=(7), ylabel=y,
every major tick/.append style={thick, major tick length=3pt, black},
every minor tick/.append style={thick, minor tick length=1.7pt, black},
xmin=1, xmax=4, xtick={1,2,3,4}, tick align=outside, minor x tick num=1,
ymin=0, ymax=1, minor y tick num=1]
\addplot[draw=red,line width=1,mark=*,mark options={fill=red}] table [x index=0,y index=7,]{\plottedtata};
\end{axis}
\end{tikzpicture}
\begin{tikzpicture}
\begin{axis}
[color=black,grid=major,use units, y unit=m,xlabel=(8), ylabel=y,
every major tick/.append style={thick, major tick length=3pt, black},
every minor tick/.append style={thick, minor tick length=1.7pt, black},
xmin=1, xmax=4, xtick={1,2,3,4}, tick align=outside, minor x tick num=1,
ymin=0, ymax=1, minor y tick num=1]
\addplot[draw=red,line width=1,mark=*,mark options={fill=red}] table [x index=0,y index=8,]{\plottedtata};
\end{axis}
\end{tikzpicture}
\end{figure}
\end{document}
align
tag toalignment
.align
is specific to a multi-line math environment.