Skip to content

stacked plots

4 messages · BBands, Gabor Grothendieck, Dirk Eddelbuettel

#
Dear helpeRs,

Is there a better method of producing stacked charts than
par(mfrow(3,1)), plot(x), plot(y), plot(z)? What I would like to do is
produce a chart of several panes stacked vertically with no space
between them so they appeared to be a single figure. I've attached a
small example, though it is not clear that it will make it, as the
posting guide doesn't say which sort of images are allowed--it is a
gif. My data will be in zoo objects like those from get.hist.quote()
with the data for the extra panes in additional columns.

Thanks in advance,

    jab
#
If this is time series data try

library(zoo)
example(plot.zoo)
example(xyplot.zoo)

to see if any of those fit your requirements.
On 12/27/06, BBands <bbands at gmail.com> wrote:
#
John,
On 27 December 2006 at 08:36, BBands wrote:
| Dear helpeRs,
| 
| Is there a better method of producing stacked charts than
| par(mfrow(3,1)), plot(x), plot(y), plot(z)? What I would like to do is
| produce a chart of several panes stacked vertically with no space
| between them so they appeared to be a single figure. I've attached a
| small example, though it is not clear that it will make it, as the
| posting guide doesn't say which sort of images are allowed--it is a
| gif. My data will be in zoo objects like those from get.hist.quote()
| with the data for the extra panes in additional columns.

Do you remember the bollingerBands example we worked on a few years ago and
that is still at Romain's incredible R Graph Gallery at
      http://addictedtor.free.fr/graphiques/RGraphGallery.php?graph=65

It uses layout, you can also use the simpler par(mfrow=...) approach *if* you
also reduce bottom and top spacing accordingly as e.g. in the plot functions
in the script referenced above.

Cheers, Dirk
#
On 12/27/06, Dirk Eddelbuettel <edd at debian.org> wrote:
I do indeed remember that, it was a nice piece of work that I learned
a lot from. At the time you mentioned there were some newer methods in
the works that might serve better, which prompted my question after an
appropriate delay. ;-)

    jab