# Style key syntax problem

I tried both

    \documentclass{standalone}
\usepackage{tikz,pgfplots}

\tikzset{axeseul/.style={%
/pgfplots/axis x line align=center, % rien en y
/pgfplots/axis y line align=none,   % sans axe y
%ymin=0,ymax=1
red}}

\begin{document}
\begin{tikzpicture}
\begin{axis}[style=axeseul,ymin=0,ymax=1]
\end{axis}
\end{tikzpicture}
\end{document}


or

    \documentclass{standalone}
\usepackage{tikz,pgfplots}

\tikzstyle{axeseul}=[%
/pgfplots/axis x line align=center, % rien en y
/pgfplots/axis y line align=none,   % sans axe y
%ymin=0,ymax=1
red]

\begin{document}
\begin{tikzpicture}
\begin{axis}[style=axeseul,ymin=0,ymax=1]
\end{axis}
\end{tikzpicture}
\end{document}


Both give me red axis but no center and no none ... Where is the mystake ?

-

As percusse mentions in his comment, the problem with your settings is that tikzset sets the key /tikz/pgfplots/... so nothing is read and executed. You should use \pgfplotsset:

\documentclass{standalone}
\usepackage{pgfplots}

\pgfplotsset{axeseul/.style={%
axis x line =center,
axis y line =none,
red}}

\begin{document}
\begin{tikzpicture}
\begin{axis}[axeseul,ymin=0,ymax=1]
\end{axis}
\end{tikzpicture}

\end{document}


-
Thank's it works fine, but I want ymin=0 and ymax=1 at once in the axeseul style. Is it possible ? I tried to add them, but it does nothing. –  Tarass Feb 7 at 17:49
@Tarass you can add those options: \pgfplotsset{axeseul/.style={% axis x line =center, axis y line =none, ymin=0,ymax=1, red}} and remove them from the axis environment if the styles has already been applied. –  Gonzalo Medina Feb 7 at 17:52
Ok, I forgot to add : compat=newest, it work now. Thank you. –  Tarass Feb 7 at 19:02