Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot create two R plots using one chunk of code sent to console #6113

Open
dbcoffee opened this issue Jan 24, 2025 · 3 comments
Open

Cannot create two R plots using one chunk of code sent to console #6113

dbcoffee opened this issue Jan 24, 2025 · 3 comments
Labels
area: plots Issues related to Plots category. bug Something isn't working lang: r support

Comments

@dbcoffee
Copy link

System details:

Positron and OS details:

windows 11
Positron Version: 2025.02.0 (system setup) build 79
Code - OSS Version: 1.96.0
Commit: a268bc8
Date: 2025-01-21T02:49:15.664Z
32.2.6
128.0.6613.186
Electron: 20.18.1
ElectronBuildId: 12.8.374.38-electron.0
Chromium: Windows_NT x64 10.0.26100
Node.js: undefined
V8: undefined
OS: undefined

Interpreter details:

R 4.4.1

Describe the issue:

After executing the R code, only one plot can be displayed in the Plots panel, whenever using the base package or ggplot package.

Steps to reproduce the issue:

  1. Create a new R document ( or qmd file) .
  2. Generate two plots (using ggplot or base package)
  3. Use Ctrl+Enter to execute the code.
library(ggplot2)
x <- rnorm(100)
y <- rnorm(100)

ggplot(data = data.frame(x, y), aes(x = x, y = y)) +
  geom_point() +
  ggtitle("test1")

x <- rnorm(100, mean = 5)
y <- rnorm(100, mean = 5)
ggplot(data = data.frame(x, y), aes(x = x, y = y)) +
  geom_point() +
  ggtitle("test2")

Expected or desired behavior:

In the Plots panel, the two generated images should be displayed.

Were there any error messages in the UI, Output panel, or Developer Tools console?

NO.

@juliasilge
Copy link
Contributor

Can you say more about what you are seeing? When I execute this code, I generate two plots that I can click back and forth between in the "film strip", like this:

Image

@juliasilge juliasilge added the info needed Waiting on information label Jan 25, 2025
@dbcoffee
Copy link
Author

This is the situation with the plot output when I run this piece of code. When I run these two image generation codes separately, the images can be displayed in the Plots panel. However, after executing all the code at once, only one image can be displayed.

2025-01-25-14-26-52.mp4

@juliasilge
Copy link
Contributor

Ah, I understand now; thanks!

This looks very related to #3915 but I am not sure it is exactly the same, so let's keep this issue open to look into this case as well.

@juliasilge juliasilge added area: plots Issues related to Plots category. lang: r bug Something isn't working support and removed info needed Waiting on information labels Jan 27, 2025
@juliasilge juliasilge added this to the Release Candidate milestone Jan 27, 2025
@juliasilge juliasilge changed the title After executing the R code, only one plot can be displayed in the Plots panel. Cannot create two R plots using one chunk of code sent to console Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: plots Issues related to Plots category. bug Something isn't working lang: r support
Projects
None yet
Development

No branches or pull requests

2 participants