Quantcast
Channel: Increase number of axis ticks - Stack Overflow
Browsing latest articles
Browse All 7 View Live

Answer by bmc for Increase number of axis ticks

Additionally, ggplot(dat, aes(x,y)) + geom_point() + scale_x_continuous(breaks = seq(min(dat$x), max(dat$x), by = 0.05)) Works for binned or discrete scaled x-axis data (I.e., rounding not necessary).

View Article


Answer by slhck for Increase number of axis ticks

Based on Daniel Krizian's comment, you can also use the pretty_breaks function from the scales library, which is imported automatically: ggplot(dat, aes(x,y)) + geom_point() + scale_x_continuous(breaks...

View Article


Answer by crowding for Increase number of axis ticks

You can supply a function argument to scale, and ggplot will use that function to calculate the tick locations. library(ggplot2) dat <- data.frame(x = rnorm(100), y = rnorm(100)) number_ticks <-...

View Article

Image may be NSFW.
Clik here to view.

Answer by Chase for Increase number of axis ticks

You can override ggplots default scales by modifying scale_x_continuous and/or scale_y_continuous. For example: library(ggplot2) dat <- data.frame(x = rnorm(100), y = rnorm(100)) ggplot(dat,...

View Article

Increase number of axis ticks

I'm generating plots for some data, but the number of ticks is too small, I need more precision on the reading. Is there some way to increase the number of axis ticks in ggplot2? I know I can tell...

View Article


Image may be NSFW.
Clik here to view.

Answer by Tung for Increase number of axis ticks

The upcoming version v3.3.0 of ggplot2 will have an option n.breaks to automatically generate breaks for scale_x_continuous and scale_y_continuous devtools::install_github("tidyverse/ggplot2")...

View Article

Answer by Saurav Das for Increase number of axis ticks

A reply to this question and How set labels on the X and Y axises by equal intervals in R ggplot?mtcars %>% ggplot(aes(mpg, disp)) + geom_point() + geom_smooth() + scale_y_continuous(limits = c(0,...

View Article
Browsing latest articles
Browse All 7 View Live