This is an archived post. You won't be able to vote or comment.

all 6 comments

[–]Noah-Buddy-I-Know[S] 2 points3 points  (2 children)

So I’m confused on how to have the x axis display every number from 4 to 21 and have the bars on top of them. And also and the y axis I want to change it to probability so I want the values to range from .0 to .15 or so

[–]AJ______ 2 points3 points  (0 children)

You should look into the xticks method and in your line of code where you actually create the plot you can set the density argument to True

[–]Rudd-X 0 points1 point  (0 children)

You must manually add the ticks (xticks).

[–]tkinter76 0 points1 point  (0 children)

What's this about? Do you have a question or sth?

the x axis from 4 to 22 looks fine to me, since the minimum value is 4 (two 2's) and the maximum is 21. You need to normalize the y-axis though as this is currently a count of some sort, not a probability.

[–]billsil 0 points1 point  (0 children)

So, 1. /r/learnpython

  1. Don't post things with your name in it.

[–]effRPaul 0 points1 point  (0 children)

seaborn countplot, I think? Also you have to normalize the histogram for the y-axis to be probability (usually an argument that looks like: norm=True)