A simple example of using image to plot a grid of values is:
 
> library(cluster)
> 
> image( 1:50, seq(1856, 1976, 4), as.matrix(votes.repub) )
>
 
Even better is to group the states so similar states are closer to each other:
 
> agn1 <- agnes(votes.repub, metric = "manhattan", stand = TRUE)
> image( 1:50, seq(1850, 1976, 4), as.matrix(votes.repub)[agn1$order,])
> 
 
Horizontal stripes show years that were very republican or very-non-republican, 
verticle stripes show states or groups of states that are very republican or 
non-republican.  light blocks in dark areas or dark blocks in light areas show 
outliers that may be of interest.

________________________________

From: Dong GUO ?? [mailto:[EMAIL PROTECTED]
Sent: Sat 7/28/2007 10:19 PM
To: Greg Snow
Cc: r-help@stat.math.ethz.ch
Subject: Re: [R] plot


Thanks again, Greg, It really helps. 

Would you please let me know more reference of plot in R?  how to use the image 
function to create the grid???

Thanks much.
Dong

On 7/27/07, Greg Snow < [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > wrote:
> Can you really see much of the data in a 26*31 3d barplot?  It seems like 
> most info would be hidden behind the first few rows and it would be so 
> cluttered that you would not be able to make out much of anything from it. 
> 

It is true that with too much info in such a 3d graph, it would be not 
informative.

> Why not try a line plot instead (year as the x axis, each region a different 
> year).  Here is a quick example: 
> 
> > data(votes.repub, package='cluster')
> > matplot( t(votes.repub[1:31, 1:26]), type='l')
> >
> 
> Even better would be to group some of the regions together and use xyplot 
> from the lattice package and have a panel for each group of regions (fewer 
> lines per panel should be easier to see detail). 
> 
> You could also use the image function (or levelplot from lattice) to create a 
> 26*31 grid with colors used for the 3rd dimension (can be good for overall 
> patterns, not so good for looking at detail).
> 
> Hope this helps,
> 
> --
> Gregory (Greg) L. Snow Ph.D.
> Statistical Data Center
> Intermountain Healthcare
> [EMAIL PROTECTED] 
> (801) 408-8111
> 
> 
> 
> > -----Original Message-----
> > From: Dong GUO ?? [mailto: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> ]
> > Sent: Friday, July 27, 2007 12:09 PM 
> > To: Greg Snow
> > Cc: r-help@stat.math.ethz.ch
> > Subject: Re: [R] plot 
> >
> > Many thanks, Greg and Justin.
> >
> > The matrix is just a 26*31 matrix - 26 years, 31 regions. I
> > am know to R, just dont know how to attach the data here yet..
> >
> > As I have such matrices for nine indicators for all regions, 
> > so i could show some differences by 3D plot, which I did
> > similar things in Excel. I am sure there is a way to do it in R
> >
> > On 7/27/07, Greg Snow < [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > 
> > wrote:
> > > Graphs that rely on 3-d effects tend to distort the data
> > rather than enlighten the viewer.  If your goal is to distort
> > the data (which I doubt), then most of us don't want to help. 
> >  On the other hand, if you really do want to enlighten the
> > viewer (even if that is just you), then tell us what your
> > data is like and what you want to learn from it, and we will
> > be happy to give you advice on creating useful graphs.
> > >
> > > --
> > > Gregory (Greg) L. Snow Ph.D.
> > > Statistical Data Center
> > > Intermountain Healthcare 
> > > [EMAIL PROTECTED]
> > > (801) 408-8111
> > > 
> > >
> > >
> > > > -----Original Message----- 
> > > > From: [EMAIL PROTECTED]
> > > > [mailto: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> ] On Behalf Of 
> > > > Dong GUO ??
> > > > Sent: Friday, July 27, 2007 8:45 AM
> > > > To: r-help@stat.math.ethz.ch
> > > > Subject: [R] plot 
> > > >
> > > > Greetings to the group,
> > > >
> > > > I would like to know if some one could help me with plot
> > 3-d column
> > > > graph of a matrix (3-d column graph in Excel). 
> > > >
> > > > Many thanks in advance.
> > > >
> > > > Regards,
> > > > Dong
> > > >
> > > > ______________________________________________ 
> > > > R-help@stat.math.ethz.ch 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.
> > > >
> > >
> > >
> >
> 
> 


        [[alternative HTML version deleted]]

______________________________________________
R-help@stat.math.ethz.ch 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.

Reply via email to