Menu

#61 [pos] add key that allows to snap to nearest (given) coordinate also when there is a line present

unassigned
open
pos (1)
9
2017-06-05
2017-02-04
No

I am requesting two features here:

  1. add a key that imitates the "snap to nearest" feature for pos also for \addplots showing lines
  2. add a key that allows stating the "\coordindex" to place a node on that position.

Here is a third one from the PGFPlotsToDo list (which I moved here. I guess, also this request was from me ;)).

  1. Implement something like pos={x=40}.

And here another point from PGFPlotsToDo which is related (and I moved here).

modify the node[at=<pos>] feature such that
node[at value=42.4] or at max value or at min value or
node[at coordindex=3]


\documentclass[border=5pt]{standalone}
\usepackage{pgfplots}
\begin{document}
    \begin{tikzpicture}
        \begin{axis}[
            domain=0:360,
        ]
            \addplot {sin(x)}
                    [yshift=8pt]
                % provide a key that allows to have the same positions as
                % given for the next `\addplot';
                % e.g. that imitates the "snap to nearest" feature for plots
                % with `only marks' active.
                %
                % In addition it would be nice to state just the coordinate
                % index to put a node to that one
                % (e.g. it could be named `pos index' or something like that)
                node [pos=0.0] {$a$}
                node [pos=0.2] {$b$}
                node [pos=0.4] {$c$}
                node [pos=0.6] {$d$}
                node [pos=0.8] {$e$}
            ;
            \addplot+ [only marks] {sin(x)}
                    [yshift=8pt]
                node [pos=0.0] {$a$}
                node [pos=0.2] {$b$}
                node [pos=0.4] {$c$}
                node [pos=0.6] {$d$}
                node [pos=0.8] {$e$}
            ;
        \end{axis}
    \end{tikzpicture}
\end{document}

And this should be fixed as well when implementing this feature (moved here from PGFPlotsToDo):

Das pos= feature funktioniert nur ungenau für smooth. Implementiere es genauer.

Discussion

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.