BasicPlots              package:fBasics              R Documentation

_B_a_s_i_c _P_l_o_t _F_u_n_c_t_i_o_n_s _a_n_d _U_t_i_l_i_t_i_e_s

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

     A collection and description of several plot functions  and
     utilities which may be useful for the explorative  data analysis
     of financial and economic market data.  Listed are also three
     utility functions displaying  tables for characters, plot symbols,
     and colors. 

     The functions are:

       'tsPlot'              Time Series Plot,
       'histPlot'            Histogram Plot of (Series) Data,
       'densityPlot'         Kernel Density Estimate Plot,
       'circlesPlot'         Scatterplot of Circles Indexing a 3rd Variable,
       'perspPlot'           Perspective Plot in 2 Dimensions,
       'characterTable'      Table of Numerical Equivalents to Latin Characters,
       'plotcharacterTable'  Table of plot characters, plot symbols,
       'colorTable'          Table of Color Codes and Plot Colors itself,
       'splusLikePlot'       Scales plotting and symbols.

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

      
     tsPlot(x, type = "l", labels = TRUE, ...) 
     histPlot(x, col = "steelblue4", border = "white", ...)
     densityPlot(x, ...)


     circlesPlot(x, y, size = 1, ...)
     perspPlot(x, y, z, theta = -40, phi = 30, col = "steelblue4", ps = 9, ...)

     characterTable(font = 1, cex = 0.7)
     plotcharacterTable(font = par('font'), cex = 0.7)
     colorTable(cex = 0.7)

     splusLikePlot(scale = 0.8))

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

col, border, type: two character strings, defining the colors used to
          fill the bars and to plot the borders of the bars for the
          'histPlot', or color and linetype as used by the function
          'plot'. 

font, cex: an integer value, the number of the 'font', by default font 
          number 1, the standard font for the 'characterTable' or the
          current plot character font for the  'plotcharacterTable'.
          The character size is determined by the numeric value 'cex',
          the default size is 0.7. 

  labels: a logical. If set to 'TRUE' labels are generated
          automatically, otherwise not. Default value is 'TRUE'. 

   scale: a numeric value, by default 0.8, to scale fonts and symbols
          in plots to make them more Splus like. 

    size: a numeric vector like 'z', the third variable in the 
          function 'circlesPlot'. The argument gives the size of the 
          circles, by default all values are set to 1. 

theta, phi, ps: plot parameters for the function 'perspPlot' as used by
          the function 'persp'. 

    x, y: numeric vectors. In the case of the 'thermometerPlot' 'x'
          holds the current values of the n-bars. 

       z: a matrix containing the values to be plotted by the function
          'perspPlot'. 

     ...: arguments to be passed to the underlying plot function. 

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

     *Series Plots:* 

      'tsPlot' plots time series on a common plot. Unlike 'plot.ts' 
     the series can have a different time bases, but they should have
     the  same frequency. 'tsPlot' is a synonyme function call for R's 
     'ts.plot' from the the 'ts' package. 

     *Histogram and Density Plots:* 

      'histPlot' and 'densityPlot' show (return) distributions in form 
     of a  histogram and density plots. The first is a synonyme
     function call  for R's histogram plot, calling the function
     'hist'. The outlook  of the plot is more SPlus like. The second
     creates a density Plot  with underlying kernel density estimation.
     It is a function call to   R's 'density' function. 

     *Three Dimensional Plots:* 

      'circlesPlot' and 'perspPlot', see also 'contour', are functions
     to plot 3 dimensional data sets. The first is simple scatterplot
     with points replaced with variable circles,  whose size indexes a
     third variable. The second aloows to create a perspective 3
     dimensional plot. It is a function call to R's 'persp' plot, but
     the parameters are setted to produce a more SPlis like outlook of
     the plot. 'contour' is the call to R's contour plot from the
     'base' package. 

     *Plot Utilities:* 

      'characterTable', 'plotcharacterTable' and 'colorTable' are three
     helpful utilities for using characters and colors in plots. The
     first function displays a table of numerical equivalents to Latin 
     characters, the second displays a table of plot characters, i.e. 
     the symbols used in plots, and the third displays a table with the
     codes of the default plot colors.

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

     'tsPlot' 
      plots a time series. Just a synonyme call to the function
     'ts.plot' changing plot type to 'l'ines and plot color  to
     'steelblue3'. 

     'histPlot' 
      plots a histogram. This is a synonyme function call for R's 
     histogram plot, calling the function 'hist'. Returns an  object of
     class '"histogram"', see 'hist'. 

     'densityPlot' 
      returns an object of class '"density"', see 'density'. 

     'circlesPlot' 
      a simple pseudo three dimensional scatterplot of circels whose
     sizes index a thrid variable. 

     'perspPlot' 
      draws perspective plots of surfaces over the x-y plane. 

     'characterTable' 
      displays a table with the characters of the requested font. The
     character on line "xy" and column "z" of the table has  code
     '"\xyz"', e.g 'cat("\126")' prints: V for font  number 1. These
     codes can be used as any other characters. 


     'plotcharacterTable' 
      displays a table with the plot characters numbered from 0 to 255. 

     'colorTable' 
      displays a table with the plot colors with the associated color
     number. 

     'splusLikePlot' 
        scales plotting and symbols to make plots more Splus like.

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

     Gordon Smyth for the circlesPlot, 
      Pierre Joyet for the characterTable, and 
      Diethelm Wuertz for the Rmetrics R-port.

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

     'plot', 'persp',   'contour', 'par'.

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

     ## tsPlot -
        xmpBasics("\nStart: European Stock Markets > ")
        # Show multiple plot:
        par(mfrow = c(1, 1), cex = 0.7)
        data(EuStockMarkets)
        tsPlot(EuStockMarkets, gpars = list(col = c(2:4, 6)), labels = FALSE)
        title(main = "European Stock Markets")
        
     ## histPlot -
        xmpBasics("\nNext: Histogram Plot of Normal Random Numbers > ")
        histPlot(x = rnorm(1000), main = "Histogram Plot")
        
     ## densityPlot -
        xmpBasics("\nNext: Density Plot of Normal Random Numbers > ")
        densityPlot(x = rnorm(1000), main = "Density Plot")
        
     ## circlesPlot -
        xmpBasics("\nNext: 3D Circles Plot of Normal Random Numbers > ")
        circlesPlot(x = rnorm(50), y = rnorm(50), size = abs(rnorm(50)),
          main = "Circles Plot")

     ## perspPlot -
        xmpBasics("\nNext: Perspective Plot > ")
        par(mfrow = c(1, 1), ps = 11)
        x = y = seq(-10, 10, length=51)
        f = function(x, y) { r = sqrt(x^2+y^2); 10 * sin(r)/r }
        z = outer(x, y, f)   
        perspPlot(x, y, z)
        title(main = "Perspective Plot", line = -3)
        
     ## characterTable - 
        xmpBasics("\nNext: Print the Copyright Sign > ")
        cat("\251 \n")

     ## characterTable - 
        xmpBasics("\nNext: Display Character Table for Symbol Font > ")
        characterTable(5)
        
     ## colorTable - 
        xmpBasics("\nNext: Display Table of Plot Colors > ")
        colorTable()
        
     ## plotcharacter Table - 
        xmpBasics("\nNext: Display Table of Plot Characters > ")
        plotcharacterTable()

