
MWE:
\documentclass[]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.12}
\usetikzlibrary{plotmarks}
\begin{document}
\begin{tikzpicture}
\begin{axis}
\addplot[mark=*] coordinates
{(0,0)};
\node[blue] at (0,0) {\pgfuseplotmark{*}};
\end{axis}
\end{tikzpicture}
\begin{tikzpicture}
\begin{axis}
\addplot[mark=pentagon*] coordinates
{(0,0)};
\node[red] at (0,0) {\pgfuseplotmark{pentagon*}};
\end{axis}
\end{tikzpicture}
\end{document}
最初の図では両方のマーカーが同じ位置にありますが、2 番目の図ではそうではありません。ノード内のマーカーの位置を、プロットされたものと同じにするには、何をすればよいでしょうか\addplot
。
アップデート: ログファイルのバージョン番号:
Package: pgfplots 2015/05/02 v1.12.1 Data Visualization (1.12.1)
Package: pgf 2013/12/18 v3.0.0 (rcs-revision 1.14)
File: pgflibraryplotmarks.code.tex 2013/07/20 v3.0.0 (rcs-revision 1.13)
その他の質問(これはほぼ重複しています):
答え1
これは、PGF のプロット マークが描画命令内での使用のために用意されているためです。テキスト モードで使用するために用意されているわけではありません。
テキストモードで描画指示を使用する場合は、次のように画像で囲む必要があります。
\documentclass[]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.12}
\usetikzlibrary{plotmarks}
\begin{document}
\begin{tikzpicture}
\begin{axis}
\addplot[mark=pentagon*] coordinates
{(0,0)};
\node[red] at (0,0) {\tikz \pgfextra{\pgfuseplotmark{pentagon*}};};
\end{axis}
\end{tikzpicture}
\end{document}