A quick Python Plot in Power BI

Excited to see Python support in Power BI in Aug 2018 build. A very quick Python Matplotlib chart in Power BI.

pythonpowerbipie.PNG

Here’s the full Python code.

import matplotlib.pyplot as plt
import numpy as np

slices = [3, 6, 10, 7]
activities = [‘sleeping’,’eating’,’working’,’playing’]
colors = [“m”,”c”,”r”,”g”]
plt.pie(slices,
labels=activities,
colors=colors,
startangle=90,
shadow=True,
explode=(0,0.1,0,0),
autopct=”%1.1f%%”)

plt.title(“activity distribution”)
plt.show()

 

 

Leave a Reply