Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I want to place a node on a plot using the pathway modifier: node[pos=0.5] {node text};. The pgfplots manual clearly describes how that is done, but my node doesn't appear. Could my scaling be a problem here (it is applied by the input filter style)?

\documentclass{article}
\usepackage[a2paper,landscape,margin=1cm]{geometry}

\usepackage{tikz,pgfplots}
\pgfplotsset{compat=1.5}

\pgfmathsetmacro{\smin}{4000}
\pgfmathsetmacro{\smax}{9200}
\pgfmathsetmacro{\hmin}{2000}
\pgfmathsetmacro{\hmax}{3900}

\pgfplotstableset{input filter/.style ={y expr=\thisrowno{1}/1e3}}

\begin{document}
\pagestyle{empty}
  \noindent\begin{tikzpicture}
    \begin{axis}[xmin=\smin,xmax=\smax,width=52cm,
                  ymin=\hmin,ymax=\hmax,height=38cm,
                  scale only axis,
                  major tick length={0pt},
                  minor tick length={0pt},
                  xticklabel={\pgfmathparse{\tick/1e3}\pgfmathresult},
                  yticklabel={\pgfmathparse{\tick}\pgfmathresult},
                  axis lines*=none
                  ]
      \addplot table[input filter] {
        5575.75757575757575779 2010304.18052640024086
        6311.11111111111111116 2284412.95212492412338
        7886.86868686868686851 2900069.5315761277061
        9200 3795110.22478821340428
      } node[pos=0.5] {asdf};
    \end{axis}
  \end{tikzpicture}\\
\end{document}

I've also tried to place the node using the decorations.markings library:

\usetikzlibrary{decorations.markings}
\addplot[postaction={decorate},
         decoration={markings,mark=at position 0.5 with \node {asdf};}
        ] table[input filter] {
  5575.75757575757575779 2010304.18052640024086
  6311.11111111111111116 2284412.95212492412338
  7886.86868686868686851 2900069.5315761277061
  9200 3795110.22478821340428
};

and the node didn't appear as well. Other position settings such as at position 1cm also didn't place a node on the plot.

share|improve this question

closed as too localized by Jake, Loop Space, Paulo Cereda, Torbjørn T., percusse Mar 1 '12 at 12:26

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

1  
It works for me. Are you using the right version of PGFplots (1.5.1)? –  Jake Mar 1 '12 at 9:17
1  
@Christoph, in mine it displays correctly node placement in the middle, try updating your installation. –  zeroth Mar 1 '12 at 9:17
    
@Jake: with \listfiles I get this log entry: Package: pgfplots 2011/07/29 v1.5 (git show 1.5-1-gcc2f2d2 ) –  Christoph Mar 1 '12 at 9:29
    
@Christoph: That's too old, the feature is brand new. I have pgfplots 2011/12/29 v1.5.1 (git show 1.5.1-4-g53e640f ) –  Jake Mar 1 '12 at 9:32
1  
@Jake: it took a while, but I've updated pgfplots and everything is fine, thank you! –  Christoph Mar 1 '12 at 10:16

Browse other questions tagged or ask your own question.