How can i change the legend position in a multi-columns paper? Is there anything wrong with my code? I would like to put the legend in the top center of those two figures.
Thanks.
\begin{figure}[t]
\ref{testLegend}
\subfigure[Figure 1]{
\begin{tikzpicture}
\begin{axis}[xlabel={x}, ylabel={y}, width=4cm, ylabel near ticks, xlabel near ticks, y label style={font=\small}, x label style={font=\small}, ymajorgrids, cycle list name=exotic]
\addplot coordinates {(0,0) (1,1)};
\addplot coordinates {(0,0) (1,2)};
\end{axis}
\end{tikzpicture}
\label{fig:a}
}
\vspace{-1em}
\subfigure[Figure 2]{
\begin{tikzpicture}
\begin{axis}
[xlabel={x}, ylabel={y}, width=4cm, ylabel near ticks, xlabel near ticks, y label style={font=\small}, x label style={font=\small}, legend entries={line1, line2}, legend columns=2, legend to name=testLegend, legend style={font=\scriptsize}, legend pos=north east, legend style={font=\small}, ymajorgrids, cycle list name=exotic]
\addplot coordinates {(0,0) (1,1)};
\addplot coordinates {(0,0) (1,2)};
\end{axis}
\end{tikzpicture}
\label{fig:b}
}
\caption{Caption test, \label{fig:c}}
\vspace{-1.5em}
\end{figure}
However, i want this result,



\centerthe command form is\centering– David Carlisle Jan 22 '21 at 17:39\subfigureI guess, you currently use thesubfigurepackage. Please be aware that this package si considered obsolete. Instead, you can either use thesubfigor thesubcaptionpackage. – leandriis Jan 22 '21 at 18:53