Featured Book

LaTeX Beginners Guide

Who is online

In total there are 18 users online :: 1 registered, 0 hidden and 17 guests (based on users active over the past 5 minutes)
Most users ever online was 1327 on Tue Nov 05, 2013 7:11 pm

Users browsing this forum: Bing [Bot] and 17 guests

Partner Sites

TeXwelt - Fragen und Antworten goLaTeX
TeXblog
TeXnicCenter
TeXample

Thousand Separator for Value Nodes in Plots Topic is solved

labelspgfplotsTikZAdd tags Information and discussion about graphics, figures & tables in LaTeX documents.

Thousand Separator for Value Nodes in Plots

Postby 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

Re: Thousand Separator for Value Nodes in Plots  Topic is solved

Postby 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
tmp.png (4.91 KiB) Viewed 1404 times
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 13.1 (Linux 3.11.10), TeX Live 2013 (vanilla), TeXworks 0.5 (r1351)
² Posting stopped indefinitely due to offenses
User avatar
localghost
Site Moderator
 
Posts: 9219
Joined: Fri Feb 2nd, 2007
Location: Braunschweig, Germany

Re: Thousand Separator for Value Nodes in Plots

Postby Didou139 on Mon Feb 11th, 2013

That's very nice,
Many thanks !
Didou139
Didou139
 
Posts: 2
Joined: Thu Feb 7th, 2013


Topic Tags

labelspgfplotsTikZ

Return to Graphics, Figures & Tables

Who is online

Users browsing this forum: Bing [Bot] and 17 guests