2

I'm using this code in a document:

\documentclass{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.11}
\begin{document}
\begin{tikzpicture} 
\begin{axis}[
    xlabel=$a$,
    ylabel=$b$,
]
\addplot[blue,mark=*,mark options={fill=blue},nodes near coords,only marks,
   point meta=explicit symbolic,
   visualization depends on={value \thisrow{anchor}\as\myanchor},
   every node near coord/.append style={anchor=\myanchor}
] table[meta=label] {
x y label anchor
100 152 {Long label 1} south
200 180 {Long label 2} east
110 150 {Long label 3} west
};
\end{axis}
\end{tikzpicture}
\end{document}

Everything is perfect, but now I want to know how I erase the circles and stay with the labels?

  • 3
    Replace mark=* with no marks? – Henri Menke Sep 8 '16 at 6:59
  • @HenriMenke, I think you mean mark=* should be replaced with no markers, right? (There is no key/style called no marks...). In addition to that you (Rafael) should also remove mark options={fill=blue} and especially only marks, because that is the opposite the style no markers. If the comments helped to answer your question please let us know by commenting here or by editing your question, so we can close it as solved. – Stefan Pinnow Sep 9 '16 at 19:56
  • @StefanPinnow There is a style in tikz called no marks, and that works here as well. (no marks is also used once in an example in the pgfplots manual actually, though that might be a mistake.) – Torbjørn T. Sep 9 '16 at 20:36
  • @HenriMenke, ok, didn't know that. Regarding the PGFPlots manual: Yep, I also found that and thought, that that is a mistake and have written a bug report for that. ;) – Stefan Pinnow Sep 9 '16 at 20:55
  • @StefanPinnow Henri didn't write that last comment, but when he sees this he can probably just write up an answer right away. – Torbjørn T. Sep 9 '16 at 22:13
2

Simply replace all the mark related stuff by no marks.

N.B.: Actually, pgfplots does not have an option called no marks but it is no markers there. The option no marks is inherited from TikZ. To me this is counter-intuitive because the natural opposite of only marks should be no marks and not no markers.

\documentclass{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.11}
\begin{document}
\begin{tikzpicture} 
  \begin{axis}[
    xlabel=$a$,
    ylabel=$b$,
    ]
    \addplot[blue,no marks,nodes near coords,only marks,
    point meta=explicit symbolic,
    visualization depends on={value \thisrow{anchor}\as\myanchor},
    every node near coord/.append style={anchor=\myanchor}
    ] table[meta=label] {
      x y label anchor
      100 152 {Long label 1} south
      200 180 {Long label 2} east
      110 150 {Long label 3} west
    };
  \end{axis}
\end{tikzpicture}
\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.