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

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s