matplotlib Pyplot histogram gets its top chopped off [closed]

kyvafyod  于 2023-02-23  发布在  其他
关注(0)|答案(1)|浏览(126)

Closed. This question is not reproducible or was caused by typos . It is not currently accepting answers.

This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed yesterday.
Improve this question
I currently am trying to learn some pyplot basics, am the documentation has really helped so far. However, I recently encountered a problem that i can't find the solution to. I plotted an histogram using the following basic code:

hist=skimage.exposure.histogram(img)
plt.tight_layout()
plt.bar(hist[1], hist[0], align='edge')

However, the resulting histogram gets the top of it's most high bars chopped off, as if the size of the window wasn't big enough. Moreover, changing manually the window size doesn't do anything. Is there a command to promptly inform pyplot to not do that? Thanks in advance!
Tried plotting a full histogram, ended up plotting a flawed one

t9aqgxwy

t9aqgxwy1#

Never mind, i forgot to run some upper cell of code, resulting in the image being converted in black and white over and over again, creating a far too big contrast. Just merging the cells to reset the image at it's original state at each run solved it.

相关问题