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