ggplot: axes lines, values, and labels not plotting

Viewed 148

I recently noticed that when I try plotting anything in ggplot2, both the x and y axes data (values, labels, lines, everything) are missing. I have tried to manually specify and enter the missing data using scale and theme commands, but ggplot still won't display the axes.

For example, the following simple code produces this plot on my computer:

ggplot(mpg, aes(x=class,y=hwy)) + geom_boxplot()

I have been using R and ggplot regularly for a few years and never encountered this problem until recently, but I don't know what computer/R/ggplot settings could have changed.

Interestingly, when I use base plotting functions there are no issues (both axes plot normally), so it seems like it's only an issue in ggplot.

E.g., the base code below produces this plot on my computer:

boxplot(mpg$hwy ~ mpg$class)

I have tried uninstalling and reinstalling ggplot multiple times to no avail.

Any advice for how to fix ggplot? Thanks!

0 Answers
Related