getActivePlot {iSPlot}R Documentation

Return the plotView object that corresponds to the active plot

Description

getActivePlot determines which plot is active based on which device is active and it returns the plotView object that corresponds to this plot. getPlotByDev gets the active plot by the device number. getPlotNumber gives the index in viewList of the active device. getPlotDev makes a vector of the device elements in viewList. So these four functions work together to return the plotView object that corresponds with the active plot.

Usage

getActivePlot()
getPlotByDev(curDev)
getPlotNumber(curDev)
getPlotDev(viewList)

Arguments

curDev the active device
viewList viewList in viewEnv

Details

getActivePlot calls getPlotByDev, getPlotByDev calls getPlotNumber, and getPlotNumber calls getPlotDev.

Value

getActivePlot returns the plotView object that corresponds with the active plot. getPlotByDev also returns the plotView object that corresponds with the active plot. getPlotNumber returns the index in viewList of the active device. getPlotDev returns a vector of all devices in viewList.

Author(s)

Elizabeth Whalen

See Also

updatePlots, createSPlotView, checkPoint

Examples

  if (interactive())
  {
    createControlWindow()
    # should load data through Open Data or Open File under the File menu
    data(USArrests)
    loadDFData(USArrests,"USArrests")
    # plotting the data should occur through Plot Data under 
    # the Display menu
    createView(type = "plotView", dataName = "USArrests", 
               plotType = "sPlotView", dfRows = 1:nrow(USArrests), 
               dfColumns = 1:2)  
    # x will be of type sPlotView
    x<-getActivePlot()
    print(class(x))
    print(colx(x))
    print(coly(x))
    createView(type = "plotView", dataName = "USArrests", 
               plotType = "sPlotView", dfRows = 1:nrow(USArrests), 
               dfColumns = 3:4)  
    x<-getActivePlot()
    print(colx(x))
    print(coly(x))
  }

[Package iSPlot version 1.0.3 Index]