When I put bracket in a xlabel, the alignement of my figure change. It's just a little move, but it's uggly because i put two sub figures side by side.
Do you know how to solve this ?
Thanks in advance,
Thomas
PS : I think Here : TikZ graph not aligning is the same problem, but unresolved.
\documentclass[10pt]{article}
\usepackage{pgfplots}
\usepackage{subcaption}
\begin{document}
\begin{figure}
\centering
\begin{subfigure}[b]{0.45 \textwidth}
\caption{sub-figure 1}
\begin{tikzpicture}
\tikzstyle{every node}=[font=\small]
\begin{axis}[height=\textwidth,width=\textwidth,
axis lines=left, enlarge x limits=true, enlarge y limits=true,
xlabel={x},
scaled x ticks = false,
ylabel={y},
x tick label style={/pgf/number format/fixed, /pgf/number format/1000 sep = \thinspace},
]
\addplot[ybar,ybar interval=0] coordinates{
(0,8) (500,87) (1000,127) (1500,93) (2000,68) (2500,51) (3000,40) (3500,17) (4000,19) (4500,14) (5000,11) (5500,2) (6000,1) (6500,1) (7000,0)};
\end{axis}
\end{tikzpicture}
\end{subfigure}
~
\begin{subfigure}[b]{0.45 \textwidth}
\caption{sub-figure 2}
\begin{tikzpicture}
\tikzstyle{every node}=[font=\small]
\begin{axis}[height=\textwidth,width=\textwidth,
axis lines=left, enlarge x limits=true, enlarge y limits=true,
xlabel={x {(test)}},
scaled x ticks = false,
ylabel={x},
x tick label style={/pgf/number format/fixed, /pgf/number format/1000 sep = \thinspace},
]
\addplot[ybar,ybar interval=0] coordinates{
(0,8) (500,87) (1000,127) (1500,93) (2000,68) (2500,51) (3000,40) (3500,17) (4000,19) (4500,14) (5000,11) (5500,2) (6000,1) (6500,1) (7000,0)};
\end{axis}
\end{tikzpicture}
\end{subfigure}
\end{figure}
\vfill
\end{document}