Mike Bock
2006-Oct-30 20:37 UTC
[R] Hmisc or Lattice plot with error bars, Depth (independent variable) on Y axis
I am trying to create some plots of concentration versus depth. I want Depth on the Y axis and the concentrations on the X axis. I also need to plot error bars. The xYplot function in Hmisc is very nearly ideal but I have to put depth on the x-axis to get it to work. When I transpose the X and Y axes in the xYplot command, the error bars disappear (no surprise given the help file). It there a way to get the plot command to flip the axes? That would be ideal as I could use the grouping functions in xYplot and save a bunch of work. If no such command exists any other ideas? I looked at the Dotplot command but the depths are not evenly spaced so I don't think that will work. Thanks in advance Mike Michael J Bock, PhD ENVIRON International Corp. This message contains information that may be confidential, ...{{dropped}}
Frank E Harrell Jr
2006-Oct-30 20:56 UTC
[R] Hmisc or Lattice plot with error bars, Depth (independent variable) on Y axis
Mike Bock wrote:> I am trying to create some plots of concentration versus depth. I want Depth on the Y axis and the concentrations on the X axis. I also need to plot error bars. > > The xYplot function in Hmisc is very nearly ideal but I have to put depth on the x-axis to get it to work. When I transpose the X and Y axes in the xYplot command, the error bars disappear (no surprise given the help file). It there a way to get the plot command to flip the axes? That would be ideal as I could use the grouping functions in xYplot and save a bunch of work. > > If no such command exists any other ideas? > > I looked at the Dotplot command but the depths are not evenly spaced so I don't think that will work. > > Thanks in advance > > Mike > > Michael J Bock, PhD > ENVIRON International Corp.xYplot only supports vertical error bars Frank -- Frank E Harrell Jr Professor and Chair School of Medicine Department of Biostatistics Vanderbilt University
Deepayan Sarkar
2006-Oct-30 23:04 UTC
[R] Hmisc or Lattice plot with error bars, Depth (independent variable) on Y axis
On 10/30/06, Mike Bock <mbock at environcorp.com> wrote:> I am trying to create some plots of concentration versus depth. I want Depth on the Y axis and the concentrations on the X axis. I also need to plot error bars. > > The xYplot function in Hmisc is very nearly ideal but I have to put depth on the x-axis to get it to work. When I transpose the X and Y axes in the xYplot command, the error bars disappear (no surprise given the help file). It there a way to get the plot command to flip the axes? That would be ideal as I could use the grouping functions in xYplot and save a bunch of work. > > If no such command exists any other ideas?See demo(intervals) The untruncated code can be seen with file.show(system.file("demo/intervals.R", package = "lattice")) There was a recent thread dealing with extensions (grouping and switching axes): [1] https://stat.ethz.ch/pipermail/r-help/2006-October/114883.html -Deepayan
Mike Bock
2006-Oct-31 15:56 UTC
[R] Hmisc or Lattice plot with error bars, Depth (independent variable) on Y axis
I just discovered that using the xYplot (Hmisc) and rotating the grid viewport (and the labels etc) given me exactly what I need. I wish I had thought of that much sooner.... -----Original Message----- From: Deepayan Sarkar [mailto:deepayan.sarkar at gmail.com] Sent: Monday, October 30, 2006 6:04 PM To: Mike Bock Cc: r-help at stat.math.ethz.ch Subject: Re: [R] Hmisc or Lattice plot with error bars, Depth (independent variable) on Y axis On 10/30/06, Mike Bock <mbock at environcorp.com> wrote:> I am trying to create some plots of concentration versus depth. Iwant Depth on the Y axis and the concentrations on the X axis. I also need to plot error bars.> > The xYplot function in Hmisc is very nearly ideal but I have to putdepth on the x-axis to get it to work. When I transpose the X and Y axes in the xYplot command, the error bars disappear (no surprise given the help file). It there a way to get the plot command to flip the axes? That would be ideal as I could use the grouping functions in xYplot and save a bunch of work.> > If no such command exists any other ideas?See demo(intervals) The untruncated code can be seen with file.show(system.file("demo/intervals.R", package = "lattice")) There was a recent thread dealing with extensions (grouping and switching axes): [1] https://stat.ethz.ch/pipermail/r-help/2006-October/114883.html -Deepayan This message contains information that may be confidential, ...{{dropped}}