Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201945

How do I superimpose a frequency polygon on top of a histogram in R using lines?

$
0
0

I'm a beginner at R and RStudio and I'm trying to make a frequency polygon on top of a histogram using the "cars" dataset.

hist(speed)
lines(speed, lwd=2, col = "royalblue")

This is the output I'm getting.

What I need is the points coming properly on top of the histogram. I have seen this one using plots but I can't get to use it in my code.


Viewing all articles
Browse latest Browse all 201945

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>