[R] help on barplot

Murad Nayal mn216 at columbia.edu
Mon Jul 21 04:16:44 CEST 2003



Hello,

I am trying to compare two histograms using barplot. the idea is to plot
the histograms as pairs of columns side by side for each x value. I was
able to do it using barplot before but I can't remember now for the life
of me now how I did it in the past:

> d
              [,1]         [,2]
-37.5 0.0000000000 2.789396e-05
-32.5 0.0001394700 5.578801e-05
-27.5 0.0019804742 1.732218e-02
-22.5 0.0217294282 1.380474e-01
-17.5 0.0938912134 4.005579e-02
-12.5 0.0630683403 4.351464e-03
-7.5  0.0163179916 8.368201e-05
-2.5  0.0025941423 5.578801e-05
2.5   0.0002789400 0.000000e+00
7.5   0.0000000000 0.000000e+00

> barplot(d,beside=TRUE)

barplot here plots two separate 'sets' of columns, on the left side a
bar plot of d[,1] is plotted while on the right side a separate bar plot
of d[,2] is plotted. how can I combine the two?

actually, while on the subject of histograms. is it possible to plot a
3D-histogram in R (a true 3D bar plot, without using image).

many thanks
Murad


-- 
Murad Nayal M.D. Ph.D.
Department of Biochemistry and Molecular Biophysics
College of Physicians and Surgeons of Columbia University
630 West 168th Street. New York, NY 10032
Tel: 212-305-6884	Fax: 212-305-6926




More information about the R-help mailing list