6

I have a plot that looks like this, and I am trying to make the x axis labels more readable:

enter image description here

This is what I tried and the error I got:

enter image description here

0

1 Answer 1

19

The problem is that you are setting plt from the call to hist(), which is not what you want. It is common to import matplotlib as plt, assuming that is what was intended here:

import matplotlib.pyplot as plt data = [1, 2, 3, 4] p = plt.hist(data) plt.xticks(rotation='vertical') plt.show() 

enter image description here

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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.