3

I'm trying to create a pie-chart showing just how dominant SpaceX is when it comes to the number of orbital assets that it controls.

From my data, I've generated this:

\documentclass[a4paper]{article}

\usepackage{pgfplots}
\usepackage{pgf-pie}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\begin{document}
\begin{figure}
\begin{tikzpicture}
\pie [sum=100, scale font, text=pin]
{31.95/SpaceX Seattle, 4.36/One Web, 3.18/Planet Labs, 3.04/United States Air Force, 2.27/Main Space Forces Directorate, 1.67/Main Space Forces Directorate, 1.57/Russian Space Forces, 1.54/Upravleniye Nachalnika Kosmicheskikh Sredstv, 1.51/Swarm Technologies, 1.33/NASA Goddard Space Flight Center, 1.32/Soviet Navy, 1.23/General Armaments Dept. of the PLA, 1.14/Spire, 1.06/Iridium Inc., 1/Russian Military Space Forces, 0.95/Indian Space Research Organization, 0.88/OKB-10 (Reshetnev), 0.88/China Aerospace Sci/Tech Corp, 0.87/Globalstar LLC, 0.83/National Reconnaissance Office, 0.81/Proto-Vozdhusnoy Oborony, 0.73/GLONASS Information-Analytic Center, 0.73/China National Space Administration, 0.73/Chang Guang Satellite Technology Ltd, 0.72/United States Navy, 0.68/European Space Agency, 0.66/Naval Research Lab, 0.62/Orbcomm Inc., 0.58/International Telecommunications Satellite Organization, 0.54/Ministry of Comms. Union Radio Comms., 0.52/National Space Research Center, 30.1/Small Operators (<50 sats)};

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

Which renders out to this glorious mess:

Render results

To make this more legible, I only really want to label a few interesting slices. Namely SpaceX, One Web, Planet Labs, The USAF, Iridium and the ESA. To do this I've tried:

  1. Using a legend - it's far too long
  2. Leaving the label blank for the ones I don't want to label - it just puts the value on the pin

Ideally, I'd also like to be able to hide the inner percentage for all but SpaceX and Small Operators but that's likely oging to need a separate question

0

1 Answer 1

4

The answer below uses the wheelchart package, which I wrote.

Answer with version 2.0 of the wheelchart package:

The data and the lines for slices 1, 2, 3, 4, 14 and 26 are specified with the keys data{1,2,3,4,14,26} and lines{1,2,3,4,14,26}.

The colors for the slices are specified with a list with the key slices style{list}.

The wheel data for slices 1 and 32 are specified with the key wheel data{1,32}. Here, \WCperc denotes the percentage.

enter image description here

\documentclass[border=6pt]{standalone}
\usepackage{wheelchart}
\begin{document}
\begin{tikzpicture}
\wheelchart[
  data=,
  data{1,2,3,4,14,26}=\WCvarB,
  lines{1,2,3,4,14,26}=1,
  perc precision=2,
  pie,
  slices style{list}={blue,green,yellow,red},
  wheel data{1,32}=\WCperc
]{%
  31.95/SpaceX Seattle,
  4.36/One Web,
  3.18/Planet Labs,
  3.04/United States Air Force,
  2.27/Main Space Forces Directorate,
  1.67/Main Space Forces Directorate,
  1.57/Russian Space Forces,
  1.54/Upravleniye Nachalnika Kosmicheskikh Sredstv,
  1.51/Swarm Technologies,
  1.33/NASA Goddard Space Flight Center,
  1.32/Soviet Navy,
  1.23/General Armaments Dept. of the PLA,
  1.14/Spire,
  1.06/Iridium Inc.,
  1/Russian Military Space Forces,
  0.95/Indian Space Research Organization,
  0.88/OKB-10 (Reshetnev),
  0.88/China Aerospace Sci/Tech Corp,
  0.87/Globalstar LLC,
  0.83/National Reconnaissance Office,
  0.81/Proto-Vozdhusnoy Oborony,
  0.73/GLONASS Information-Analytic Center,
  0.73/China National Space Administration,
  0.73/Chang Guang Satellite Technology Ltd,
  0.72/United States Navy,
  0.68/European Space Agency,
  0.66/Naval Research Lab,
  0.62/Orbcomm Inc.,
  0.58/International Telecommunications Satellite Organization,
  0.54/Ministry of Comms. Union Radio Comms.,
  0.52/National Space Research Center,
  30.1/Small Operators ($<50$ sats)%
}
\end{tikzpicture}
\end{document}

Answer with version 1.0 of the wheelchart package:

A command \WCtest is defined to specify the data and the lines for slices 1, 2, 3, 4, 14 and 26. Here, \WCcount gives the current number of the slice.

Similarly, the wheel data are specified for slices 1 and 32.

\documentclass[border=6pt]{standalone}
\usepackage{xcolor}
\usepackage{wheelchart}
\begin{document}
\begin{tikzpicture}
\def\WCtest#1#2{ifthenelse(\WCcount==1||\WCcount==2||\WCcount==3||\WCcount==4||\WCcount==14||\WCcount==26,#1,#2)}
\wheelchart[
data={\pgfmathparse{\WCtest{"\WCvarB"}{}}\pgfmathresult},
lines={\WCtest{1}{0}},
perc precision=2,
pie,
slices style={/utils/exec={\pgfmathsetmacro{\WCcolornumber}{int(Mod({\WCcount-1},4)+1)*60+400}\definecolor{WCcolor}{wave}{\WCcolornumber}},WCcolor},
wheel data={\pgfmathparse{ifthenelse(\WCcount==1||\WCcount==32,"\WCperc",)}\pgfmathresult}
]
{31.95/SpaceX Seattle, 4.36/One Web, 3.18/Planet Labs, 3.04/United States Air Force, 2.27/Main Space Forces Directorate, 1.67/Main Space Forces Directorate, 1.57/Russian Space Forces, 1.54/Upravleniye Nachalnika Kosmicheskikh Sredstv, 1.51/Swarm Technologies, 1.33/NASA Goddard Space Flight Center, 1.32/Soviet Navy, 1.23/General Armaments Dept. of the PLA, 1.14/Spire, 1.06/Iridium Inc., 1/Russian Military Space Forces, 0.95/Indian Space Research Organization, 0.88/OKB-10 (Reshetnev), 0.88/China Aerospace Sci/Tech Corp, 0.87/Globalstar LLC, 0.83/National Reconnaissance Office, 0.81/Proto-Vozdhusnoy Oborony, 0.73/GLONASS Information-Analytic Center, 0.73/China National Space Administration, 0.73/Chang Guang Satellite Technology Ltd, 0.72/United States Navy, 0.68/European Space Agency, 0.66/Naval Research Lab, 0.62/Orbcomm Inc., 0.58/International Telecommunications Satellite Organization, 0.54/Ministry of Comms. Union Radio Comms., 0.52/National Space Research Center, 30.1/Small Operators ($<50$ sats)}
\end{tikzpicture}
\end{document}

You must log in to answer this question.

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