getActivePlot             package:iSPlot             R Documentation

_R_e_t_u_r_n _t_h_e _p_l_o_t_V_i_e_w _o_b_j_e_c_t _t_h_a_t _c_o_r_r_e_s_p_o_n_d_s _t_o _t_h_e _a_c_t_i_v_e _p_l_o_t

_D_e_s_c_r_i_p_t_i_o_n:

     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.

_U_s_a_g_e:

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

_A_r_g_u_m_e_n_t_s:

  curDev: the active device

viewList: viewList in viewEnv

_D_e_t_a_i_l_s:

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

_V_a_l_u_e:

     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.

_A_u_t_h_o_r(_s):

     Elizabeth Whalen

_S_e_e _A_l_s_o:

     'updatePlots', 'createSPlotView', 'checkPoint'

_E_x_a_m_p_l_e_s:

       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))
       }

