Dear all,
I can create this Histogram with the code below:
ggplot() +
geom_histogram(data = fulldfUp, aes(x = Value, fill = Pops), colour = "#000000", alpha = .5, bins = 200) +
scale_x_continuous("5K-Window Fst",
breaks = c(.2, .4, .6, .8, 1),
labels = c("0.2", "0.4", "0.6", "0.8", "1.0"),
limits = c(0, 1),
expand = c(0.005, 0.005)) +
scale_y_continuous("Frequency",
#breaks = c(10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000, 10000000000, 100000000000),
#labels = c("0.01K", "0.1K", "1K", "10K", "100K", "1M", "10M", "100M", "1B", "10B", "100B"),
#limits = c(0, 1),
expand = c(0, 0)) +
scale_fill_manual(values = c("#4daf4a", "#377eb8", "#e41a1c")) +
theme(panel.background = element_rect(fill = "#ffffff"),
panel.border = element_blank(),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
legend.title = element_blank(),
legend.text = element_text(size = 12, color = "#000000"),
legend.position = "top",
legend.background = element_rect(fill = FALSE),
legend.key = element_blank(),
axis.title.x = element_text(size = 16, face = "bold", color = "#000000", margin = margin(t = 20, r = 0, b = 0, l = 0)),
axis.title.y = element_text(size = 16, face = "bold", color = "#000000", margin = margin(t = 0, r = 20, b = 0, l = 0)),
axis.text = element_text(size = 11, color = "#000000", face = "bold"),
axis.ticks = element_line(size = .3, color = "#000000"),
axis.line = element_line(colour = "#000000", size = .3, color = "#000000")) +
guides(fill = guide_legend(title = "Comparisons", title.theme = element_text(size = 15, face = "bold"),
label.theme = element_text(size = 14)))
For I have values in the y-axis going to up 10K. However, when I try to log transform this scale using trans = "log1p"
I get super high values... even though the log1p(10000) should be something like 9.21.
ggplot() +
geom_histogram(data = fulldfUp, aes(x = Value, fill = Pops), colour = "#000000", alpha = .5, bins = 200) +
scale_x_continuous("5K-Window Fst",
breaks = c(.2, .4, .6, .8, 1),
labels = c("0.2", "0.4", "0.6", "0.8", "1.0"),
limits = c(0, 1),
expand = c(0.005, 0.005)) +
scale_y_continuous("Frequency (log1p)",
trans = "log1p",
breaks = c(10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000, 10000000000, 100000000000),
labels = c("0.01K", "0.1K", "1K", "10K", "100K", "1M", "10M", "100M", "1B", "10B", "100B"),
#limits = c(0, 1),
expand = c(0, 0)) +
scale_fill_manual(values = c("#4daf4a", "#377eb8", "#e41a1c")) +
theme(panel.background = element_rect(fill = "#ffffff"),
panel.border = element_blank(),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
legend.title = element_blank(),
legend.text = element_text(size = 12, color = "#000000"),
legend.position = "top",
legend.background = element_rect(fill = FALSE),
legend.key = element_blank(),
axis.title.x = element_text(size = 16, face = "bold", color = "#000000", margin = margin(t = 20, r = 0, b = 0, l = 0)),
axis.title.y = element_text(size = 16, face = "bold", color = "#000000", margin = margin(t = 0, r = 20, b = 0, l = 0)),
axis.text = element_text(size = 11, color = "#000000", face = "bold"),
axis.ticks = element_line(size = .3, color = "#000000"),
axis.line = element_line(colour = "#000000", size = .3, color = "#000000")) +
guides(fill = guide_legend(title = "Comparisons", title.theme = element_text(size = 15, face = "bold"),
label.theme = element_text(size = 14)))
Would anyone be so kind as to let me know what might be going on here?
Many thanks in advance, George.