# -*- coding: utf-8 -*- """ Created on Mon Nov 4 07:25:13 2019 @author: Finn Haugen """ import matplotlib.pyplot as plt import numpy as np # Data and text to be displayed in the pie diagram: data = np.array([1, 2, 3, 4, 5, 6]) data_norm = data/sum(data) my_labels = ['Pi: ' + str(data[0]), 'Upsilon: ' + str(data[1]), 'Theta: ' + str(data[2]), 'Eta: ' + str(data[3]), 'Omikron: ' + str(data[4]), 'Nu: ' + str(data[5])] # Size of figure window: fig_width_cm = 24 fig_height_cm = 18 plt.figure(num=1, figsize=(fig_width_cm/2.54, fig_height_cm/2.54)) # Pie diagram: plt.rc('font', size=12) # rc is abbrev for 'run configuration' plt.pie(data_norm, labels=my_labels, autopct='%.1f%%') plt.title('Figure title') #plt.show() plt.savefig('pie_chart.pdf')