0

I am plotting a graph with custom ticks. I am missing data at various ticks but having the ticks is vital to my information. The graph is excluding said ticks. How should I approach this?

For example, I don't have any data at 9 and it is not producing the tick at all. I understand it shouldn't label it with "9" but it should still produce it as a tick.

gplot(data = data, mapping = aes(x = V5, y= V3, color = V4))+
  geom_point(alpha = 0.35) +
  geom_jitter(alpha = 0.35) +
  labs(title = "title", y = "y-label", x = "x-label")+
  theme(legend.position = "none") +
  scale_x_discrete(breaks = 1:27,
                   labels = c("1", "", "3", "", "", "6","", "", "9",
                              "", "", "12"))
Z.Lin
  • 28,055
  • 6
  • 54
  • 94
serious
  • 147
  • 7
  • 2
    please consider to provide an example data – Ulises Rosas-Puchuri Feb 16 '19 at 07:39
  • 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 16 '19 at 21:45
  • I solved it by adding values equal to 0 at the ticks that were not showing and modifying the y axis to exclude them. – serious Feb 20 '19 at 19:48

0 Answers0