# pgfplots, using sprintf in clickable library

I am using pgfplots in combination with the clickable library. Here's an example

\documentclass{article}
\usepackage[latin1]{inputenc}

% important packages
\usepackage{pgfplots}
\usepgfplotslibrary{clickable}

\begin{document}
\begin{tikzpicture}
\begin{axis}
[% options
xlabel=$x$,
ylabel={$x$},
clickable coords = {exact coords: <br/> (xy)}, % activates a snap-to-nearest feature
annot/snap dist=10,
clickable coords size = {10,5}, % size in characters for the snapping pop ups
annot/popup size generic = {20,10}, % size in characters  for the rest
]
[% options
only marks, % do not connect data points
]
coordinates
{
(0,0)
(2,2)
(5,5)
};
\end{axis}
\end{tikzpicture}
\end{document}


The result can be seen here

https://dl.dropbox.com/u/1833443/clickable-Problem/my_LaTeX_File.pdf

If you click near the data points then you will get a message like this:

exact coords:
(x,y)


If you click anywhere else you just get:

(x,y)


Here's a screenshot of the first case:

In the pgfplots documentation in chapter 5.1.3 there is also mentioned that you can use the sprintf syntax to customize the formatting. Example:

/pgfplots/annot/point format={sprintf-format} (initially (%.1f,%.1f))


But I do not understand how I can use the

%


and

\n


within the normal LaTeX code.

Does anyone have an example how to use the line break symbol (\n) and the variable placeholder symbol (%) in the context of the clickable library?

-

The clickable lib has extra support for the control sequences or chars ", \#, |, \", \n, \r, \t, \\, \%.

It should work out-of-the-box if you place these special escapes into the argument.

And it used to work, at least together with pdflatex.

Note that the manual appears to be incorrect: the initial values of these keys are

annot/point format/.initial={(\%.1f, \%.1f)},
annot/point format 3d/.initial={(\%.1f, \%.1f, \%.1f)},

-
Thanks - I'll try it again. Very cool that the author himself answers me here. –  Manuel Kuehner Oct 18 '12 at 19:21