[R] how to change the y-axis to logarithmic in a barplot ggplot

CALUM POLWART po|c1410 @end|ng |rom gm@||@com
Mon Jul 17 00:22:22 CEST 2023


Try adding

scale_y_log10()

This is a general R help list. It's not a ggplot list and you are likely to
be chased off to ggplot's package maintainers nominated support pages.

But really a Google search should surely have found this?



On Sun, 16 Jul 2023, 22:51 Maria Lathouri via R-help, <r-help using r-project.org>
wrote:

> Dear all,
>
> ggplot(fc, aes(x = Temp, y = mean, fill = Glass)) +
> geom_bar(stat = "identity", position = "dodge", aes(y=log(mean)))
> + theme_bw() + theme(panel.grid.major = element_blank(), panel.grid.minor
> = element_blank()) + theme(legend.position = c(0.45, 0.85), legend.title =
> element_blank())
> + scale_fill_brewer(palette = "Dark2") + scale_color_brewer(palette =
> "Dark2") +
>
scale_y_log10()

	[[alternative HTML version deleted]]



More information about the R-help mailing list