plotcorr               package:ellipse               R Documentation

_P_l_o_t _c_o_r_r_e_l_a_t_i_o_n _m_a_t_r_i_x _e_l_l_i_p_s_e_s

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

     This function plots a correlation matrix using ellipse-shaped
     glyphs for each entry.  The ellipse represents a level curve of
     the density of a bivariate normal with the matching correlation. 
     It works best with the postscript output device.

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

     plotcorr(corr, outline=TRUE, dev=FALSE, col=4, paropts=NULL, numbers=FALSE, ...)

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

    corr: A matrix containing entries between -1 and 1 to be plotted as
          correlations.  Use corr=NULL to execute plotcorr only for the
          side effect of opening the postscript device (see example
          below).  

 outline: Whether the ellipses should be outlined in the default
          colour. 

     dev: Which device to plot to.  By default, continues to plot to
          the current device.  If you want to produce a Postscript
          plot, use dev=postscript.  Note that in order to install the
          fonts correctly, the first plot to a postscript device must
          come from plotcorr(dev=postscript,...{}),not from the
          standard postscript() call. 

     col: Which colour to use to fill the ellipses.  Use col=0 for
          empty, col=1 for black, other integers for shades according
          to the ps.options('colors') vector.  NB:  some versions of
          S-PLUS map all shaded text to black or white on a black and
          white laser printer;  use
          "ps.options(black.and.white='false')" to disable this. 

 paropts: Layout and other plot options to use after the device is
          open. When  plotcorr opens the device, par() options
          specified before you call it won't have any effect.  Specify
          the options you need in a list here to affect the plotcorr
          output.  For example, paropts=list(mfrow=c(3,2)) will specify
          a layout of 3 rows of 2 plots. Only the top left corner will
          be plotted; use subsequent plot commands (including
          plotcorr(...{}, dev=F, ...{}) commands) to fill in the other
          plots. 

 numbers: Whether to plot numerical correlations in place of ellipses. 
          If numbers is T, then the correlations will be rounded to a
          single decimal place and placed on the plot. 

     ...: Parameters to pass to the graphics device.  For example, use
          file='output.ps' to direct postscript  output to that file. 

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

     The ellipses being plotted will be tangent to a unit character
     square, with the shape chosen to match the required correlation.
     On the postscript output device, plotting is done by installing
     special fonts for the ellipse shapes.  On other devices, plotting
     is done using the ellipse() function.  Postscript output is much,
     much faster than other devices.

_S_i_d_e _E_f_f_e_c_t_s:

     If dev specifies a graphics device, then  this will open it.  If
     dev is "postscript", installs two ellipse-shaped fonts into the 
     postscript preamble:  an outline font in the second last position,
     and a solid font in the last position.   Produces a plot of the
     correlations on the given device or on the current device.

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

     ellipse.preamble, ellipse

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

     # Plot the correlation matrix for the fuel data fit 
     data(fuel.frame)
     fit <- lm(Fuel ~ ., fuel.frame)
     plotcorr(summary(fit,correlation=T)$correlation)
     # Plot a second figure to the same file, with numbers in place of the
     # ellipses
     plotcorr(summary(fit,correlation=T)$correlation, numbers=T)

