NetLogo / NetLogo/SimpleR-Extension
Incompatible with `ggplot2` or is it a plot device issue I don't understand?
Nobody has claimed this yet.
- Dominant language
- Scala
- Stars
- 4
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
The following model code
extensions [ sr ]
to setup
clear-all
sr:setup
sr:run "library(ggplot2)"
end
to ggplot
sr:set-plot-device
(sr:run
"df <- data.frame(x = rnorm(30), y = rnorm(30))"
"ggplot(df) + "
" geom_point(aes(x = x, y = y))"
)
sr:run "ggsave('~/Downloads/test.png')"
user-message "Plot will close when you close this dialog."
sr:run "dev.off()"
end
fails to show a plot in the on-screen plot window, although the expected ggplot shows up as the requested PNG file:
The user-message is my way to cleanly close plot devices - so don't worry about that part.
Is this some subtlety or R plotting, specifically in relation to ggplot that I don't understand? Or is it a problem with the Simple R extension? How do I do I to get an on-screen ggplot to show up?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the model using sr:set-plot-device, sr:run, ggplot, ggsave, and dev.off(), comparing the on-screen plot window with the generated PNG. Investigate whether the Simple R extension supports displaying the ggplot device and define done as an on-screen ggplot appearing while the existing PNG behavior remains correct.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- data-visualization
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100