Graphics, Figures & TablesInsert Text in Bars of Barplot

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
cvera
Posts: 1
Joined: Mon Feb 04, 2013 4:29 am

Insert Text in Bars of Barplot

Post by cvera »

Hi everyone,

Is there a way to insert text in the bars generated by pgfplots? I have the following code and want to insert some text in each bar:

Code: Select all

\begin{tikzpicture}
    \begin{axis}[ybar,yticklabels={,,}, xticklabels={,,},xtick=\empty, ytick=\empty, hide y axis]
        \addplot[fill=gray, bar width=31pt] plot coordinates
            {(0.5,0.3) (0.75,0.6) (1,1)};
    \end{axis}
\end{tikzpicture} 
Thanks!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

Post Reply