Hi,
My name is Maggs. I'm trying to plot a simple histogram using ggplot. It plots fine when I don't transform the x-axis to log-scale. However, when I transform the x-axis to log scale it plots an empty grid. I'm not sure how to solve it. Any help would be greatly appreciated! Below is my code, the plot of the empty grid, and the histogram plotted prior to transforming the x-axis.
Thanks!
l <- pachon_del %>%
ggplot(aes(x=V1)) +
geom_histogram(binwidth=1000, fill="aquamarine2", color="aquamarine2") +
#scale_y_log10() +
ggtitle("Distribution of Pachón Deletion Lengths") +
ylab("Count") +
xlab("Length deletions") +
scale_x_continuous(limits=c(50,1000000), trans="log10") + #set x-axis limits
scale_y_continuous(trans="log10") + #set y-axis
theme(axis.text = element_text(size = 12)) + #size of axis text
theme(plot.title = element_text(hjust = 0.5)) + #center the title of the plot
theme(panel.background = element_rect(fill = 'white', color = 'black'), #back background white and outline of plot black
panel.grid.major = element_line(color = 'black', linetype = 'dotted')) #make grid dotted lines
l
dev.off()