s-news
[Top] [All Lists]

Stacked bar plot

To: <s-news@lists.biostat.wustl.edu>
Subject: Stacked bar plot
From: "Lacroix Brigitte" <Brigitte.Lacroix@UCB-Group.com>
Date: Tue, 17 Apr 2007 18:48:46 +0200
Importance: normal
Thread-index: AceBBw9P0Ju5sRvtQdmd+AjPUF2uYQABz2kA
Thread-topic: Stacked bar plot
 
Dear S-PLUS users,

I am using S-PLUS at a very basic level to build graphs.  So, this is maybe a very simple question, but  I have some issues to build a vertical stacked bar plot.

My data consists in  a  3 column  table . The first one contains time brackets (categories => x axis), the second and third ones  contain P1 and P0, which are probability of a score to be 1 or 0.

 

I have used the following code:

 

guiPlot("Stacked Bar",DataSetValues=

data.frame(as.factor(summary.obs$TIME),summary.obs$P1,summary.obs$P0))

It does work, but I still have some questions :

- How could I do to choose the color of filing, to add legends for the axis... ?
I have tried this code :
guiModify("BarPlot",Name="ESSAI",BarFillType="By bar",StartFillColor="Black",EndFillColor="Green") and have also replaced "By bar" by "Two Colors" but  none  of the two code works ...

- Is it possible to write the function using another code, like barplot(...)  ?  I have tried but did not manage to make it work... (In that case, I could use the options col, xlab... that I already know)

- I have converted the time brackets in A to S for the moment so that the categories are kept in the right order. Otherwise (with numbers) the order on the graph become: 1 11 12 13...19 2... instead of 1 2 3...11 12... How could  I choose the order ?

- Finally, I have a second  table  containing the same information, but simulated instead of observed probabilities. I would like to add stacked bars on the same graph, so that I would be able to compare simulated and observed data per time bracket on one graph. It would be very nice if someone could explain me how to achieve that...

Your help will be greatly appreciated !
Thank you !
Brigitte



Legal Notice: This electronic mail and its attachments are intended solely for the person(s) to whom they are addressed and contain information which is confidential or otherwise protected from disclosure, except for the purpose for which they are intended. Dissemination, distribution, or reproduction by anyone other than the intended recipients is prohibited and may be illegal. If you are not an intended recipient, please immediately inform the sender and return the electronic mail and its attachments and destroy any copies which may be in your possession. UCB screens electronic mails for viruses but does not warrant that this electronic mail is free of any viruses. UCB accepts no liability for any damage caused by any virus transmitted by this electronic mail.
<Prev in Thread] Current Thread [Next in Thread>
  • Stacked bar plot, Lacroix Brigitte <=