Is there a way to get for all tikz
-plots in one LaTeX document the same distance between the plot mark
s, ie the distance between the marks should be independent of sample size. It would be really great if this change wouldn't interfere with the legend like change the position of the marker in the legend
etc. Thanks.
Edit: Unfortunately the distance of all data points (not in the mini example but for the real data) is not the same therefore it would be nice if I could define distance between the marks in cm.
\documentclass[tikz,border=1mm]{standalone}
\usepackage{pgfplots}
\usetikzlibrary{decorations.markings}
\pgfplotsset{compat=1.11}
%\tikzset{mark/.style={
% decoration={
% markings,
% mark= between positions 0 and 1 step 5mm with
% {
% %\node[circle,inner sep=2pt,fill=blue]{};
% },
% },
% postaction={decorate}
% }
%}
\begin{document}
\begin{tikzpicture}
\begin{axis}[]
\addplot[
blue,
domain=0:3,
samples=100,
mark=*
]
{exp(x)};
\addlegendentry{exp(x)};
\addplot[
red,
domain=0:3,
samples=20,
mark=diamond
]
{4*x};
\addlegendentry{4x};
\end{axis}
\end{tikzpicture}
\end{document}
edit: Is is possible to pass to tikz such options like mark size
or mark options={solid}
?
\addplot [color=black,loosely dotted,line width=1.5pt, mark=*,mark size=3pt, mark=diamond,mark options={solid}]
edit2: I found out how I can set the marks solid
in the legend but how can I do the same in for the plot? Any ideas how to get the plot marks solid
in the actual plot?
\tikzset{
nomorepostactions/.code={\let\tikz@postactions=\pgfutil@empty},
mymark/.style={decoration={markings,
mark= between positions 0 and 1 step (1/11)*\pgfdecoratedpathlength with{%
\pgfuseplotmark{#1},%
},
},
postaction={decorate},
/pgfplots/legend image post style={mark=#1,every path/.append style={nomorepostactions}},
},
every mark/.append style={solid,mark size=3},
}