![在 tikzpicture 的图例中添加箭头](https://linux22.com/image/431378/%E5%9C%A8%20tikzpicture%20%E7%9A%84%E5%9B%BE%E4%BE%8B%E4%B8%AD%E6%B7%BB%E5%8A%A0%E7%AE%AD%E5%A4%B4.png)
我正在尝试在下图的图例条目中添加一个箭头:
我使用以下代码获取:
\begin{figure}[hbt!]
\centering
\begin{tikzpicture}[scale=0.9]
\begin{axis}[xmin=1,xmax=10, xlabel=q,smooth, legend entries={$CSSD01 - SHGN$,$SHGN -
CSSD01$},legend pos=north west]
\addplot+[black] coordinates{(1,0) (2,0.01290066) (3,0.01558624) (4,0.02803845) (5,0.03660804)
(6,0.03881025) (7,0.04132278) (8,0.04367998) (9,0.04028380) (10,0.05604479)};
\addplot+[blue] coordinates{(1,0) (2,0) (3,0.0007861957) (4,0.0058689934) (5,0.0080498249)
(6,0.0092150462) (7,0.0271291580) (8,0.0057372855) (9,0.0068062622) (10,0)};
\end{axis}
\end{tikzpicture}
\end{figure}
我想用legend entries
从左到右的箭头代替破折号,例如:
legend entries={$CSSD01 \to SHGN$,$SHGN \to CSSD01$}
但在这种情况下我得到了一个错误。我该如何解决这个问题?
答案1
不知道具体发生了什么,但\rightarrow
有效,即
legend entries={$CSSD01\rightarrow SHGN$,$SHGN \rightarrow CSSD01$}