[R] regarding 3d Bar Plot

Duncan Murdoch murdoch at stats.uwo.ca
Wed Apr 25 13:12:57 CEST 2007

On 4/24/2007 9:38 AM, rolf at math.unb.ca wrote:
> gyadav at ccilindia.co.in wrote:
>> I have data in a two dimensional table. each row of the data adds
>> upto 100 ( hence they are percentages ).  it can be interpreted as
>> like this A - I are the matches and  P - X are the players. Thus
>> Player P scored 20% of the runs during this season in Match C, 60% in
>> Match D and remaining 20% in Match G.
>> I want to plot 3-d bar plot, where X axis have players, Y axis have
>> Matches and Z axis as the percentage(0 - 100%) Please help me in this
>> regards.
>          <snip>
> 	Many years ago I picked up from the snews mailing list a
> 	suite of functions for plotting 2D barplots (barplots with 2D
> 	bases) written by a chap named Colin Goodall, from (at that
> 	time) the University of Bristol and/or from Penn State.
> 	I never actually did anything with this suite until
> 	recently.  Seeing no replies to the enquiry about 3D
> 	histograms,  I thought I'd try to get Goodal's code running
> 	in R to see if it might solve guarav's problem.
> 	The trouble is, all the guts of the procedure, *including*
> 	the plotting are done from within Fortran.  The actual
> 	plotting seems to be done through a call to a subroutine
> 	``segmtz'' which is a piece of Splus software that does not
> 	exist in R.
> 	Is there an equivalent subroutine in R that could be called?
> 	I dug around a bit but couldn't figure out what was going
> 	on.  The function segments() simply calls
> 	.Internal(segments(....
> 	I looked around a bit for corresponding C or Fortran code but
> 	obviously didn't know how to look properly.
> 	I think that the Fortran code could be translated into raw R
> 	and the call to segmtz changed to a call to segments() ---
> 	but this would seem to be a lot of work.
> 	Can anyone suggest a reasonably simple way of replacing the
> 	call to segmtz in the Fortran?

I don't know how to do what you want, but I'd suggest working in R code 
rather than Fortran.  I did write a hist3d function for the djmrgl 
package (based on hist), mostly to show off the graphics, but haven't 
found it useful enough to port to rgl.  Here's a quick port, not good 
enough to use, but maybe it will give you a starting point.

Duncan Murdoch

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: hist3d.R
Url: https://stat.ethz.ch/pipermail/r-help/attachments/20070425/01371333/attachment.pl 

More information about the R-help mailing list