10

When using

\documentclass{article}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
        \begin{axis}        
            \addplot
            [
                red,
                solid,
                mark=x,
                domain=-3e-3:3e-3,
                samples=50
            ] 
            {exp(-x^2/(2e-3^2))/(1e-3*sqrt(2*pi))};
        \end{axis}
    \end{tikzpicture}   
\end{document}

the markers look fine, see

enter image description here

, but when I replace solid with, for instance, loosely dashed, so

\documentclass{article}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
        \begin{axis}        
            \addplot
            [
                red,
                loosely dashed,
                mark=x,
                domain=-3e-3:3e-3,
                samples=50
            ] 
            {exp(-x^2/(2e-3^2))/(1e-3*sqrt(2*pi))};
        \end{axis}
    \end{tikzpicture}   
\end{document}

the markers only show partially instead of fully, see

enter image description here

. How can I use loosely dashed with full markers showing?

1 Answer 1

13

You can tell PGFPlots to use unbroken lines for the markers by setting mark options=solid:

\documentclass{article}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
        \begin{axis}        
            \addplot
            [
                red,
                loosely dashed,
                mark options=solid,
                mark=x,
                domain=-3e-3:3e-3,
                samples=50
            ] 
            {exp(-x^2/(2e-3^2))/(1e-3*sqrt(2*pi))};
        \end{axis}
    \end{tikzpicture}   
\end{document}
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .