Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Rohan231
Regular Visitor

How to change the size of python visual in power bi?

I want to change the size of the python visual in Power BI. 

Code - 

from shap import TreeExplainer, Explanation
from shap.plots import waterfall
import shap
import joblib
import ipywidgets as widgets
import matplotlib.pyplot as plt
rf_model = joblib.load("Model.joblib")
explainer = shap.TreeExplainer(rf_model)
X_data = pandas.read_csv("data.csv")
explainer = TreeExplainer(rf_model)
sv = explainer(X_data.drop('email',axis=1))
 
exp = Explanation(sv.values[:,:,1],
                   sv.base_values[:,1],
                   data=X_data.values,
                   feature_names=X_data.columns)
waterfall(exp[102])
 
The visual it creates:
Rohan231_0-1666155008469.png
If you see properly, the features on left-hand side of the graph are not looking properly(They get cut down).
I have already tried with "plt.figure(figsize=(20,10))", but it's not working.
If anyone knows how to solve this issue, please let me know.
Thanks & Regards.
2 REPLIES 2
v-luwang-msft
Community Support
Community Support

Thanks, but it's not working.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.