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

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Post Reply