Y-axis in geom_bar

IMG-20240318-WA0008

The "Profundidad " data reaches up to 7280 meters. I don't know why it puts those values ​​on my y axis.
The code I used is the following: ggplot(foramtotal, aes(assemblage, depth)) +geom_bar("identity", fill="blue") + ggtitle ("Localización") + ylab("Profundidad (m)") + xlab ("Estado") theme_classic() .
The assemblage variable is chr and depth is numeric.
What can I do to make my y-axis correctly follow the values ​​between 0 and 7280 meters?

Hi @Namim, try to put a reproducible example in this way:

reprex

# Maybe if you divide the y axis between 1000
ggplot(foramtotal, aes(assemblage, depth/1000)) +geom_bar("identity", fill="blue") + ggtitle ("Localización") + ylab("Profundidad (m)") + xlab ("Estado") theme_classic()
1 Like

Please post the output of

dput(head(foramtotal))

It works :eye::lips::eye:
Thank you so much

When the values I want to show are very large and I don;'t want to use scientific notation, I often use

scale_y_continuous(labels = scales::label_number(scale_cut = scales::cut_short_scale()))

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.