s-news
[Top] [All Lists]

Grouped bar plots centered on zero with error bars - SUMMARY

To: <s-news@lists.biostat.wustl.edu>
Subject: Grouped bar plots centered on zero with error bars - SUMMARY
From: "John Payne" <jcpayne@u.washington.edu>
Date: Tue, 21 Jan 2003 10:35:28 -0800
Organization: University of Washington
Reply-to: "John Payne" <jcpayne@u.washington.edu>
My apologies for what was obviously a simple question (however, I received a
number of replies from others who had the same problem).  The SPLUS support
team resolved the problem:

"It is possible to create a grouped bar plot centered on zero with error
bars.  Suppose I create the following data in S-PLUS:

my.df <- data.frame(x=LETTERS[1:3], y1=1:3, y2=c(-2,1,2), y3=-3:-1,
z1=c(.3,.6,.9), z2=c(-.4,.2,.8), z3=c(-.7,-.1,-.5))

Then to create the plot, select Graph -> 2D Plot.  Choose 'Bar with Error -
Grouped' for the Plot Type and click OK.  In the Bar Plot dialog that
appears enter the following information:

Data Set:  my.df
x Columns:  x
y Columns:  y1,y2,y3
z Columns:  z1,z2,z3

Click on the Position tab and choose the following:

Bar Base:  Zero

Click OK.

You should now have the desired plot.

Following is information on specifying data for a grouped bar chart with
error bars:

For a grouped vertical bar chart with error bars, specify the names or
column numbers of your X, Y, and Z columns.  The X column determines the
position of the groups along the x-axis.  Each series of bars (for example,
the first bar in each grouping as you move across the graph sheet) must have
a y value corresponding to each x value.  Thus the total number of y values
must be the same number of x values multiplied by the number of bars in each
grouping.  These y values can be specified with multiple y columns, or with
one long column.  The Z column should contain the standard error data and
should have the same dimensions as your Y column(s).  Error bars cannot be
automatically calculated for grouped bar charts."

John Payne
UW


<Prev in Thread] Current Thread [Next in Thread>
  • Grouped bar plots centered on zero with error bars - SUMMARY, John Payne <=