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

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

Reply
mjo31
Frequent Visitor

Python Visual :Increase the size of the visual

Hi,

I am trying to generate a python visual from power BI. I was able to generate a line chart. But I am unable to increase the size of the visual in power BI.Its always fixed.

Code: Output is a dataframe with Actual and Optimized Budget.I used matplotlib to plot line chart

 

import matplotlib.pyplot as plt
output[['Actual Budget','Optimized Budget']].plot()
#plt.figure(frameon=False,dpi=200)
#plt.figure(figsize=(20,18))
plt.rcParams["figure.figsize"]=(80,50)
plt.show()
 
Below is visual.As you can see the python visual size is fixed, and unable to increase the size of visual.
 
mjo31_0-1630321836450.png

Any help would be greatly appreciated.

1 ACCEPTED SOLUTION
v-jingzhang
Community Support
Community Support

Hi @mjo31 

 

See if these can help:

plt figsize Code Example (codegrepper.com)

How to Set the Size of a Figure in Matplotlib with Python (learningaboutelectronics.com)

 

Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

View solution in original post

2 REPLIES 2
daloom
New Member

A simple solution could be to only set your plot tightness with plt.tight_layout()

 

import seaborn as sns
import matplotlib.pyplot as plt
with sns.plotting_context("paper", font_scale=1.5,):
    sns.violinplot( data=dataset, x="season", y="registered", hue="weekday", orient="v")
# eliminate the default big margins across your plot
plt.tight_layout()
plt.show()
 
Tight layoutTight layoutNormal layoutNormal layout
v-jingzhang
Community Support
Community Support

Hi @mjo31 

 

See if these can help:

plt figsize Code Example (codegrepper.com)

How to Set the Size of a Figure in Matplotlib with Python (learningaboutelectronics.com)

 

Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

Helpful resources

Announcements
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.