How can I increase the number of axis ticks in R

0 votes
May 30, 2018 in Data Analytics by shams
• 3,670 points
6,739 views

1 answer to this question.

0 votes

You can try to 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, aes(x,y)) + geom_point()

And overriding the scales can be done as follows:

ggplot(dat, aes(x,y)) +
  geom_point() +
  scale_x_continuous(breaks = round(seq(min(dat$x), max(dat$x), by = 0.5),1)) +
  scale_y_continuous(breaks = round(seq(min(dat$y), max(dat$y), by = 0.5),1))

answered May 30, 2018 by zombie
• 3,790 points

Related Questions In Data Analytics

0 votes
1 answer

How can I control the size of points in an R scatterplot?

plot(variable, type='o' , pch=5, cex=.3) The pch argument ...READ MORE

answered May 3, 2018 in Data Analytics by shams
• 3,670 points
1,274 views
+1 vote
2 answers
0 votes
1 answer

How can I import a file in R without giving the destination/file path to the specified file?

You can use the window explorer to ...READ MORE

answered Aug 28, 2018 in Data Analytics by Abhi
• 3,720 points

edited Aug 28, 2018 by Vardhan 2,990 views
0 votes
1 answer

How can I list all the data sets available in all R packages?

You can use the below line of ...READ MORE

answered Sep 7, 2018 in Data Analytics by zombie
• 3,790 points
1,010 views
0 votes
1 answer

How can I find number of columns in a dataframe

To know the number of columns in ...READ MORE

answered Oct 12, 2018 in Data Analytics by Abhi
• 3,720 points
602 views
0 votes
1 answer

Shiny r ,I'm doing a dashboard and I can not replace in the table below the name of the column by choosing the selectinput.

Hi, When you want to change any input ...READ MORE

answered Aug 19, 2019 in Data Analytics by anonymous
• 33,030 points
1,151 views
0 votes
1 answer

How can I make a list of lists in R?

Lists of lists are simple to create. list1 ...READ MORE

answered Jun 24, 2022 in Data Analytics by Sohail
• 3,040 points
612 views
0 votes
0 answers

How can I avoid the transformation into an atomic vector in a matrix (r programming)

I'm scrambling to come up with a ...READ MORE

Jul 5, 2022 in Data Analytics by avinash
• 1,840 points
442 views
0 votes
1 answer

How can I rotate axis labels in R ?

library(ggplot2) p <- data.frame(Day=c("2011-04-11", "2014-05-24","2004-01-12","2014-06-20","2010-08-07","2014-05-28"), Impressions=c(24010,15959,16107,21792,24933,21634),Clicks=c(211,106,248,196,160,241)) p       ...READ MORE

answered May 18, 2018 in Data Analytics by zombie
• 3,790 points
1,886 views
0 votes
1 answer

How can I get type of all variables in R?

It is a easy task and one ...READ MORE

answered May 22, 2018 in Data Analytics by zombie
• 3,790 points
1,116 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP