0

Is there a way to use qplot() with x-axis values as sequence of integer numbers? I have a data frame and at the moment I use

qplot(
  X,  Y,   data = my_data, 
   geom = c('point'),
  xlab = 'x', xlim = c(-7,4),
  ylab = 'y',
    show.legend = FALSE
) + 
  facet_wrap(~ ID) + 
  theme(
    strip.background = element_blank(),
    strip.text.x = element_blank()
  )

But the resulting figure has x-axis marked from -7.5 to 2.5 with increment of 2.5. However, I want the plot to show x-axis from -7 to 4 incremented by 1.

Thanks

Here is the dataset Thanks for the comments. Here is the data

 > my_data
    ID  X        Y
1  603 -2 8.779019
2  603 -1 8.007748
3  603  0 7.415140
4  603  1 5.128722
5  603  2 4.953663
6  604 -3 7.864570
7  604 -2 7.147676
8  604 -1 5.791691
9  604  0 5.337060
10 604  1 5.084219

dhunfini
  • 5
  • 2
  • 1
    Need data that illustrates the issue. – IRTFM Feb 21 '19 at 00:24
  • Can you add a reproducible example? For example simulated data or a dput() output? – Nakx Feb 21 '19 at 00:38
  • Could you make your problem reproducible by sharing a sample of your data so others can help (please do not use `str()`, `head()` or screenshot)? You can use the [`reprex`](https://reprex.tidyverse.org/articles/articles/magic-reprex.html) and [`datapasta`](https://cran.r-project.org/web/packages/datapasta/vignettes/how-to-datapasta.html) packages to assist you with that. See also [Help me Help you](https://speakerdeck.com/jennybc/reprex-help-me-help-you?slide=5) & [How to make a great R reproducible example?](https://stackoverflow.com/q/5963269) – Tung Feb 21 '19 at 03:28

0 Answers0