Don't miss your chance to take exam DP-600 or DP-700 on us!
Request nowLearn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Hi all,
I am using python to built a boxplot graph. As you may know, padding in python is not that good so in order to improve my graph size I am using plt.tight_layout(). This works perfect in PBI Desktop but once I publish my report, the original padding comes back.
This is my first work in power bi using python, Am I missing something?
Thanks,
Cesar
Solved! Go to Solution.
Hi Xiaoxin,
I found the solution, for boxplots instead of using plt.tight_layout() I needed to use plt.figure(figsize=(20,5)).
It is not a perfect option because there is still some non-optimized surrounding spaces, but at least it works with PBI services.
Regards,
Cesar
Hi @Anonymous ,
I'd like to suggest you to take a look at following blog about power bi and python script:
Python visualizations in Power BI Service
As document said, all python script execute in a sandbox and power bi will block the access of extra resources. It may block some functions work on power bi service side.
Regards,
Xiaoxin Sheng
Hi Xiaoxin,
I found the solution, for boxplots instead of using plt.tight_layout() I needed to use plt.figure(figsize=(20,5)).
It is not a perfect option because there is still some non-optimized surrounding spaces, but at least it works with PBI services.
Regards,
Cesar
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 20 | |
| 18 | |
| 11 | |
| 11 | |
| 7 |
| User | Count |
|---|---|
| 42 | |
| 38 | |
| 21 | |
| 21 | |
| 17 |