lundi 1 décembre 2014

Coordinates of corner of histogram bar


How can one get the coordinates of the top right corner of a bar in a histogram? So far, I have just tried to make the lines fit...



\begin{document}
\usepackage{tikz}
\begin{tikzpicture}
\begin{axis}[ybar, bar width=20pt,ytick=\empty,xtick=data,symbolic x coords={$c_{i1}$,$c_{i2}$,$c_{i3}$}, axis x line=bottom, axis y line=left,ymin=0, x=1.5cm, enlarge x limits=0.4]
\addplot[fill=white] coordinates{
($c_{i1}$,5)
($c_{i2}$,7)
($c_{i3}$,15)
};
\end{axis}

\draw[dashed,thick] (1.6,1.9) -- (5.1,1.9);
\draw[dashed,thick] (4.55,5.7) -- (5.1,5.7);

\end{tikzpicture}
\end{document}


example





Aucun commentaire:

Enregistrer un commentaire