PGFPLOTS Cómo aumentar el ancho de la línea sin aumentar el ancho del borde del marcador

PGFPLOTS Cómo aumentar el ancho de la línea sin aumentar el ancho del borde del marcador
    \documentclass{article}
\usepackage{pgfplots}

\begin{document}

\begin{tikzpicture}
\begin{axis}[
            axis lines = left,
            enlarge x limits=0.1,
            enlarge y limits=0.1,
            ]
        \addplot [
            mark=*,
            color=blue,
            scatter,
            scatter/use mapped color={draw=black},
            error bars/.cd,
            y dir = both, 
            y explicit,
            error bar style={color=black},
            ] table [x index=0, y index=1, y error index=2]{
            0 2 0.1
            2 0 0.1
            };
        \addplot [line width=2pt,
            mark=*,
            color=red,
            scatter,
            scatter/use mapped color={draw=black},
            error bars/.cd,
            y dir = both, 
            y explicit,
            error bar style={color=black},
            ] table [x index=0, y index=1, y error index=2]{
            0 0 0.1
            2 2 0.1
            };
            
\end{axis}
\end{tikzpicture}



\end{document}

Resultado

¿Cómo puedo aumentar el ancho de la línea dejando intacto el ancho del borde del marcador?

Respuesta1

Tiene como finalidad mark optionscontrolar los parámetros de las marcas. Entonces, al marcar, mark options={line width=0.4pt}puede establecer el ancho de línea en su valor estándar.

\documentclass{article}
\usepackage{pgfplots}
\pgfplotsset{compat=1.17}
\begin{document}

\begin{tikzpicture}
\begin{axis}[
            axis lines = left,
            enlarge x limits=0.1,
            enlarge y limits=0.1,
            ]
        \addplot [
            mark=*,
            color=blue,
            scatter,
            scatter/use mapped color={draw=black},
            error bars/.cd,
            y dir = both, 
            y explicit,
            error bar style={color=black},
            ] table [x index=0, y index=1, y error index=2]{
            0 2 0.1
            2 0 0.1
            };
        \addplot [line width=2pt,mark options={line width=0.4pt},
            mark=*,
            color=red,
            scatter,
            scatter/use mapped color={draw=black},
            error bars/.cd,
            y dir = both, 
            y explicit,
            error bar style={color=black},
            ] table [x index=0, y index=1, y error index=2]{
            0 0 0.1
            2 2 0.1
            };
            
\end{axis}
\end{tikzpicture}
\end{document}

ingrese la descripción de la imagen aquí

información relacionada