0

Below is the screenshot from my dataset. enter image description here

I am plotting, length of the text ( it varies from 1 to 1000) along the x axis , and sum(useful), sum(funny) and sum(cool), along the y axis.

I am using below command to plot:

df.plot(x="length(text)", y=["sum(useful)", "sum(funny)", "sum(cool)"], kind="bar",figsize=None)

Below is the screenshot from my plot: enter image description here

Now, I want to make my x axis, in intervals, rather than continuous values in graph, to make it more visible. How to achieve this in matplotlib ?

DavidG
  • 24,279
  • 14
  • 89
  • 82
skoundin
  • 192
  • 1
  • 6
  • 19
  • have a look on https://stackoverflow.com/questions/44813601/how-to-set-x-axis-values-in-matplotlib-python – py-D Apr 19 '18 at 15:06
  • In the future, it's also more useful to post your data in a code section using `df.head().to_clipboard()` and I wouldn't blur out parts of the figure. That's probably useful in seeing what the problem is, in this case what DavidG pointed out – ALollz Apr 19 '18 at 15:09
  • @DavidG:Values for the length(text) are integers. Thats what, I am plotting in X axis. Since they are ranging from 1 to 1000, it makes x axis, blurred. Which is the reason I wanted to take intervals along X axis. – skoundin Apr 19 '18 at 15:14
  • @skoundin Actually, you're right. I've removed the duplicate vote. – DavidG Apr 19 '18 at 15:20

0 Answers0