Hi Florian,

this is intended behavior. To prove that remove `mark=none' and add `only 
marks' to the `axis' options. An explanation can be found in the PGFPlots 
manual for the `/tikz/pos={<fraction>}' in section 4.17.2 on page 356.

And if you are thinking "snap-to-nearest" should also work for `\addplot's 
*with* lines, there already exists such a feature request ;)
        <https://sourceforge.net/p/pgfplots/feature-requests/61/>


Best regards,
Stefan


> -----Original Message-----
> From: Florian Lindner [mailto:mailingli...@xgm.de]
> Sent: Wednesday, October 31, 2018 3:25 PM
> To: pgfplots-features@lists.sourceforge.net
> Subject: [Pgfplots-features] Bug in pos argument to node?
>
> Hey,
>
> I just recently discovered you can use addplot followed by a node[pos=0.3]
> for labeling plots. I have a tex file:
>
> \documentclass{scrartcl}
>
> \usepackage{tikz}
> \usepackage{pgfplots}
> \pgfplotsset{compat=1.16, table/col sep=comma}
>
> \begin{document}
>
> \begin{tikzpicture}[
>   label/.style={font=\small}]]
>   \begin{axis}[
>     grid=major, xmode=log, ymode=log,
>     x dir=reverse,
>     every axis plot post/.append style={x=h, mark=none}]
>
>     \addplot+ table[y=InfError]
> {h_convergence_NoneConsistent_MultiQuadrics_highfreq_14.csv} node[label,
> yshift=0.5cm, pos=0.3] {MQ 14};
>     \addplot+ table[y=InfError]
> {h_convergence_NoneConsistent_MultiQuadrics_highfreq_4.csv} node[label,
> yshift=-1cm, pos=0.3] {MQ 4};
>     \addplot+ table[y=InfError]
> {h_convergence_NoneConsistent_ThinPlateSplines_highfreq_0.csv} node[label,
> pos=0.3] {TPS};
>     \addplot+ table[y=InfError]
> {h_convergence_NoneConsistent_VolumeSplines_highfreq_0.csv} node[label,
> pos=0.3] {VS};
>
>   \end{axis}
> \end{tikzpicture}
>
> \end{document}
>
>
> The x column h is the same at all csv files, so I expect the nodes to be
> placed at the same x-position. But the attached PDF shows that the two MQ
> nodes are placed behind the VS/TPS nodes.
>
> It also happens without logarithmic axes.
>
> I have attached all data to reproduce the problem. Is that a bug in how
> pos is implemented or a misunderstanding on my side?
>
> Best Thanks,
> Florian

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________
Pgfplots-features mailing list
Pgfplots-features@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pgfplots-features

Reply via email to