How can a user interactively change one aspect (e.g., orientation or length of a line) on a 2D plot?
This static ggplot2 chart can quickly be made interactive by simply placing it inside the ggplotly function (after installing and loading plotly). The static plot has now been brought to life. Users can now zoom, hover, pan and export the plot, and more.
Interactive visualizations are produced using data visualization tools which allow for direct modification of elements on a graphical plot. The idea is to create charts and graphs which the end-user will be able to personally explore and adjust and not just read passively.
latticist and playwith are offering the interactive functionality for R's statistical plots.
For modifying specific details you can save the graph in SVG format and edit it in inkscape.
The rpanel package has worked for me.
library(rpanel)
lvm.draw <- function(panel) {
x=0:20
plot(x, panel$int + (panel$slo*x), ylim=panel$data, ylab="y", main="Adam's Super Duper Interactive Graph", typ="l", lwd=3, col="red")
grid()
panel
}
ylimdat<-c(-50,50)
panel <- rp.control(title = "Adam's Panel", data=ylimdat, slo=0.5, int=1.0, size=c(300, 160))
rp.slider(panel, var=slo, from=-5, to=5, action=lvm.draw, title="Slope", pos=c(5, 5, 290, 70), showvalue=TRUE)
rp.slider(panel, var=int, from=-50, to=50, action=lvm.draw, title="Intercept", pos=c(5, 70, 290, 90), showvalue=TRUE)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With