Ciro Mertens
Ciro Mertens

Reputation: 113

How to change the y axis of a histogram so it's a density function in r?

How is it possible that I can change a normal histogram in a way that the x-axis indicates not absolute numbers but the relative numbers, the density?

This is what my histogram looks like now:

hist(df$rent, xlim = c(0, 36), ylim = c(0, 300), breaks = 30)

Upvotes: 0

Views: 1181

Answers (1)

Ciro Mertens
Ciro Mertens

Reputation: 113

To add the argument

freq = FALSE

is the solution

Upvotes: 1

Related Questions