RStudio Plots Pane Stays Blank: A Diagnostic Guide to Missing Plot Output
When plot() runs without error but RStudio's Plots pane stays blank, the output is usually going to the wrong graphics device. Here's how to diagnose and fix it, step by step.
19 Jul 2026, 21:56 UTC

You run plot(1:10) or a ggplot2 command, the code executes without error, and the Plots pane shows nothing — or a grey "No plots" placeholder. The code is usually fine. The problem is almost always that R's output is going to a graphics device other than the one RStudio displays, or that RStudio's own device has been closed or corrupted. This guide walks through the likely causes, how to confirm each one, and the fix for each finding.
How R decides where a plot goes
R renders plots to a graphics device. In an interactive RStudio session, the default device is RStudioGD, which draws into the Plots pane. Functions like pdf(), png(), and dev.off() change or close the active device. If your code (or a package you sourced) opened a file device or closed every device without reopening one, subsequent plots either go to a file on disk or vanish silently.
Cause and diagnostic table
| Likely cause | How to confirm | Fix |
|---|---|---|
| Active device is a file device (pdf/png) or null device | dev.cur() returns pdf, png, or null device | Close the stray device and reset to RStudioGD |
RStudioGD was closed by dev.off() or graphics.off() | dev.list() does not contain RStudioGD | Restart the R session and re-run the plot |
| Corrupted RStudio desktop state | Plots fail in every project, even after session restart | Rename the desktop state folder and relaunch |
| RStudio / R version mismatch | Problem began right after upgrading R or RStudio | Update both to compatible current versions |
| Missing fonts or no display server (Linux) | Plots fail with font warnings, or session is headless | Install font packages; use Xvfb on headless hosts |
Ordered checks
Work through these in order — each is cheap, and the early ones catch the majority of cases.
- Inspect your code for device calls. Look for
dev.off(),graphics.off(),pdf(),png(), orsvg()near the end of the script. A common pattern is a script that saves a plot to PDF and never switches back, so every plot after it goes to the file (or nowhere, once the device is closed). - Check the active device. In the RStudio Console, run
dev.cur(). In a healthy session it returns something likeRStudioGDwith device number 2. If it returnsnull deviceor a file device, that is your finding. - List all open devices. Run
dev.list(). You want to seeRStudioGDin the output. If it is absent, RStudio's plotting surface has been closed. - Restart the R session. Use Session > Restart R. This reopens RStudioGD and clears stray devices. Re-run a minimal plot:
plot(1:10). - Rule out corrupted preferences. If the pane is still blank in every project, close RStudio, rename the desktop state folder (on Linux/macOS typically
~/.local/share/rstudioor the older~/.rstudio-desktop; on Windows,%localappdata%\RStudio), and relaunch. RStudio rebuilds it with defaults. Note this resets window layout, themes, and keyboard shortcuts, so rename rather than delete if you want a way back. - Check versions. Confirm RStudio supports your R version, especially if the breakage coincided with an R upgrade. Updating RStudio to the current release resolves most backend incompatibilities.
- On Linux, verify graphics infrastructure. Make sure common font packages (e.g., DejaVu fonts) are installed and that an X display is available. On a headless server, R cannot open a screen device at all — use a virtual framebuffer such as Xvfb, or write plots to files with
png()/pdf()instead of expecting the pane.
Fixes tied to findings
Stray or null device: close everything and let RStudio reopen its device:
graphics.off() # close all devices
dev.cur() # check what is active now
plot(1:10) # forces RStudioGD to open if needed
Run these in the RStudio Console; no special permissions are required. The expected result is that dev.cur() reports RStudioGD and a scatterplot appears in the Plots pane. Avoid calling dev.off() in interactive scripts unless you immediately open a replacement device — that is the single most common way this problem starts.
Corrupted state: after renaming the state folder and relaunching, re-run plot(1:10) before restoring any custom settings, so you know the clean state works.
R Markdown caveat: if plots are missing only when knitting, the cause is different — chunk options such as fig.show='hide' or results='hide' suppress figures. Knit a minimal document with one plain plot(1:10) chunk to isolate this.
Verifying the fix
plot(1:10)produces a visible scatterplot in the Plots pane.dev.cur()returns the RStudioGD device (usually device 2 in a fresh session).dev.list()includesRStudioGD.- If you knit R Markdown documents, a minimal test document renders its figure inline.
When to escalate
Escalate to RStudio support or the community forum if plots remain missing after: a session restart, a clean state folder, a reinstall of R and RStudio, and confirmation that R itself can plot outside RStudio (for example, running plot(1:10) in the plain R GUI or terminal R with an X11 device). Include your R version (R.version.string), RStudio version, operating system, and the output of sessionInfo() and dev.list() — these let support distinguish a device-layer bug from an environment problem quickly.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.