在 tikzpicture 的图例中添加箭头

在 tikzpicture 的图例中添加箭头

我正在尝试在下图的图例条目中添加一个箭头:

在此处输入图片描述

我使用以下代码获取:

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

相关内容