tikzグラフの凡例の位置を移動する方法がよく分かりません

tikzグラフの凡例の位置を移動する方法がよく分かりません

右上から左上へ移動したいのですが、何をやってもうまくいきません。

\begin{figure}[H]
\caption{Stress-Strain Curve, Mix C}
\begin{tikzpicture}
\begin{axis}[xlabel=Strain ,ylabel=Stress (psi), width=12cm, height=8cm]
\addplot+[smooth,color=blue,mark=o]coordinates{
(0.000001,  11)
(0.000045,  38)
(0.000123,  85)
(0.000231,  150)
(0.000371,  230)
(0.000535,  321)
(0.000709,  419)
(0.000897,  524)
(0.001094,  632)
(0.001294,  745)
(0.001502,  862)
(0.001713,  981)
(0.001929,  1103)
(0.002146,  1226)
(0.002365,  1351)
(0.002585,  1478)
(0.002806,  1605)
(0.00303,   1733)
(0.003256,  1861)
(0.003408,  1945)

};
\addlegendentry{Specimen C19E-1}

答え1

凡例の位置は、

every axis legend/.append style={}.

だから

    every axis legend/.append style={at={(0.0,1.03)}, anchor=south west}

得られるもの:

ここに画像の説明を入力してください

あるいは、

every axis legend/.append style={at={(0.03,0.97)}, anchor=north west}

得られるもの:

ここに画像の説明を入力してください

コード:

\documentclass[tikz, border=2pt]{standalone}
\usepackage{pgfplots}

%% if you want to change this globally
%\pgfplotsset{every axis legend/.append style={
%        at={(0.0,1.03)},
%        anchor=south west}}

\begin{document}

\begin{tikzpicture}
\begin{axis}[xlabel=Strain ,ylabel=Stress (psi), width=12cm, height=8cm,
    every axis legend/.append style={
        at={(0.,1.03)},
        anchor=south west}
]
\addplot+[smooth,color=blue,mark=o]coordinates{
(0.000001,  11)
(0.000045,  38)
(0.000123,  85)
(0.000231,  150)
(0.000371,  230)
(0.000535,  321)
(0.000709,  419)
(0.000897,  524)
(0.001094,  632)
(0.001294,  745)
(0.001502,  862)
(0.001713,  981)
(0.001929,  1103)
(0.002146,  1226)
(0.002365,  1351)
(0.002585,  1478)
(0.002806,  1605)
(0.00303,   1733)
(0.003256,  1861)
(0.003408,  1945)

};
\addlegendentry{Specimen C19E-1}
\end{axis}
\end{tikzpicture}
\end{document}

関連情報