labels • pgfplots • TikZ •
Add tags
Information and discussion about graphics, figures & tables in LaTeX documents.
by Didou139 on Thu Feb 7th, 2013
Hi all, with the pgfplots package, I have a problem with thousands separator of the node. I would like to have no thousands separator. For the x tick labels, I found the solution ( xticklabel style={/pgf/number format/1000 sep=}) but not for the node value (see code below). - Code: Select all • Open in writeLaTeX
\begin{tikzpicture}[scale=1.4] \begin{axis}[,xbar, bar width=36pt, enlarge y limits, xmajorgrids,xlabel={Value X}, xticklabel style={/pgf/number format/1000 sep=}, nodes near coords, nodes near coords align={anchor=west}, xmin =0, ymin=0.5, ymax=3.5, ytick= {1,2,3} , yticklabels={value1,value2 ,Value3}] \addplot coordinates {(1471.2,1) (200.6,2) (157.3,3)}; \end{axis} \end{tikzpicture}
Many thanks in advance Didou139
Last edited by Stefan_K on Thu Feb 7th, 2013, edited 1 time in total.
-
Didou139
-
- Posts: 2
- Joined: Thu Feb 7th, 2013
by localghost on Thu Feb 7th, 2013
There is a style called every node near coord that determines the appearance of those nodes. Give it the same parameters and you get what you are after (see below code). - Code: Select all • Open in writeLaTeX
\documentclass[11pt]{article} \usepackage[T1]{fontenc} \usepackage{pgfplots}
\begin{document} \begin{tikzpicture} \begin{axis}[ xmin=0, xmax=2000, xbar, xmajorgrids, xlabel={Value X}, xticklabel style={/pgf/number format/1000 sep=}, ymin=0.5, ymax=3.5, ytick= {1,2,3}, yticklabels={Value1,Value2,Value3}, bar width=36pt, enlarge y limits, nodes near coords, nodes near coords align={anchor=west}, every node near coord/.style={/pgf/number format/1000 sep=} ] \addplot coordinates {(1471.2,1) (200.6,2) (157.3,3)}; \end{axis} \end{tikzpicture} \end{document}
For details please refer to the package manual. Best regards and welcome to the board Thorsten
- Attachments
-

- tmp.png (4.91 KiB) Viewed 233 times
-

localghost
- Site Moderator
-
- Posts: 8734
- Joined: Fri Feb 2nd, 2007
- Location: Braunschweig, Germany
by Didou139 on Mon Feb 11th, 2013
That's very nice, Many thanks ! Didou139
-
Didou139
-
- Posts: 2
- Joined: Thu Feb 7th, 2013
Topic Tags
labels • pgfplots • TikZ
Return to Graphics, Figures & Tables
Users browsing this forum: Google [Bot] and 7 guests
|