3

Why do curves appear with dashed lines?

\documentclass[border=1pt]{standalone}
\usepackage[dvipsnames,svgnames,x11names,]{xcolor}
\usepackage{pgfplots}

\pgfplotsset{compat=1.12}

\begin{document}
    
    \begin{tikzpicture}[line cap=round,line join=round]
        \begin{axis}[view={20}{30},
            xmin=-2, xmax=2,
            ymin=-2, ymax=2,
            zmin=-0, zmax=6.5,
            xtick=\empty,
            ytick=\empty,
            ztick=\empty,
            %enlargelimits=false,   
            ]
                \addplot3+[no markers, variable=t, line width=1pt, DeepPink1 ,domain={-180}:{180},samples=51, samples y=0] ({1*cos((t))}, {1*sin((t))}, {1});
                \addplot3+[no markers, variable=t, line width=1pt, DeepPink1, domain={-180}:{180},samples=51, samples y=0] ({2*cos((t))}, {2*sin((t))}, {.5});  
                \addplot3+[no markers, variable=t, line width=1pt, DeepPink1, domain={-180}:{180},samples=51, samples y=0] ({1*cos((t))/2.05}, {1*sin((t))/2.05}, {2.05});
                \addplot3+[no markers, variable=t, line width=1pt, DeepPink1, domain={-180}:{180},samples=51, samples y=0] ({1*cos((t))/3}, {1*sin((t))/3}, {3});
                \addplot3+[no markers, variable=t, line width=1pt, DeepPink1, domain={-180}:{180},samples=51, samples y=0] ({1*cos((t))/4.2}, {1*sin((t))/4.2}, {4.2}); 
                \addplot3+[no markers, variable=t, DeepPink1 ,domain={-180}:{180},samples=51, samples y=0] ({1*cos((t))}, {1*sin((t))}, {6.5});
                \addplot3+[no markers, variable=t,, domain={-180}:{180},samples=51, samples y=0] ({2*cos((t))}, {2*sin((t))}, {6.5});   
                \addplot3+[no markers, variable=t, DeepPink1, domain={-180}:{180},samples=51, samples y=0] ({1*cos((t))/2.05}, {1*sin((t))/2.05}, {6.5});
                \addplot3+[no markers, variable=t, DeepPink1, domain={-180}:{180},samples=51, samples y=0] ({1*cos((t))/3}, {1*sin((t))/3}, {6.5});
                \addplot3+[no markers, variable=t, DeepPink1, domain={-180}:{180},samples=51, samples y=0] ({1*cos((t))/4.2}, {1*sin((t))/4.2}, {6.5}); 
        \end{axis}
    \end{tikzpicture}   
    
\end{document}

figura

1
  • 1
    In addition to what is said in the accepted answer, note that the cycle list only applies because you're using \addplot +[...]. Had you used \addplot [...] without the +, your options would have replaced the cycle list options, instead of adding to them. Commented May 1, 2021 at 7:16

1 Answer 1

5

The answer to

Why do curves appear with DASHED lines?

is

Because pgfplots cycles through a list of styles, some of which are dashed.

In order to have all plots solid, you could use every axis plot post/.append style={solid}.

\documentclass[border=1pt]{standalone}
\usepackage[dvipsnames,svgnames,x11names,]{xcolor}
\usepackage{pgfplots}
\pgfplotsset{compat=1.17}

\begin{document}
    
    \begin{tikzpicture}[line cap=round,line join=round]
        \begin{axis}[view={20}{30},
            xmin=-2, xmax=2,
            ymin=-2, ymax=2,
            zmin=-0, zmax=6.5,
            xtick=\empty,
            ytick=\empty,
            ztick=\empty,
            every axis plot post/.append style={solid}
            %enlargelimits=false,   
            ]
                \addplot3+[no markers, variable=t, line width=1pt, DeepPink1 ,domain={-180}:{180},samples=51, samples y=0] ({1*cos((t))}, {1*sin((t))}, {1});
                \addplot3+[no markers, variable=t, line width=1pt, DeepPink1, domain={-180}:{180},samples=51, samples y=0] ({2*cos((t))}, {2*sin((t))}, {.5});  
                \addplot3+[no markers, variable=t, line width=1pt, DeepPink1, domain={-180}:{180},samples=51, samples y=0] ({1*cos((t))/2.05}, {1*sin((t))/2.05}, {2.05});
                \addplot3+[no markers, variable=t, line width=1pt, DeepPink1, domain={-180}:{180},samples=51, samples y=0] ({1*cos((t))/3}, {1*sin((t))/3}, {3});
                \addplot3+[no markers, variable=t, line width=1pt, DeepPink1, domain={-180}:{180},samples=51, samples y=0] ({1*cos((t))/4.2}, {1*sin((t))/4.2}, {4.2}); 
                \addplot3+[no markers, variable=t, DeepPink1 ,domain={-180}:{180},samples=51, samples y=0] ({1*cos((t))}, {1*sin((t))}, {6.5});
                \addplot3+[no markers, variable=t,, domain={-180}:{180},samples=51, samples y=0] ({2*cos((t))}, {2*sin((t))}, {6.5});   
                \addplot3+[no markers, variable=t, DeepPink1, domain={-180}:{180},samples=51, samples y=0] ({1*cos((t))/2.05}, {1*sin((t))/2.05}, {6.5});
                \addplot3+[no markers, variable=t, DeepPink1, domain={-180}:{180},samples=51, samples y=0] ({1*cos((t))/3}, {1*sin((t))/3}, {6.5});
                \addplot3+[no markers, variable=t, DeepPink1, domain={-180}:{180},samples=51, samples y=0] ({1*cos((t))/4.2}, {1*sin((t))/4.2}, {6.5}); 
        \end{axis}
    \end{tikzpicture}   
    
\end{document}

enter image description here

You must log in to answer this question.

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