Skip to content

Instantly share code, notes, and snippets.

@andrewfowlie
Created November 6, 2017 00:58
Show Gist options
  • Save andrewfowlie/12c80438197f08d3addc18d836c38bfb to your computer and use it in GitHub Desktop.
Save andrewfowlie/12c80438197f08d3addc18d836c38bfb to your computer and use it in GitHub Desktop.
Pie chart showing fraction of DM in universe
"""
Pie chart of Bayes factor
=========================
"""
import matplotlib
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.ticker import MaxNLocator
from scipy.stats import uniform, expon
matplotlib.rc('text', usetex=False)
plt.xkcd()
matplotlib.rc('font', **{'size': 25})
labels = ["Atoms", "Dark matter", "Dark energy"]
fracs = [0.05, 0.27, 0.68]
explode = [0., 0.1, 0.]
fig, ax = plt.subplots(figsize=(8, 8))
plt.pie(fracs,
explode=explode,
labels=labels,
autopct='%1.0f%%',
shadow=False,
startangle=45,
colors=["Crimson", "RoyalBlue", "Olive"])
plt.savefig("pie.png")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment