0

I am fairly new to all of this, and I'm currently working with some datasets for fun/practice. I took a course on R, and it explained the basics and dove a little deeper into ggplot2, but I am at a point where I'm not quite sure what to do.

The dataset is commodity prices from 1960-2021. I am trying to visualize the cost of crude oil over that time, and currently I have a decent chart, but I am wanting to change the intervals on the tick marks so that it is more readable. I will also take any advice you guys have on how to make it look even better!

I've attached my current chart here. (https://i.stack.imgur.com/o9Z63.png)

This is my current code for the chart:

graph + 
  geom_point(size=2, alpha=.7) + geom_line() +
  ggtitle("Oil Prices from 1960 to 2021") +
  xlab("Years") + ylab("Oil Prices") +
  theme(axis.title.x=element_text(color="Black", size=20),
        axis.title.y=element_text(color="Black", size=20),
        plot.title=element_text(color="Black", size=40)) 

I have tried to google the function, and have been given a bunch of answers, but I'm still not sure which one fits for what I'm trying to do. Ideally I would like the x axis (Years) to at a minimum show every 5-10 years, but the more descriptive the better. Also the Y axis (Prices) is very hard to read and tell what the actual price is.

I appreciate any and all help with this. I'm just working on it for the fun of it and to get some practice in, but figured I would use this resource and try to see what we can come up with.

Thanks!

0 Answers0