How can I adjust the whitespace around go.Pie chart

I have a pie chart I produced using go.pie which through another user I was able to adjust the size of however, the white spacing around is a lot larger than the visual for that section. For my other charts I used ‘figure.figsize’:(5,10.27) I was wondering someone might be able to advise me of the go.pie equivalent code. I have tried to adjust the height and font but the white spacing remains as is.

My code is;

And this is my pie chart visual

Many thanks

Hi again @Dashz, I’d suggest first to remove the margins using:
fig.update_layout(margin=dict(t=0, b=0, l=0, r=0))

Then it’s all about playing around with your layout width and height. It seems here that your layout is much wider than necessary.

Also, you could change the position or orientation of your lengend.

Below is an example of a “tighter” layout for your pie chart:

fig.update_layout(height=500,
                  width=400,
                  margin=dict(t=0, b=0, l=0, r=0),
                  font=dict(size=14),
                  title=dict(
                    y=1,
                    x=0.5,
                    xanchor= 'left',
                    yanchor= 'top'),
                  legend=dict(
                    orientation="h",
                    yanchor="bottom",
                    y=0.01,
                    xanchor="right",
                    x=0.95))

fig.update_traces(textfont_size=20)

And here’s the resulting chart:

Thank you so much for helping me out with the code really appreciate all your help.

I think the issue sort of is that I have two charts one which shows all cars and percentages and another which shows just 5. The first is generally overly crowded due to the amount of data. As advised I have done some trial and error with the code you provided to adjust the height and width. But I guess the amount of data means that the heading is scarified and so I may just still to the second one which you have kindly included above as it is much more better visually suited.

Once again I appreciate all your help, I will mark this as the solution.