- To install python, add path variables and verify installation: Getting Started with Python Scripting in Power BI | Power BI Training Australia
- For importing and manipulating data using Python scripts: Data Manipulation using Python Scripts | Power BI Training Australia
- Creating a basic box plot using Python in Power BI: Creating a box plot using Python in Power BI | Power BI Training Australia
- Creating plot visualization using Python in Power BI: Creating Plot Visualization using Python in Power BI | Power BI Training Australia
Data set used:
For this section you need to download IRIS dataset which is publicly available. You can download the dataset from https://gist.github.com/netj/8836201.Introduction to Seaborn Library
Seaborn library in python is built on the top of Matplotlib library and is developed solely for visualization purposes. Seaborn is used to build beautiful visualizations and helps in analyzing the data.Start Scripting:
- Select Visualization Tab under the Visualizations Pane.

2. Click on Python Visual. The following window will appear.

3. Click on Enable to enable Python Scripts. The following window will appear.

Python script editor automatically creates the dataset using the library Pandas. It creates the data frame with required column fields.
Create a Violin Plot
Violin plots are used to visualize the distribution of numeric variables for one or multiple groups, it allows to understand the density more deeply. It is an upgraded version of the box plot. The violin plot is showing a relationship between the petal width and petal length of the data points. Its showing that the data set does not have a continuity in the values. Most the points are distributed where the petal length is greater than 3. To use Violin plots you have to install Seaborn library, it is another data visualization library provided by python to generate high-level statistical graphs.
1. Open the Python editor.
2. Enter the code as shown in the screenshot below.

3. The above generates the following plot.

Conclusion:
Seaborn is python library built on the top of Matplotlib library. Seaborn is developed to assist data visualization for python users. Power BI has integrated python into this desktop tool. Therefore, seaborn can be used for coding inside the Power BI desktop and construct beautiful visuals. Violin plot is used to understand the distribution of the variables. Violin plots are like box plots except that they show the density of the variables around different values. In this blog post, a step by step guide on creating violin plot in Power BI using python has been presented.
Are you a data analyst and want to learn more about Power BI?
Why not sign up for Power BI training in Australia. We provide our services in the following regions: