Y axis is showing log values in ggplot

Hi guys,

Below is my code :

ggplot(daily_activity_new , aes(x = day_of_the_week, y = calories)) + geom_col(fill='dark green')
labs(x = 'Day of week', y = 'Calories burned', title = 'Total calories burned in a week')

on the output, the y-axis values show 3e+05, etc instead of numeric values. Please help as to why this is happening and how can I change it

image

Try adding + and then

scale_y_continuous(labels = comma)

By the way, your y axis is in scientific notation, not logarithmic values.

3 Likes

Note that the labels = comma refers to the scales package. Just to avoid confusion, better type labels = scales::comma.

1 Like

Hey, thanks for the info on it being scientific notation.. This worked!! Really appreciate your help.

This topic was automatically closed 7 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.