Displaying 20 results from an estimated 20000 matches similar to: "How to put multiple plots in the same window? (not par(mfrow=))"
2004 Aug 02
4
How to add a common title (or xlab, ylab) for multi-plots in the same window?
Dear R people,
I am using par(mfrow=c()) to plot multi-figures in the same window. And I like
to put a common title (and xlab, ylab) for all of plots. I have already left
some margin by resetting omi values in par() and hided all (xlab, ylab) for
each sub-plot. Could anyone tell me how to do that?
Thanks a lot,
Frank
2004 Jun 11
2
Sweave and multiple graphs
Dear list,
I am using Sweave to build a small report. I want to produce a series of
figures, each figure containing a number of plots and then have them
included in the Sweave file.
An example would be to :
postscript(file = "ANCbwplot%03d.eps", onefile = FALSE, other options...)
oldpar <- par(mfrow = c(2,2))
....
do lots of plots to produce a number of eps files
....
par(oldpar)
2002 Jun 17
2
layout() and postscript()
HI,
I would like to know if it's possible to create a postscript file with
multiple graphs . I'm creating some graphs by the means of a loop and I want
to save each graph in the same file (splitting making the device by the
number of graphs).
Do I have to use the par(matrix()) option, the layout() function or the
split.screen() one ?
Thanks
Nolwenn
2005 Apr 29
2
Automating plot labelling in custom function in lapply() ?
Dear List,
Consider the following example:
dat <- data.frame(var1 = rnorm(100), var2 = rnorm(100),
var3 = rnorm(100), var4 = rnorm(100))
oldpar <- par(mfrow = c(2,2), no.readonly = TRUE)
invisible(lapply(dat,
function(x) {
plot(density(x),
main = deparse(substitute(x))) }
)
)
2006 Apr 28
4
par(mfror=c(1,2))
dear list,
i have a problem using the par function.
in one graphic device i want to have two plots so i tried to use
par(mfror=c(1,2)).
of course it worked out, but the height now is twice the length of the width
for each single plot.
what i actually wanted is something like par(mfrow=c(2,2)) where only the
top (or bottom)
two plots are drawn with entire length proportions of 1 to 2 ( height 1,
2006 Oct 31
3
one problem about how to hold graphic with R
Sorry to disturb you, but can you help me to solve one little problem?
I want to draw a graphic after another with R
but I cannot find the first one after that.
Do you know the command to hold the graphic with R?
I remember with Matlab you may use "hold on".
Thanks.
--
Baohua Yang
Email:yangbaohua@gmail.com
[[alternative HTML version deleted]]
2012 Jul 26
3
Adjust the position of main in par(mfrow)
hey guys
I want two plots in one window with an overall title and with individual
titles for each plots.
my code:
par(mfrow=c(2,1))
bp_dirverq1=boxplot(dirverq1, col="orange",horizontal=TRUE, main="Q1
2012",cex.main=0.7)
bp_dirverq2=boxplot(dirverq2, col="orange",horizontal=TRUE, main="Q2
2012",cex.main=0.7)
title("Direktveranlagung in
2002 Oct 28
3
changing coordinates?
I just detected R and have, after browsing the manual, one question:
I look for quite a lot of time for graphical software which allows to
plot data from a table or external file _with the axes of the coordinate
system changed_, i.e. the x-axis should run from top left to bottom
left, and the y-axis from top-left to top-right. It is of no use to
interchange the rows in the table, the
2002 Sep 23
4
Overall Title in par(mfrow)
Hi,
Say I did something like:
par(mfrow = c(1, 2))
plot(1:10)
plot(1:10)
and I'd like to have an overall title, i.e. a title that would appear,
centered, on the top of both plots, rather than the top of the last plot.
I tried:
title("FOO", outer = T)
but it doesn't appear right. Half of the FOO is outside the figure region
and can't be seen...
Is there another
2004 Jul 30
0
How to put multiple plots in the same window? (not par(mf row=))
Lattice graphics may be the answer depending on your exact problem.
Here is an example of four traditional plots without space:
par(mfrow=c(2,2), omi=c(.5, .5, .5, .5))
par(mar=c(0, 2, 2, 0))
plot(rnorm(10), rnorm(10), axes=FALSE)
box(); axis(2); axis(3)
par(mar=c(0, 0, 2, 2))
plot(rnorm(10), rnorm(10), axes=FALSE)
box(); axis(3); axis(4)
par(mar=c(2, 2, 0, 0))
plot(rnorm(10),
2017 Jul 23
3
par(mfrow) for heatmap plots
Hi,
I was trying to use par(mfrow) to put 4 heatmaps on a single page. However,
I get one plot per page and not one page with 4 plots. What should I
modify? Test code is given below:
test = matrix(rnorm(60), 20, 3)
pdf(file='test.pdf',width=10,height=8)
par(mfrow=c(2,2))
heatmap(test)
heatmap(test)
heatmap(test)
heatmap(test)
dev.off()
thanks!
[[alternative HTML version deleted]]
2007 Dec 27
1
warning on gamma option in par(args) or calling par(= new)?
Dear All,
I have the following function
tstpar <-
function(n = 200, want.pdf = FALSE, pdfFileName = NULL){
oldpar <- par(no.readonly = TRUE)
on.exit(par(oldpar))
steps <- seq(from = 1, to = 8, by = 1)
h <- 10; w <- 6
if(want.pdf){pdf(file = pdfFileName, onefile = TRUE,
paper = "letter", width = w, height = h)}
par(mfrow = c(4,2))
for(i
2010 Feb 18
2
problem with multiple plots (mfrow, mar)
Dear R-users,
I often stack plots that have the same x-axis. To save space and have
the plots themselves as large as possible I like to minimize the margins
between the plots to zero. I use the "mfrow" and "mar" parameters to
achieve this.
However, the different margin settings for the individual plots lead to
the inner plots being higher than the two outer plots. To make the
2008 Aug 05
2
creating overall title for plots made with par(mfrow=c(2,2))
I'm making some plots on the same page and would like to include an overall
title instead of individual main titles as they are similar and their x and
y axis labels are sufficient to distinguish them.
Is there a way to assign an overall "main" to this page of plots?
Mark
--
Mark W. Kimpel MD ** Neuroinformatics ** Dept. of Psychiatry
Indiana University School of Medicine
15032
2003 Nov 04
2
more barplot presentation questions
Thanks to those who pointed me at the solutions to the legend overprinting the bars. I took the "easy" way of rescaling the y axis, picking the scaling factor for stacked bars is somewhat problematic but sufficient for my application.
I have another couple of barplot questions:
- Can I extend the major ticks on the Y axis across the page? Or both axes to form a grid?
- A really
2009 Oct 12
1
Invoking par(mfrow...) on an already subdivided plot
I'd like to generate on a single device multiple plots, each of which
contains two plots. Essentially, I've got sub-plots which consist of
two tracks, the upper one displaying gene expression data, and the
lower one mapping position. I'd like to display four of these
two-track sub-plots on one device, but I can't seem to invoke the
par(mfrow=...) or layout(matrix(...)) functions at
2005 Apr 06
2
par(mfcol=2, mfrow=3) equivalent for trellis
Dear friends of lattice,
I know how to position trellis plots with print(...,split,more=T) or
(...position).
Sometimes I wish I had something like the old "par(mfcol=2, mfrow=3)"
mechanism, where the next free viewport is automatically chosen. I tried
fiddling with grid-viewports, but could not find an easy solution.
Did I miss something?
Dieter Menne
2006 Jul 10
1
par(mfrow,mai) and multiple plot problem
Hi
I'm having difficulty with a multiple plot. What I want is 12
plots, all of which are the same size and shape, differing
only in colour. Each one is a square, so there is an asp=1
in the plot call. I'm working in an Sweave environment so I
am free to choose the height and width of the plot.
I want the columns to be labelled at the head (here t=1,2,3)
and the rows to be labelled at
2008 Jun 10
2
par(mfrow=c(4,2)) vs. lattice
I have had good sucess with the par(mfrow=c(#,#)) for formating graphs and
they look good to me. I have seen a lot of use of the lattice package and
thought I would go fishing on the list for y'all's comments. Is there a
time when lattice would be easier more appropriate for certain graphics over
par(mfrow(#,#)).
Just wondering
Stephen
--
Let's not spend our time and resources
2006 Oct 08
2
Size problem with two dotcharts side by side
Dear all,
I'm trying to produce two dotcharts side-by-side within a Sweave
document. When I'm compiling this example:
\documentclass{article}
\begin{document}
<<fig=T,width=8,height=4>>=
par(mfrow = c(1, 2), cex = 0.7)
for(i in 1:2) dotchart(1:10)
@
<<fig=T,width=8,height=4>>=
par(mfrow = c(1, 2), cex = 0.7)
for(i in 1:2) hist(1:10)
@