Displaying 2 results from an estimated 2 matches for "log10_minor_break".
2025 Jan 21
1
ggplot with major and MINOR tick marks on a log scale
...lpha = 0.7) +
geom_line(linewidth = 1.5, alpha = 0.3) +
theme(axis.text.x = element_text(angle = -15, hjust = 0)) +
scale_y_log10() +
guides(y = guide_axis(minor.ticks = TRUE))
#--- And the other plot
# function in this StackOverflow post
# https://stackoverflow.com/a/33179099/8245406
log10_minor_break = function (...){
function(x) {
minx = floor(min(log10(x), na.rm=TRUE)) - 1
maxx = ceiling(max(log10(x), na.rm=TRUE)) + 1
n_major = maxx - minx + 1
major_breaks = seq(minx, maxx, by = 1)
minor_breaks =
rep(log10(seq(1, 9, by=1)), times = n_maj...
2025 Jan 21
3
ggplot with major and MINOR tick marks on a log scale
I have used ggplot to create a graph on which the y-axis is on the log scale. (see data and code, below.) I would like to add minor tick marks, which will also be on the log scale. The data and code are below. I hope somone can tell me how I can modify the ggplot code so it produces minor tick marks on a log scale.
Thank you,
John
?
PopByDayByAQIminus <- dget(
structure(list(Day =