1

I want to change the color of my plot, so I do as written here, but nothing changed.

Btw, can you help me to understand why is my colum from 2009 not plotting? Here is my MWE

\documentclass{article}
\usepackage{xcolor}
\usepackage{tikz} 
    \setlength{\parindent}{0pt}
    \usetikzlibrary{calc}
    \usetikzlibrary{backgrounds}
    \usetikzlibrary{chains}
    \usetikzlibrary{trees}
\definecolor{mycolor}{RGB}{8,108,131}
\usepackage{pgfplots}
    \pgfplotsset{compat=1.16} 


\pgfplotsset{
    cycle list={mycolor\\gray},
}
\begin{document} 
    \begin{tikzpicture}
        \begin{axis}[
            x tick label style={
                /pgf/number format/1000 sep=},
            ylabel=Time,
            legend style={at={(0.5,-0.2)},
            anchor=north,legend columns=1},
            ybar interval=0.7,
            xlabel=Requêtes
        ]
        \addplot 
            coordinates {(2012,1900) (2011,1500)
                 (2010,1746) (2009,1534)};%o0ur
        \addplot 
            coordinates {(2012,1043) (2011,947) 
                (2010,1550) (2009,1398)};%them
        \legend{Request,Request b}
        \end{axis}
    \end{tikzpicture}

\end{document} 

And here is the output: Out from code above

Thanks for the help

1

At a couple of positions the syntax was not quite what it should be. Try

\documentclass{article}
\usepackage{xcolor}
\definecolor{mycolor}{RGB}{8,108,131}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16} 


\pgfplotsset{ /pgfplots/bar cycle list/.style={/pgfplots/cycle list={
{mycolor,fill=mycolor!30!white,mark=none},
{gray,fill=gray!30!white,mark=none},
{brown!60!black,fill=brown!30!white,mark=none},
{black,fill=gray,mark=none},
}, },
}



\begin{document} 
    \begin{tikzpicture}
        \begin{axis}[
            x tick label style={
                /pgf/number format/1000 sep=},
            ylabel=Time,
            legend style={at={(0.5,-0.2)},
            anchor=north,legend columns=1},
            %ybar interval=0.7, 
            ybar=5pt,
            xtick={2009,...,2012},
            xlabel=Requ\^{e}tes
        ]
        \addplot 
            coordinates {
            (2012,1900) (2011,1500)
                 (2010,1746) (2009,1534) };%o0ur
        \addplot 
            coordinates { 
            (2012,1043) (2011,947) 
                (2010,1550) (2009,1398) };%them
        \legend{Request,Request b}
        \end{axis}
    \end{tikzpicture}

\end{document} 

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.