If you’d like to format the axis labels to show exponents, you can use functions from the scales package: ggplot(df, aes(x=x, y=y)) +īreaks= trans_breaks(' log10', function(x) 10^x), Use coord_trans() ggplot(df, aes(x=x, y=y)) + Use scale_y_continuous() or scale_x_continuous() ggplot(df, aes(x=x, y=y)) +Ģ. You can use one of the following two methods to do so using only ggplot2:ġ. Often you may want to convert the x-axis or y-axis scale of a ggplot2 plot into a log scale.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |