melmo
melmo

Reputation: 795

R ggplot not displaying

I know this question has been asked a number of times, but the solutions for those answers did not work for me. I am using R version 4.0.0 in R studio. I have been able to use ggplot before I updated, so I am not sure if that is related to the issue or not.

I am trying with one of the ggplot examples:

library("ggplot2")
p1<- ggplot(mpg, aes(x = displ, y = hwy)) +
     geom_point()
show(p1)

I have also tried

print(p1)

Neither have shown the plot nor thrown an error. I am putting this directly into the console, so from what I've read, the print/show shouldn't be necessary, but it still does not show. P1 is created in my Global Environment and is a List of 9. Does anyone have any ideas??? Thanks!

Upvotes: 1

Views: 1447

Answers (1)

py_b
py_b

Reputation: 189

Maybe you have redirected the output by opening a pdf() or jpeg() device that you have forgotten to close ?

Upvotes: 4

Related Questions