Hello,
What command I can use in ggplot2 to show all number in the X axis?
And how can I change the axis title position?
I also want to put labels in each column
I am using this command bellow and the packages ggplot2 and hrbrthemes
plot(parametros2$p2, geom = "histogram")
ggplot(parametros2, aes(x = p2)) + geom_histogram(breaks=seq(0, 3, by = 0.08), pad = T,
ylim = c(0,50), by = 5) +
theme_ipsum_ps() +
xlab("p2")+
ylab("Frequência")
To help us help you, could you please prepare a reproducible example (reprex) illustrating your issue? Please have a look at this guide, to see how to create one:
The only way I know how to do something like this is to do something like generate the plot first, then add a new x-scale using information taken from the pre-built but not displayed plot.
library(tidyverse)
set.seed(123)
n <- 100
df <- data.frame(x = runif(n, 0, 2)^2)
ggp <- ggplot(df, aes(x = x)) +
geom_histogram(bins = 17, center = 0, color = "black")
ggp