Parece que no puedo entender cómo mover la ubicación de la leyenda de mi gráfico tikz

Parece que no puedo entender cómo mover la ubicación de la leyenda de mi gráfico tikz

Me gustaría moverlo desde arriba a la izquierda desde arriba a la derecha, pero nada de lo que intento funciona.

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

Respuesta1

La ubicación de la leyenda se puede ajustar mediante

every axis legend/.append style={}.

Entonces con

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

usted obtiene:

ingrese la descripción de la imagen aquí

Alternativamente, con

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

usted obtiene:

ingrese la descripción de la imagen aquí

Código:

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

información relacionada