I try to set Up a document with multiple Plots for that i try to use TIKZ and Standalone. But the Problem is with the alignment of the different plots. I use scale only axis
to make the axis all the same size to avoid aligment problems because of Y-Axis labels and bigger Numbers. Then i use trim axis left, trim axis right
to avoid Problems with outstanding numbers. That would work when i directly include the tikzpicture to the document but when including them with standalone the Boundingbox seems to be calculatet differently, so centering the plots does not result in a proper alignment. Which is the best way to achieved proper alignment. Bad Font is a product of converting the pdf with inkscape to an png and drawing in the red lines.
main file
\documentclass[]{scrbook}
\usepackage[textwidth=455.24945pt]{geometry} % 455.24945pt=160.00000mm not cm because of accuracy
% Package for nice Graphs
\usepackage[pdftex]{graphicx, xcolor}
\usepackage[]{tikz}
\usepackage{pgfplots}
\usetikzlibrary{arrows, positioning, calc, matrix}
\pgfplotsset{compat=newest}
\usepackage{standalone}
\standaloneconfig{mode=tex}
% tex = use sourcefile, default
% image = use existing image file produced by the source file
% build = build image from source, then use it
% buildmissing= only build image if it does not exist
% buildnew = only build image if source file is newer
\begin{document}
\begin{figure}[!ht]
\centering
\begin{tikzpicture}
\begin{axis}[
trim axis left, trim axis right,
scale only axis, % the width specifies the width of the axis only not the labels etc.
width=0.75\textwidth,
height=0.1\textheight,
xlabel={Some Data},
ylabel={Some Value},
]
\addplot[very thick, red, mark=x] coordinates {(0,0)
(1,2)(2,3)
(3,4)(4,6)
(5,11)(6,20)
(7,15)(8,12)
(9,8)(10,7)
(11,3)(12,0)};
\end{axis}
\end{tikzpicture}
\caption{A plot in the Document}
\end{figure}
\begin{figure}[!ht]
\centering
\includestandalone{standalone_plot}
\caption{Almost same plot but as Standalone}
\end{figure}
\begin{figure}[!ht]
\centering
\includestandalone{standalone_plot_2}
\caption{Y-Values are getting bigger}
\end{figure}
\begin{figure}[!ht]
\centering
\includestandalone{standalone_plot_3}
\caption{Bigger Y-values and no Y Label}
\end{figure}
\end{document}
first standalone file
\documentclass[ class=scrbook,
convert=false,
border=60pt,
]{standalone}
% if axis option " only scale axis" is used border has to be set manually to avoid cropping of the Y-Axis Label. Including the standalone then has to be set to \standaloneconfig{mode=tex}
% Using border={0pt 0pt 0pt 0pt} seems not to work with scrbook
\usepackage[textwidth=455.24945pt]{geometry} % 455.24945pt=160.00000mm not cm because of accuracy
\usepackage{tikz}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
trim axis left, trim axis right,
scale only axis, % the width specifies the width of the axis only not the labels etc.
width=0.75\textwidth,
height=0.1\textheight,
scale only axis,
xmin=0,xmax=12,
xlabel=fractions,
ylabel=Small Axis,
]
\addplot[blue, mark=x] coordinates {(0,0)
(1,2)(2,3)
(3,4)(4,6)
(5,11)(6,20)
(7,15)(8,12)
(9,8)(10,7)
(11,3)(12,0)};
\end{axis}
\end{tikzpicture}
\end{document}
Second standalone file
\documentclass[ class=scrbook,
convert=false,
border=60pt,
]{standalone}
% if axis option " only scale axis" is used border has to be set manually to avoid cropping of the Y-Axis Label. Including the standalone then has to be set to \standaloneconfig{mode=tex}
% Using border={0pt 0pt 0pt 0pt} seems not to work with scrbook
\usepackage[textwidth=455.24945pt]{geometry} % 455.24945pt=160.00000mm not cm because of accuracy
\usepackage{tikz}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
trim axis left, trim axis right,
scale only axis, % the width specifies the width of the axis only not the labels etc.
width=0.75\textwidth,
height=0.1\textheight,
scale only axis,
xmin=0,xmax=12,
xlabel=fractions,
ylabel=Small Axis,
]
\addplot[blue, mark=x] coordinates {(0,0)
(1,2)(2,3)
(3,4)(4,6)
(5,11)(6,200)
(7,15)(8,12)
(9,8)(10,7)
(11,3)(12,0)};
\end{axis}
\end{tikzpicture}
\end{document}
Third standalone file
\documentclass[ class=scrbook,
convert=false,
border=60pt,
]{standalone}
% if axis option " only scale axis" is used border has to be set manually to avoid cropping of the Y-Axis Label. Including the standalone then has to be set to \standaloneconfig{mode=tex}
% Using border={0pt 0pt 0pt 0pt} seems not to work with scrbook
\usepackage[textwidth=455.24945pt]{geometry} % 455.24945pt=160.00000mm not cm because of accuracy
\usepackage{tikz}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
trim axis left, trim axis right,
scale only axis, % the width specifies the width of the axis only not the labels etc.
width=0.75\textwidth,
height=0.1\textheight,
scale only axis,
xmin=0,xmax=12,
xlabel=fractions,
%ylabel=Small Axis,
]
\addplot[blue, mark=x] coordinates {(0,0)
(1,2)(2,3)
(3,4)(4,6)
(5,11)(6,200)
(7,15)(8,12)
(9,8)(10,7)
(11,3)(12,0)};
\end{axis}
\end{tikzpicture}
\end{document}
includestandalone
statements in afbox{...}
? I guess your bounding boxes are different due to the different labels. Due to this, the position of the axes inside the bounding box is different, hence alignment will fail. I suggest putting all plots that belong to one figure in one tikz file, using pgfplots' capability to handle multiple plots