Plot in Rstudio not showing up

Rstudio is not showing up the plot and this happened recently all of a sudden . Am using Ubuntu 20.04 LTS . Below are the output from sessioninfo and version . any help will be appreciated .

sessionInfo()
R version 4.0.2 (2020-06-22)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04 LTS

Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.9.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.9.0

locale:
[1] LC_CTYPE=en_IN.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_IN.UTF-8 LC_COLLATE=en_IN.UTF-8
[5] LC_MONETARY=en_IN.UTF-8 LC_MESSAGES=en_IN.UTF-8
[7] LC_PAPER=en_IN.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_IN.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods
[7] base

other attached packages:
[1] scales_1.1.1 ggplot2_3.3.2

loaded via a namespace (and not attached):
[1] rstudioapi_0.11 magrittr_1.5 splines_4.0.2
[4] tidyselect_1.1.0 munsell_0.5.0 lattice_0.20-41
[7] colorspace_1.4-1 R6_2.4.1 rlang_0.4.7
[10] dplyr_1.0.0 tools_4.0.2 grid_4.0.2
[13] nlme_3.1-147 gtable_0.3.0 mgcv_1.8-31
[16] xfun_0.15 tinytex_0.24 withr_2.2.0
[19] ellipsis_0.3.1 digest_0.6.25 tibble_3.0.3
[22] lifecycle_0.2.0 crayon_1.3.4 Matrix_1.2-18
[25] purrr_0.3.4 farver_2.0.3 vctrs_0.3.2
[28] glue_1.4.1 labeling_0.3 compiler_4.0.2
[31] pillar_1.4.6 generics_0.0.2 pkgconfig_2.0.3

RStudio.Version()
$citation
To cite RStudio in publications use:

RStudio Team (2020). RStudio: Integrated Development
Environment for R. RStudio, PBC, Boston, MA URL
http://www.rstudio.com/.

A BibTeX entry for LaTeX users is

@Manual{,
title = {RStudio: Integrated Development Environment for R},
author = {{RStudio Team}},
organization = {RStudio, PBC},
address = {Boston, MA},
year = {2020},
url = {http://www.rstudio.com/},
}

$mode
[1] "desktop"

$version
[1] ‘1.3.1056’

$release_name
[1] "Water Lily"

You might have a graphic device open. You can check this with dev.cur() which (if your current device is the RStudio plotting window) should be:

> dev.cur()
RStudioGD 
        2

If that's not the case, then at some point, you must have opened a new connection (e.g. with jpeg() or png()). Any plots you try and make will be being directed to that file. You can close the current device with dev.off(). Note that you can have a chain of devices open, so you might have to repeat this until you get down to 2.
You can also close the current device when it is RStudioGD = 2, which will clear your plot history and return the null device

> dev.off()
null device 
          1 

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.