tweag / HaskellR

The full power of R in Haskell.
https://tweag.github.io/HaskellR
Other
583 stars 47 forks source link

Plotting under Windows may require dev.flush #417

Open djsamperi opened 1 year ago

djsamperi commented 1 year ago

Describe the bug R only renders part of a plot, requiring the addition of dev.flush() after the plot command in a quasiquote. A related issue is that the module Language.R.Event is not part of the Windows build, so the refresh function is not available.

To Reproduce [r| plot(0:200/20, sin(0:200/20), xlab='t',ylab='signal',type='l',col='blue', main="Sine blue, Cosine red") lines(0:200/20, cos(0:200/20) ,type='l',col='red') |]

This will display only the sine wave. To get both the sine and cosine dev.flush() must be inserted after plot().

Expected behavior R should render the entire plot generated by the plot command.

Environment

Additional context If refresh from Language.R.Event could be provided for Windows, this might eliminate the need to insert dev.flush() after every plot().

facundominguez commented 1 year ago

refresh is unsupported in windows since it was introduced. Here's the PR adding windows support. Note f6ab979 in particular. It would be worth checking again if the same difficulties still stand to add the support.