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

Maria Lathouri m|@thour| @end|ng |rom y@hoo@gr
Mon Jul 17 21:29:01 CEST 2023


Dear Bert, 

Thank you very much for the tip. The reason that I took the initiative to write here is because I receive here as well questions about ggplot. Next time I will use the ggplot help. 

Maria






Στις Δευτέρα 17 Ιουλίου 2023 στις 12:20:25 π.μ. GMT+1, ο χρήστης Bert Gunter <bgunter.4567 using gmail.com> έγραψε: 





Maria,

ggplot is part of the Posit -- formerly RStudio -- assortment of contributed packages. They have their own support site here , which you *may* find useful for such questions, also. Though ggplot queries *are* frequently posted and answered on R-Help.

Cheers,
Bert

On Sun, Jul 16, 2023 at 3:58 PM Maria Lathouri via R-help <r-help using r-project.org> wrote:
> I will find the ggplot help. 
> 
> But I have tried everything, including what you have suggested and nothing works.
> 
> Kind regards,
> Maria
> 
> 
> 
> 
> 
> 
> Στις Κυριακή 16 Ιουλίου 2023 στις 11:22:36 μ.μ. GMT+1, ο χρήστης CALUM POLWART <polc1410 using gmail.com> έγραψε: 
> 
> 
> 
> 
> 
> 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()
> 
> ______________________________________________
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
> 



More information about the R-help mailing list