using ggplot funtion

The best approach is to make a Reproducible Example. I will post a link to a tutorial but you can also search for that term or for the abbreviation Reprex and find a lot of advice. The key is to make a data set that is not larger than needed to show the problem.