0

I was wondering how I could easily add a smooth line which connect the dots of the same color in R. Can anyone help me?

enter image description here

  • 1
    You will be most likely to get your question answered if you follow the [helpful advice](https://stackoverflow.com/help/how-to-ask) about asking questions and create a [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example). – DaveArmstrong Apr 13 '22 at 15:08
  • Depends on the code you used but if you used `plot`() or `lines()` functions, then the argument `type="b"` will connect the dots. `="l"` will only draw lines, `="p"` will only draw dots). Btw, if you connect dots here, you don't get a smooth line – Yacine Hajji Apr 13 '22 at 15:10
  • Look at the manual page for `matplot()` (`?matplot`). It will do all of the groups in a single function call. Then use `legend()` to put a legend on the plot. – dcarlson Apr 13 '22 at 16:48
  • There are infinitely many "smooth" lines that can connect points. What type of smoothing are you looking for exactly? It's easier to help you if you include a simple [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input and desired output that can be used to test and verify possible solutions. How did you make this current version of the plot? – MrFlick Apr 13 '22 at 17:11

0 Answers0