I have a problem that is doing my head in, I am trying to color a graph with the color "Mahogany", thing that works when writting in a beamer but that suddently happens to stop working in an article. First latex tells me that it does not recognise the color. So, I tried to fix this by using the package \usepackage[dvipsnames]{xcolor} but then it comes up with an error saying that the option [dvipsnames] is not compatible with xcolor, weird since I have followed the instructions from the overleaf webpage.
I am attaching pictures and code if somebody could help me.
\usepackage[dvipsnames]{xcolor}
\begin{center}
\begin{figure}
\centering
\begin{tikzpicture}
\begin{axis}[
xscale=1, yscale=1,
width=10cm,
domain= -4:4,
xmin = -3, xmax = 3, ymin = 0, ymax = 1.2,
xtick = {-0.707,0,0.707},
ytick = {1},
xticklabels = {\footnotesize $-\sqrt{\frac{1}{2}}$, \footnotesize $0$, \footnotesize $\sqrt{\frac{1}{2}}$},
% yticklabels = {\footnotesize $f(a)$, \footnotesize $\tiny(1-\lambda)f(a)+\lambda f(b)$, \footnotesize $f\left( (1-\lambda)a+\lambda b\right)$,\footnotesize $f(b)$},
axis lines = middle,
% axis line style={draw=none},
samples=100,
no markers]
\draw[dashed,gray, ultra thin] (.707, 0)--(.707, .607) ;
\draw[dashed,gray, ultra thin] (-.707, 0)--(-.707, .607) ;
\draw[dashed,gray, ultra thin] (3.24, 0)--(3.24, 3.5) ;
\draw [decorate,decoration={brace,amplitude=5pt},xshift=0pt,yshift=2pt] (0.4,2.28) -- (1,2.28) node [black,midway,yshift=10pt] {\tiny $(x_1^*-\epsilon,x_1^*+\epsilon) = S $};
\addplot[ultra thick, color=mahogany]{exp(-x^2)};
\draw[dashed,gray, ultra thin] (.4, 2.3)--(1, 2.3);
\end{axis}
\end{tikzpicture}
\end{figure}
\end{center}

MinMahoganyhas to be uppercase. If I changemahoganytoMahoganyand wrap yourcenterenvironment into\documentclass{article} \usepackage[dvipsnames]{xcolor} \usepackage{pgfplots} \pgfplotsset{compat=1.16} \begin{document}and\end{document}, it works. – Sep 23 '19 at 17:04\PassOptionsToPackage{dvipsnames}{xcolor} \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.16} \begin{document}and\end{document}but really the issue seems to be that you were using a lower-casem. – Sep 23 '19 at 17:09\usepackage{tikz} \usepackage[dvipsnames]{xcolor}in that order, you'll get an error about an option clash. See e.g. https://tex.stackexchange.com/q/51488 Swap the order as in Schrödinger Cat's first comment, or use\PassOptionsToPackageas in his second comment. – Torbjørn T. Sep 23 '19 at 18:20