0

This is my code.

\documentclass[13pt,a4paper]{scrartcl}

\usepackage[x11names]{xcolor}
\usepackage{tikz,pgfplots}
\pgfplotsset{compat=1.12}
\usetikzlibrary{intersections}

\begin{document}

\begin{center} 
\begin{tikzpicture}[scale=1.2]
  \begin{axis}[axis lines=middle,xmin=-0.5,xmax=180,ymin=-0.5,ymax=150,
        x post scale=1.5,
        y post scale=2]
        \addplot+[no marks,domain=0:120,samples=200, ultra thick, color=DarkOliveGreen4] {x} node[right,pos=1] {45}; 
        \addplot+[no marks,domain=50:150,samples=200, ultra thick, color=Gold3] {-0.25*x+112.5} node[below] {$\pi = 20\%$};
        \addplot+[no marks,domain=50:150,samples=200, ultra thick, color=gray] {-0.66667*x+133.333} node[below] {$\pi = 40\%$};
        \addplot+[no marks,domain=50:100,samples=200, ultra thick, color=Gold3] {-1.5*x+175} node[below] { $\pi = 60\%$};
        \addplot+[domain=70:120,samples=200, color=DodgerBlue2, mark=none, ultra thick] {((9.4868-0.2*sqrt(x))/0.8)^2};
        \addplot+[domain=55:120,samples=200, color=DodgerBlue2, mark=none, ultra thick] {((8.3666-0.6*sqrt(x))/0.4)^2}; 
        \addplot+[domain=55:120,samples=200, color=DodgerBlue2, mark=none, ultra thick] {((8.944271-0.4*sqrt(x))/0.6)^2}; 
        \filldraw (50,100) circle (2.5pt)node[right,font=\tiny] {}; 
        \filldraw (90,90) circle (1.5pt)node[right,font=\tiny] {}; 
        \filldraw (80,80) circle (1.5pt)node[right,font=\tiny] {}; 
        \filldraw (70,70) circle (1.5pt)node[right,font=\tiny] {}; 
  \end{axis}
\end{tikzpicture}
\end{center}

\end{document}

This is the image. I like to have all lines solid always, as long as I don't ask for another style. There are some similar questions. None did solve my problem.

enter image description here

1 Answer 1

1

From Torbjørn T.`s answer

pgfplots has a list of styles that it steps through for each \addplot. There are several lists to choose from, see section 4.7.7 Cycle Lists – Options Controlling Line Styles in the manual, but you can also define your own.

Here it was defined an empty list.

a

\documentclass[13pt,a4paper]{scrartcl}

\usepackage[x11names]{xcolor}
\usepackage{tikz,pgfplots}
\pgfplotsset{compat=1.12}
\usetikzlibrary{intersections}
    
\begin{document}
    
    \begin{center} 
        \begin{tikzpicture}[scale=1.2]
            \begin{axis}[axis lines=middle,xmin=-0.5,xmax=180,ymin=-0.5,ymax=150,
                x post scale=1.5,
                y post scale=2,
                cycle list ={} % added <<<<<<<<<<<<<<<<<<<
                ]
                \addplot+[no marks,domain=0:120,samples=200, ultra thick, color=DarkOliveGreen4] {x} node[right,pos=1] {45}; 
                \addplot+[no marks,domain=50:150,samples=200, ultra thick, color=Gold3] {-0.25*x+112.5} node[below] {$\pi = 20\%$};
                \addplot+[no marks,domain=50:150,samples=200, ultra thick, color=gray] {-0.66667*x+133.333} node[below] {$\pi = 40\%$};
                \addplot+[no marks,domain=50:100,samples=200, ultra thick, color=Gold3] {-1.5*x+175} node[below] { $\pi = 60\%$};
                \addplot+[domain=70:120,samples=200, color=DodgerBlue2, mark=none, ultra thick] {((9.4868-0.2*sqrt(x))/0.8)^2};
                \addplot+[domain=55:120,samples=200, color=DodgerBlue2, mark=none, ultra thick] {((8.3666-0.6*sqrt(x))/0.4)^2}; 
                \addplot+[domain=55:120,samples=200, color=DodgerBlue2, mark=none, ultra thick] {((8.944271-0.4*sqrt(x))/0.6)^2}; 
                \filldraw (50,100) circle (2.5pt)node[right,font=\tiny] {}; 
                \filldraw (90,90) circle (1.5pt)node[right,font=\tiny] {}; 
                \filldraw (80,80) circle (1.5pt)node[right,font=\tiny] {}; 
                \filldraw (70,70) circle (1.5pt)node[right,font=\tiny] {}; 
            \end{axis}
        \end{tikzpicture}
    \end{center}
    
\end{document}

You can unify all the styles and simplify the code.

        \begin{tikzpicture}[scale=1.2]
            \begin{axis}[axis lines=middle,xmin=-0.5,xmax=180,ymin=-0.5,ymax=150,
                x post scale=1.5,
                y post scale=2,
                cycle list ={no marks,samples=200, ultra thick\\} % added <<<<<<<<<<<<<<<<<<<
                ]
                \addplot+[domain=0:120, color=DarkOliveGreen4] {x} node[right,pos=1] {45}; 
                \addplot+[domain=50:150, color=Gold3] {-0.25*x+112.5} node[below] {$\pi = 20\%$};
                \addplot+[domain=50:150, color=gray] {-0.66667*x+133.333} node[below] {$\pi = 40\%$};
                \addplot+[domain=50:100, color=Gold3] {-1.5*x+175} node[below] { $\pi = 60\%$};
                \addplot+[domain=70:120, color=DodgerBlue2] {((9.4868-0.2*sqrt(x))/0.8)^2};
                \addplot+[domain=55:120, color=DodgerBlue2] {((8.3666-0.6*sqrt(x))/0.4)^2}; 
                \addplot+[domain=55:120, color=DodgerBlue2] {((8.944271-0.4*sqrt(x))/0.6)^2}; 
                \filldraw (50,100) circle (2.5pt)node[right,font=\tiny] {}; 
                \filldraw (90,90) circle (1.5pt)node[right,font=\tiny] {}; 
                \filldraw (80,80) circle (1.5pt)node[right,font=\tiny] {}; 
                \filldraw (70,70) circle (1.5pt)node[right,font=\tiny] {}; 
            \end{axis}
        \end{tikzpicture}

You must log in to answer this question.

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