是否可以以某种方式使用外部图片作为显式标签pgfplot
?或者我可以在标签定义中使用绘制环境吗?
我尝试了两种方法:
\begin{tikzpicture}
\begin{axis}[
xlabel={Motifs},
ylabel={Value},
xtick={1,2},
xticklabels={%
\draw (0,0) node {} -- (2,4) node {} -- (4,0) node {};, %
\begin{tikzpicture}[thick,xscale=0.2,yscale=0.2]%
\draw (0,0) node {} -- (2,4) node {} -- (4,0) node {} -- (0,0);
\end{tikzpicture}
}
]
\addplot+
table[x=motif,y=original]
{
motif target original reached
2 0.0 0.36755204594400576 0.0
1 1.0 0.6324479540559943 1.0
};
\end{axis}
\end{tikzpicture}
结果应该是这样的
提前感谢任何提示或建议!
答案1
你尝试过这个吗?
\documentclass{standalone}
\usepackage{pgfplots}
\usepgfplotslibrary{fillbetween}
\usetikzlibrary{patterns}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
xlabel={Motifs},
ylabel={Value},
xtick={1,2},
xticklabels={\includegraphics[scale=0.05]{example-image-a},\includegraphics[scale=0.05]{example-image-b}
}
]
\addplot+
table[x=motif,y=original]
{
motif target original reached
2 0.0 0.36755204594400576 0.0
1 1.0 0.6324479540559943 1.0
};
\end{axis}
\end{tikzpicture}
\end{document}