
Usando el siguiente código:
\begin{tikzpicture}
\begin{axis}[
xmin=0, xmax=4, ymin=0, ymax=10,
width=9cm, height=6cm,
legend style={draw=none}]
\addplot[only marks,color=red] coordinates {
(0, 10) (0.5, 8.5) (1, 2) (2, 0.5) (3.5, 1.9)};
\addlegendentry{Experimental Data Point}
\end{axis}
\end{tikzpicture}
Me sale la imagen:
Para mi gusto, el símbolo de la leyenda se parece un poco al texto de la leyenda. ¿Hay alguna forma de aumentar el espacio entre los dos?
Respuesta1
Según el pgfplots
manual,
La leyenda es una matriz TikZ, por lo que se puede usar cualquier opción de TikZ que afecte a nodos y matrices [...]. La matriz es creada por algo como
\matrix[style=every axis legend] { draw plot specification 1 & \node{legend 1}\\ draw plot specification 2 & \node{legend 2}\\ ... };
Por lo tanto, puede aumentar la column sep
intensidad legend style
para lograr el efecto deseado.
Código
\documentclass[border=2pt]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.8}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
xmin=0, xmax=4, ymin=0, ymax=10,
width=9cm, height=6cm,
legend style={draw=none,column sep=10pt}]
\addplot[only marks,color=red] coordinates {
(0, 10) (0.5, 8.5) (1, 2) (2, 0.5) (3.5, 1.9)};
\addlegendentry{Experimental Data Point}
\end{axis}
\end{tikzpicture}
\end{document}
Producción
Respuesta2
¿Qué tal usarlo \hphantom{A}
en la entrada de la leyenda para aumentar el espacio entre los dos?
Código
\documentclass[]{article}
\usepackage{tikz,pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[xmin=0, xmax=4, ymin=0, ymax=10,
width=9cm, height=6cm, legend pos= north east,
legend style={}]
\addplot[only marks,color=red] coordinates {
(0, 10) (0.5, 8.5) (1, 2) (2, 0.5) (3.5, 1.9)};
\addlegendentry{\hphantom{A}Experimental Data Point}
\end{axis}
\end{tikzpicture}
\end{document}