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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors