PGFPlots-散点图中没有标记

PGFPlots-散点图中没有标记

我在文档中使用了以下代码:

\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}

一切都很完美,但现在我想知道如何擦除圆圈并保留标签?

答案1

只需将所有与标记相关的内容替换为no marks

注意:实际上,pgfplots没有名为 的选项no marks,但它no markers确实存在。该选项no marks继承自 TikZ。对我来说,这是违反直觉的,因为only marks应该是no marks而不是 的自然对立面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}

在此处输入图片描述

相关内容