I'm trying to draw a plot using pgfplots with symbolic x coordinates and y data, as explain in the pgfplots manual. My Tex installation is the latest MacTeX 2018. The plot is quite good, except for the x coordinates, where only the first one is drawn. If I change the order of the \addplot commands, only the first one has it x label on the x-axis.
I don't see where's the problem. Could it be a bug in pgfplots ?
Thanks for help,
Cyril
Code: Select all
\usepackage[usenames,svgnames]{xcolor}
\usepackage{pgf,tikz}
\usepackage{pgfplots,pgfplotstable}
%%%%%%%%%
\begin{document}
%%
\begin{figure}[!htbp]
\begin{center}
\centering
\begin{tikzpicture}[scale=1]
\centering
\begin{axis}[width=0.8\textwidth,symbolic x coords={Fr,Hr,Fb,Hb}, xtick=data, yticklabel style={/pgf/number format/.cd,fixed,precision=5}, ylabel={\ce{^{87}Sr/^{86}Sr}},ylabel near ticks]
% Femmes, époque romaine
\addplot[red,only marks] coordinates {
(Fr,0.70831)
(Fr,0.708065)
(Fr,0.70814)
(Fr,0.708238)
(Fr,0.708198)
(Fr,0.708189)
};
% Hommes, époque romaine
\addplot[blue,only marks,mark=square*] coordinates {
(Hr,0.708289)
(Hr,0.708189)
};
% Hommes, époque byzantine
\addplot[SteelBlue,only marks,mark=square*] coordinates {(Hb,0.707382) (Hb,0.707977) (Hb,0.708635) (Hb,0.709092) (Hb,0.708234) (Hb,0.711956) (Hb,0.707212) (Hb,0.707306) (Hb,0.707501) (Hb,0.707566) (Hb, 0.708286) (Hb, 0.708396) (Hb,0.708467) (Hb,0.708853) (Hb,0.710657) (Hb, 0.714964)} ;
% Femmes,époque byzantine
\addplot[DarkRed,only marks] coordinates {(Fb, 0.707421) (Fb, 0.707988) (Fb,0.708305) (Fb,0.707244) (Fb,0.707246) (Fb,0.70732) (Fb,0.708023) (Fb,0.708176) (Fb,0.708206) (Fb,0.708439) (Fb,0.709156) (Fb,0.709572)} ;
\end{axis}
\end{tikzpicture}
\caption{Valeurs isotopiques du strontium obtenues sur les dents de squelettes exhumés dans les tombes de Hiérapolis, par époque et par sexe.}
\label{Hierapolis-Sr-2b}
\end{center}
\end{figure}
%%%%%%%%%
\end{document}