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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Not applicable

[Custom Python Visual] Maplotlib Bar Chart Is Showing Empty Space



As the title says, Matplotlib Bar Chart is showing alot of empty spaces.


I want the bar chart to take up all the empty spaces shown below.


Any advice on how to get this done?


Thank you in advance!




Not applicable

Hi @ray_ux,


Thank you for your comment.


I think my post is a little vague. What I'm trying to do is fill up the allotted space for the Python visual.


Is this an aspect ratio issue? Do you have any other advice?


Thank you in advance!




Memorable Member
Memorable Member

To get rid of whitespace around the border,  set bbox_inches='tight' in the savefig() method.

I recommend using plotly js custom visual

You can select bar graph and built on top of it - it has more functionality and is easier to configure stuff.

Not applicable

As a comparison, the table below is what I want the chart to look like.


The chart inside the square fills up all of its allotted space. No empty spaces.




Helpful resources

Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors