I want to add PGF plotmarkers to the caption of a Tikz figure. I defined commands to plot these markers like
\def\showpgfcircle{\tikz[baseline=-0.9ex]\node[blue,mark size=0.7ex]{\pgfuseplotmark{o}};}
That works well within a text (although I have a spacing problem after the marker), but within a caption it won't compile. Do you have any suggestions?
My MWE is:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usepackage{tikz-3dplot}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\usepgfplotslibrary{smithchart}
\usetikzlibrary{
arrows,
positioning,
calc,
circuits.ee.IEC,
external,
plotmarks}
\usetikzlibrary{pgfplots.units}
\pgfplotsset{ every axis label/.append style={font=\scriptsize}, every tick label/.append style={font=\scriptsize,text depth=.25ex}}
%set labels in all diagrams in scriptsize
\pgfkeys{/pgf/number format/.cd, use comma, set thousands separator={ }}
% use comma for dezimal numbers; no use of thoudends seperator
\def\showpgfcircle{\tikz[baseline=-0.9ex]\node[blue,mark size=0.7ex]{\pgfuseplotmark{o}};}
\begin{document}
\begin{figure}[t] % Example plot with markers
\centering
\begin{tikzpicture}
\begin{smithchart}[scale=1]
\pgfsetplotmarksize{0.7ex}
\addplot[draw=blue,mark=o, only marks, is smithchart cs] coordinates {
(0.041457198, -0.56082138) (-0.46495696, -0.31631368) (-0.50641416, 0.2445077) (-0.041457198, 0.56082138) (0.46495696, 0.31631368) (0.50641416, -0.2445077) (-0.42592593, 0.73772534) (0.42592593, 0.73772534) (0.42592593, -0.73772534) (-0.42592593, -0.73772534)
};
\addplot[draw=red,mark=x, only marks, is smithchart cs] coordinates {
(0.041457198, -0.56082138) (-0.46495696, -0.31631368) (-0.50641416, 0.2445077) (-0.041457198, 0.56082138) (0.46495696, 0.31631368) (0.50641416, -0.2445077) (-0.42592593, 0.73772534) (0.42592593, 0.73772534) (0.42592593, -0.73772534) (-0.42592593, -0.73772534)
};
\end{smithchart}
\end{tikzpicture}
\caption{Example caption. I want to add the marker here.}
\end{figure}
Example text with PGFmarker like \showpgfcircle included. This works, but there is no space after the marker.
\end{document}

\label{blueplot}after the\addplotcommand, and get the marker with\ref{blueplot}. Albeit maybe in a smaller size. – sodd Feb 06 '18 at 11:14