2

I am plotting a graph for which I want to cycle through some colors to plot the curves. I defined a custom color list from a custom color map and managed to apply it to my graph.

However, I want to plot the curves as very thick but it cannot be passed as an optional parameter to \addplot. I tried to pass the argument very thick to the whole axis (see the MWE) but the axis itself also becomes very thick which I do not want.

How to pass a thickness argument to the custom defined cycle to apply it to the curves only?

MWE

\documentclass{standalone}

\usepackage{pgfplots} % To produce graphs within tikz
\pgfplotsset{compat=newest}
\usepackage{pgfplotstable}

\begin{document}
    
    \begin{tikzpicture}
        
        \pgfplotsset{colormap={CM}{color=(blue) color=(orange) color=(red)}}
        
        \begin{axis}[colormap name=CM,
            cycle list={[samples of colormap={5}]},
            very thick
            ]
            
            \addplot coordinates{(0,1) (0.5,1) (1,1)};
            \addplot coordinates{(0,2) (0.5,2) (1,2)};
            \addplot coordinates{(0,3) (0.5,3) (1,3)};
            \addplot coordinates{(0,4) (0.5,4) (1,4)};
            \addplot coordinates{(0,5) (0.5,5) (1,5)};

        \end{axis}
    
\end{tikzpicture}
    
\end{document}

1 Answer 1

4

You can add very thick to \addplot, if you do

\addplot +[very thick] ...`

The + means that the options in the brackets are appended to those from the active cycle list.

A simpler way of adding the option to all \addplots in an axis, is to add

every axis plot/.append style={very thick}

to the axis options.

You must log in to answer this question.

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