(function() { load("Plot") # create the x application X = XApplication("plot", "plot.defaults") # create a plotting widget using the X application # as the parent plot.w <- Widget("hist","H1D", X@widget, realize=T) XRealize(X) # realize the widgets # and start the event handling Hist(rnorm(100), plot.w) })()