Andrey N. says:
OK, here is my take on R plots:
SageMathCell now defaults to producing SVG plots in R and displays all automatic plots that it can (BMP, JPEG, PNG, SVG). Users are free to start new plotting devices, pass any options to them, and create multiple plots in the same cell. Plots with custom names or harder formats like PDF will be provided as links only. With SageMathCloud approach you cannot change format and changing options is done not from R code using R commands, you are also limited to a single plot displayed automatically. The code above does not show any plots at all in the cloud.
What had to be done:
- R interface is recreated after each forking (via "r=R()" command) to make sure that a new working directory is picked up. Would be great if interfaces followed changing directories of the main process, but I don't know how feasible that is.
- There is site configuration file installed into R in Sage setting two options including default graphing device SVG. In Sage R interface is prohibited from picking up configuration from anywhere and device is forced in addition - I had to change it and I think it makes a lot of sense to change it for Sage itself.
- After each R cell is executed, all graphic devices are now closed and plots with default R names are shown automatically if possible. (Everything else gets a link to.) R plots produced not in "R cells" will be always linked to only, without auto display - this is similar to cloud showing plots only if r-decorator was used.