# Recreate default colors

How is it possible to specific the colors shown in the sample plot here:

The code is below and copied from the site!

 \begin{tikzpicture}
\begin{ternaryaxis}[
ternary limits relative,
title={Data range $[0,1]$, limits relative},
area style]
(0.2,0.8,0)
(0.31,0.4,0.29)
(0.34,0.2,0.46)
(0.4,0,0.6)
(1,0,0)
};
(0.4,0,0.6)
(0.34,0.2,0.46)
(0.31,0.4,0.29)
(0.14,0.46,0.4)
(0,0.37,0.63)
(0,0,1)
};
\node[fill=white]
at (axis cs:0.56,0.28,0.16) {$F 42$};
\node[fill=white]
at (0.7,0.2) {$F 43$};
\end{ternaryaxis}
\end{tikzpicture}

-
I don't understand your question. The colors from your code (after suitable completion) and those in the linked image are the same. What exactly are you trying to achieve? – Gonzalo Medina May 15 '14 at 18:43
do you maybe want to ask what would be the LaTeX definition of the standard plot colors or, more generally, how to define a given color (e.g. taken from a pdf) in LaTeX? – domenico May 15 '14 at 19:35

I understand you are asking where are these blue and red colors defined when no color is mentioned into the code.

pgfplots uses some internally defined cycle lists of colors. When plots have no explicit colors, default ones are used. This way, first plot uses to be blue, second, red, ...

In this particular case, the plot is filled with some color, it is not only drawn. Let's try to find in pgfplots documentation how are this filling colors defined.

Let's start in Ternary Diagrams section (page 444 in Revision 1.10 from 2014/02/28). It says:

As you can see these colors looks like your ones. This paragraph mention that this kind of plot uses area style to change cycle list. If we click on area style we jump to page 95

where we click on bar cycle list which send us to page 82



where we find that these filling colors are blue!30!white for the first addplot3d and red!30!white for the second.

-
+1 Ah, yes. This seems to be what the OP was asking (I didn't understood the question). I'll leave my answer in any case as it can also be helpful in other cases. – Gonzalo Medina May 15 '14 at 22:07

If you are asking how to change the colors, this can be done using the draw=<color> and or fill=<color> options for the \addplot3 commands and using your favorite colors. A little example using your code in which I added a third \addplot3 just to illustrate how to change colors for the three regions:

\documentclass{article}
\usepackage{pgfplots}
\usepgfplotslibrary{ternary}

\begin{document}

\begin{tikzpicture}
\begin{ternaryaxis}[
ternary limits relative,
title={Data range $[0,1]$, limits relative},
area style]
(0.2,0.8,0)
(0.31,0.4,0.29)
(0.34,0.2,0.46)
(0.4,0,0.6)
(1,0,0)
};
(0.4,0,0.6)
(0.34,0.2,0.46)
(0.31,0.4,0.29)
(0.14,0.46,0.4)
(0,0.37,0.63)
(0,0,1)
};
(0,0,0)
(0.2,0.8,0)
(0.31,0.4,0.29)
(0.14,0.46,0.4)
(0,0.37,0.63)
(0,0,0)
};
\node[fill=white]
at (axis cs:0.56,0.28,0.16) {$F 42$};
\node[fill=white]
at (0.7,0.2) {$F 43$};
\end{ternaryaxis}
\end{tikzpicture}

\end{document}
`

-