0

So I've got a pie chart that I'm making (data has been shortened for brevity).

However, I want to use colors from the xcolor package with this.

\documentclass[a4paper]{article}

\usepackage[usenames,dvipsnames]{xcolor}
\usepackage{pgfplots}
\usepackage{pgf-pie}

\begin{document}
\begin{figure}
\begin{tikzpicture}

\pie [color={\color{Aquamarine},\color{ForestGreen},\color{RubineRed}}, sum=100, scale font, text=legend]
{20/SpaceX (Collated), 50/United States Armed Forces (Collated), 30/Russian or USSR Armed Forces (Collated)};

\end{tikzpicture}
\caption{Distribution of control over space-borne assets}
\label{fig:controlpie}
\end{figure}
\end{document}

I've been following this wiki page and believe the syntax I'm using is correct.

However, I'm getting these errors on compile:

Argument of \XC@ definec@lor has an extra }.

Paragraph ended before \XC@definec@lor was complete.

Missing \endcsna me inserted.

This has me confused, as I'm fairly sure there's no extra brace in my source. There's clearly something going wrong with the colour definitions though, as if I replace my \color{Colour} entries with the standard red, green, gray Latex colours, there's no issue.

What am I doing wrong here?

1 Answer 1

0

Well... This is a simple one.

I just didn't need the \color.

\begin{figure}
\begin{tikzpicture}
\pie [color={Aquamarine,ForestGreen,RubineRed}, sum=100, scale font, text=legend]
{20/SpaceX (Collated), 50/United States Armed Forces (Collated), 30/Russian or USSR Armed Forces (Collated)};

\end{tikzpicture}
\caption{Distribution of control over space-borne assets}
\label{fig:controlpie}
\end{figure}

You must log in to answer this question.

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