0

I'm a newbie and I would like to change the size of the bar chart I created with Matplotlib and Python, so I can show it in a presentation. I have very much values and the outcoming graphic is far too small. The columns 'State' and 'Hospital 30-Day Readmission Rates from Pneumonia' contain >50 values.

This is my current code:

smallgroup.plot('State', 'Hospital 30-Day Readmission Rates from Pneumonia', kind='bar')
plt.title("Hospital 30-Day Readmission Rates from Pneumonia")
plt.xlabel("States")
plt.ylabel("Readmission Rates")
plt.savefig('readmission_rate_pneumonia.png');
2
  • 1
    Do you want to change the size of the entire figure? Try setting figsize if so. stackoverflow.com/questions/332289/… Commented Apr 11, 2017 at 18:51
  • Thank you so much! Commented Apr 11, 2017 at 19:15

1 Answer 1

1

using width of bar plot :

bar(x, y, width=30)

see example here :

https://plot.ly/matplotlib/bar-charts/

Sign up to request clarification or add additional context in comments.

2 Comments

It doesn't work. The bar chart is still 432x288 px and the bars are now too big to deifne. With the current px size I have to use a width < 0.5. But this doesn't change the size of the whole graphic. I need a bigger picture.
you should adjust your figure size to your bar size...here information about figure : matplotlib.org/api/figure_api.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.