user469652
user469652

Reputation: 51351

About the image size that generated from matplotlib

I generated a histogram by using matplotlib

import numpy as np
import pylab as P


mu, sigma = 200, 25
x = mu + sigma*P.randn(10000)


P.figure()
bins = 10
n, bins, patches = P.hist(x, bins, normed=1, histtype='bar', rwidth=0.8)
P.show()

I want to make the picture smaller, how could I do that?

Thanks for your help

Upvotes: 1

Views: 11262

Answers (2)

user488551
user488551

Reputation: 406

In addition to specifying the figsize, there's also a dpi option - although this is more important if you're using one of the image generating backends.

Upvotes: 0

Justin Peel
Justin Peel

Reputation: 47082

If you just want to set it for this specific figure, then change your figure declaration to:

P.figure(figsize=(i,j))

where i is the width in inches and j is the height in inches.

Upvotes: 4

Related Questions