Re: [R] three dimensions barchart

2009-08-19 Thread Yichih Hsieh
Thanks David and Berton,

But I am so sorry for my mistake.
I have just found what I want is a three dimension *histogram*.
So correct problem is:

I draw the Relative Distribution graph,
it looks like histogram(X,Y plot),
but I have ten(year) Relative Distribution graphs,
have any command can combine ten histograms(X,Y plot) to become a three
dimensions histogram(X,Y,Z plot)?


I check David provide' website
http://lmdvr.r-forge.r-project.org/figures/figures.html#%20Figure%206.15
but can't find three dimension histogram.

 Have any suggestions?

All help highly appreciated.


Best,
Yichih


2009/8/19 David Winsemius dwinsem...@comcast.net


 On Aug 18, 2009, at 7:18 AM, Yichih Hsieh wrote:

 Dear R community,

 I have one problem with figures.

 I draw the Relative Distribution graph,
 it looks like barchart(X,Y plot),
 but I have ten(year) Relative Distribution grapgs,
 have any command am can combine ten barcharts(X,Y plot) to become a three
 dimensions barchart(X,Y,Z plot)?


 It has been my experience that the R-graphics experts generally deprecate
 3-D bar graphs, but there are some worked examples in the supporting
 webpages for Sarkar's Lattice book:

 Fig 6.4 (image followed by code)
 http://dsarkar.fhcrc.org/lattice/book/images/Figure_06_04_stdBW.png

 cloud(density ~ long + lat, state.info,
  subset = !(name %in% c(Alaska, Hawaii)), type = h, lwd = 2,
 zlim = c(0,
max(state.info$density)), scales = list(arrows
 = FALSE))
 library(maps) state.map - map(state, plot=FALSE, fill = FALSE)
 panel.3dmap - function(..., rot.mat, distance, xlim, ylim, zlim,
 xlim.scaled,
ylim.scaled, zlim.scaled) {
   scaled.val - function(x, original, scaled) { scaled[1] +
(x - original[1]) * diff(scaled) / diff(original) }

  m - ltransform3dto3d(rbind(scaled.val(state.map$x, xlim, xlim.scaled),
 scaled.val(state.map$y, ylim, ylim.scaled), zlim.scaled[1]),
 rot.mat, distance) panel.lines(m[1,], m[2,], col = grey76) }


 Fig 6.15 (image )
 http://dsarkar.fhcrc.org/lattice/book/images/Figure_06_15_stdBW.png

 code at:

 http://lmdvr.r-forge.r-project.org/figures/figures.html#%20Figure%206.15

  All help highly appreciated


 Best,
 Yichih


 One Relative Distribution graph:

 fig2b-reldist(y=mu96$adjwage,yo=mu68$adjwage,ci=F,smooth=0.4,
 bar=TRUE,yolabs=seq(-1,3,by=0.5),
 ylim=c(0,7),cex=0.8,ylab=Relative Density,xlab=Proportion of the
 Original
 Cohort)
 title(main=Fig2(b):2007,cex=0.6)



 --
 Yichih Hsieh

 e-mail : yichih.hs...@gmail.com

[[alternative HTML version deleted]]

 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.htmlhttp://www.r-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.


 David Winsemius, MD
 Heritage Laboratories
 West Hartford, CT




-- 
Yichih Hsieh

e-mail : yichih.hs...@gmail.com

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] three dimensions barchart

2009-08-19 Thread David Winsemius

On Aug 19, 2009, at 7:44 AM, Yichih Hsieh wrote:


 Thanks David and Berton,

 But I am so sorry for my mistake.
 I have just found what I want is a three dimension histogram.
 So correct problem is:

 I draw the Relative Distribution graph,
 it looks like histogram(X,Y plot),
 but I have ten(year) Relative Distribution graphs,
 have any command can combine ten histograms(X,Y plot) to become a  
 three dimensions histogram(X,Y,Z plot)?


 I check David provide' website
 http://lmdvr.r-forge.r-project.org/figures/figures.html#%20Figure%206.15
 but can't find three dimension histogram.

I suggested looking at Figures 6.4 and  6.15.  (I did not say they  
would be labeled 3D histogram. ) Did the displayed webpage not offer  
those possibilities? I am using Firefox 3.5.2 and having no problems  
with displaying the figure or viewing the code when using the above URL.

-- 
DW

 2009/8/19 David Winsemius dwinsem...@comcast.net

 On Aug 18, 2009, at 7:18 AM, Yichih Hsieh wrote:
 snipped

David Winsemius, MD
Heritage Laboratories
West Hartford, CT


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] three dimensions barchart

2009-08-19 Thread Yichih Hsieh
Dear David,

webpage is no problem.

Figures 6.4 and 6.15's code can graph 3D bar chart,
I just not sure,
will it work for histogram too?

Thanks for your consideration.

All help high appreciated.

best,
yichih


2009/8/19 David Winsemius dwinsem...@comcast.net


  On Aug 19, 2009, at 7:44 AM, Yichih Hsieh wrote:


 Thanks David and Berton,

 But I am so sorry for my mistake.
 I have just found what I want is a three dimension *histogram*.
 So correct problem is:

 I draw the Relative Distribution graph,
 it looks like histogram(X,Y plot),
 but I have ten(year) Relative Distribution graphs,
 have any command can combine ten histograms(X,Y plot) to become a three
 dimensions histogram(X,Y,Z plot)?


 I check David provide' website
 http://lmdvr.r-forge.r-project.org/figures/figures.html#%20Figure%206.15
 but can't find three dimension histogram.


 I suggested looking at Figures 6.4 and  6.15.  (I did not say they would be
 labeled 3D histogram. ) Did the displayed webpage not offer those
 possibilities? I am using Firefox 3.5.2 and having no problems with
 displaying the figure or viewing the code when using the above URL.

 --
 DW

   2009/8/19 David Winsemius dwinsem...@comcast.net


 On Aug 18, 2009, at 7:18 AM, Yichih Hsieh wrote:
 snipped


  David Winsemius, MD
 Heritage Laboratories
 West Hartford, CT




-- 
Yichih Hsieh

e-mail : yichih.hs...@gmail.com

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] three dimensions barchart

2009-08-19 Thread Liviu Andronic
On 8/20/09, Yichih Hsieh yichih.hs...@gmail.com wrote:
  All help high appreciated.

Try
library(fortunes)
fortune(3-D)
fortune(Excel)

Issue the last two commands several times.
Liviu

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] three dimensions barchart

2009-08-18 Thread David Winsemius


On Aug 18, 2009, at 7:18 AM, Yichih Hsieh wrote:


Dear R community,

I have one problem with figures.

I draw the Relative Distribution graph,
it looks like barchart(X,Y plot),
but I have ten(year) Relative Distribution grapgs,
have any command am can combine ten barcharts(X,Y plot) to become a  
three

dimensions barchart(X,Y,Z plot)?



It has been my experience that the R-graphics experts generally  
deprecate 3-D bar graphs, but there are some worked examples in the  
supporting webpages for Sarkar's Lattice book:


Fig 6.4 (image followed by code)
http://dsarkar.fhcrc.org/lattice/book/images/Figure_06_04_stdBW.png

cloud(density ~ long + lat, state.info,
  subset = !(name %in% c(Alaska, Hawaii)), type = h,  
lwd = 2, zlim = c(0,
max(state.info$density)), scales =  
list(arrows = FALSE))

library(maps) state.map - map(state, plot=FALSE, fill = FALSE)
panel.3dmap - function(..., rot.mat, distance, xlim, ylim, zlim,  
xlim.scaled,

ylim.scaled, zlim.scaled) {
   scaled.val - function(x, original, scaled) { scaled[1] +
(x - original[1]) * diff(scaled) /  
diff(original) }


 m - ltransform3dto3d(rbind(scaled.val(state.map$x, xlim,  
xlim.scaled),
 scaled.val(state.map$y, ylim, ylim.scaled),  
zlim.scaled[1]),
 rot.mat, distance) panel.lines(m[1,], m[2,], col =  
grey76) }



Fig 6.15 (image )
http://dsarkar.fhcrc.org/lattice/book/images/Figure_06_15_stdBW.png

code at:

http://lmdvr.r-forge.r-project.org/figures/figures.html#%20Figure%206.15


All help highly appreciated


Best,
Yichih


One Relative Distribution graph:

fig2b-reldist(y=mu96$adjwage,yo=mu68$adjwage,ci=F,smooth=0.4,
bar=TRUE,yolabs=seq(-1,3,by=0.5),
ylim=c(0,7),cex=0.8,ylab=Relative Density,xlab=Proportion of the  
Original

Cohort)
title(main=Fig2(b):2007,cex=0.6)



--
Yichih Hsieh

e-mail : yichih.hs...@gmail.com

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


David Winsemius, MD
Heritage Laboratories
West Hartford, CT

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.