Displaying 20 results from an estimated 10000 matches similar to: "How to add a common title (or xlab, ylab) for multi-plots in the same window?"
2006 May 12
4
Title of page with multiple plots
I want to place four plots on a page, and I would like to have all four
plots share a common title. I have tried the following code, but the
title is centered over the fourth graph and not centered across all four
plots. Does anyone have any suggestions?
R 2.1.1
windows xp
oldpar<-par(mfcol =c(1,4),ask=TRUE)
plot(p,varp)
plot(p,SEp)
plot(p,CVp)
plot(p,ppval)
title(paste("P and 95%CI
2007 Apr 27
1
Write text in the
Hey Felix,
So basically what you want is a figure containing a block of four plots, with a main title for the figure? If that's the case then something like this should work:
# BEGIN CODE #
par(oma=c(0,0,1,0), mfrow=c(2,2))
for(i in 1:4){
plot(NA,xlim=range(0,10),ylim=range(-5,5))
title(paste("Plot ",i,sep=""))
}
par(mfrow=c(1,1), oma=c(0,0,1,0))
mtext("Main
2003 Jan 22
1
self-split plot on multiple device
Hello!
I would plot more than 10 (this number is always different)
graphics on a figure with layout like 'mfrow=c(4,2)'.
There is some existing function able to open the right number of
device if number of graphics is done or I have to build it myself
with some 'IF.....ELSE.....'?
Thanks.
A.S.
----------------------------
2012 Sep 02
2
Impact of cex changing as a function of mfrow
R 2.15.1
OS X (MLion)
Colleagues,
I am aware that changes in mfrow / mfcol in par() affect cex (from help: In a layout with exactly two rows and columns the base value of ?"cex"? is reduced by a factor of 0.83: if there are three or more of either rows or columns, the reduction factor is 0.66).
I generate a multipage PDF in which mfrow varies such that cex is impacted. This affect
2012 Jun 20
2
Figure title
Hi,
I created several figures and their titles should appear like this:
Figure 1: Monte Carlo results for alternative estimators of structural
parameters (N = 100, T = 5)
Because N and T change across figures, my code includes the following lines:
N.set <- 100
T.set <- 5
mtext(“Figure 1: Monte Carlo results for alternative estimators of
structural
2008 Jul 02
2
position legend below x-axis title
Dear helpers,
I'm using a R script on several different datasets, which makes that
axis scales may vary quite a lot from dataset to dataset. So what I'm
looking for now, is how to automagically find out how to position the
legend (horizontal) in the space below the x-axis title, and how to
make sure that the legend is within the limits of the lower inner or
outer margin?
I'm aware of
2007 Feb 20
1
Help with xlab and ylab distance from axes
Dear r-helpers,
In basic graphics, I have a figure with x and y axes suppresed. I
would like to move the xlab and the ylab closer to the axes. Do I
have to use mtext()?
_____________________________
Professor Michael Kubovy
University of Virginia
Department of Psychology
USPS: P.O.Box 400400 Charlottesville, VA 22904-4400
Parcels: Room 102 Gilmer Hall
McCormick Road
2007 Jan 16
1
Help with labeling a page with multiple graphs.
Hi,
I am trying to output pdf files with 8 graphs per page. My current study
has 8 evaluation criteria, and 38 study conditions. This would result in
38 pages of 8 graphs. I have figured out how to get the graphs looking
like I would like them, and I am using the layout() function to put them
on the page, as that allows me the control I would like over the
appearance of the individual plots.
2011 Mar 10
1
Main title in a multiple display of graphs
Hello!
I want to display four xyplots in the same window (sorry if I don't use the propers words, but my English is rude)
I know that if I use plot(y~x) then
x=(1:100)
y=(1:100)
par(mfrow=c(2,2))
plot(y~x)
plot(y~x)
plot(y~x)
plot(y~x)
would give what I want, but this is not the case because I need the functions of xyplot.
So I did the following:
plot.new()
2004 Jul 19
10
How to compare X1 = X2 = ... = Xn?
Dear All,
I have a data frame with n columns: X1, X2, ., Xn. Now I want to create a
new column: if X1 = X2 = . = Xn, the value is 1; Otherwise, the value is 0.
How to do that in a quick way instead of doing (n choose 2) comparisons?
Thank you,
Frank
[[alternative HTML version deleted]]
2013 Jan 07
1
Changing mtext direction, or using text for the margin?
Hi all,
I have read through the archives, but can't find a solution to this problem.
I need the text direction on "dependent B", plotted in margin 4, to go
top to bottom (opposite what it is now). Here's some sample code:
#plot with mtext example
par(mgp = c(2,1,0), mfrow=c(2,2), las=1, mar=c(2,2,2,2), omi=
c(0.5,0.2,0,0.2))
a<-1:10
b<-7:16
c<-21:30
plot(a~b,
2012 Apr 06
1
Saving multiple plots using tiff function
Dear R experts,
I am trying to save three plots using tiff graphics devices; however the
following code only produces two files (Rplot002.tif and Rplot003.tif)
showing figures 1 and 3. Here is a simplified ex code
tiff(filename ="Rplot%03d.tif",width=24,height=20,units="cm",res=300,
pointsize=10, compression = "lzw")
plot(1)
mtext("Fig
2009 Jun 22
2
Help needed: Fraction for Histogram > 1 ???
I have been trying to draw histogram for my manscript and found some strange
things that I could not figure out why.
Using the same code listed below I have successfully draw histograms for a
few figures with fraction labeled on Y axis less than 1 (acturally between 0
to 0.1). But one dataset gives the Y axis label 0 to 5 as fraction. This
is not true, as fraction are less than 1, although the
2012 Mar 13
1
size of graphs when using multiple figures by row
Hi all,
I have a basic question concerning graphs in R. I?m using the par()
function and I?m working with multiple figures by row (mfrow) but my the
hight of my figures become compressed. I have 4 rows and 2 columns (because
I want to plot 8 histograms (freq = FALSE ) on it. I know I can adapt my
margins with for example ?oma? and ?mai? but I don?t know how to choose the
size of the figure? I
2003 Feb 06
2
Fw: Plotting in subareas using par(fig=) parameter
Any idea why I can no longer plot two graphs on the same graphics device
using the par(fig=) parameter?
A simpler par(mfrow=c(1,2)) does work, showing the two plots side-by-side,
but I would like the first
to be larger. This simple example fails:
x<-c(1,1,NA,2,2,NA,3,3)
y<-c(2,4,NA,3,5,NA,1,4)
par(fig=c(0,2/3,0,1))
plot(x,y)
par(fig=c(2/3,1,0,1))
qqnorm(x)
When plotted, the last
2004 Aug 20
3
legends on the outside of the "box"
Hi R People:
Here is a simple set of commands:
>x1 <- 1:10
>x2 <- sqrt(x1)
>plot(x1)
>points(x2,col="red",pch=3)
>legend(2,8,legend=c("First","Second"),col=c("black","red"),pch=c(1,3))
>
Fine.
Now, I would like to put the legend box on the outside of the plot itself,
perhaps in the lower
left hand corner.
I've been
2003 Jan 17
2
Re: Universal legend in plot
Dear R-users:
I asked a question on how I can have a universal legend in a plot and
received the following result. I tried using "layout" but I can't seem to
work on the "empty" plot (where I have to have the legend). I tried "oma"
but I couldn't improve the quality of the plot, and that I didn't know how
to specify all the line types using the
2001 Nov 27
2
printing captions in multiple panes
Dear List,
I would like to add captions to a set of graphics. The graphs are each
composed of two scatter plots in an upper and lower pane.
I'd like to add a caption below the lower pane. The troubel I'm hitting is
that in order to fit the caption using mtext, I must increase the margins
for both panes-- these shrinks my plots considerably and leaves a big
blank area.
The second trouble
2004 Jul 30
6
How to put multiple plots in the same window? (not par(mfrow=))
Dear All,
I am sorry if this question has been asked before. Below is my Question:
I want to put several plots in the same window, but I don?t want the blank
space between plots (like par(mfrow=)) --- that makes the plots too small.
Could anyone tell me how to do it?
Thanks a lot.
Frank
2003 Dec 06
1
pdf() function, screen command and graphs
Dear [R]-list,
I am trying to do a pdf() of the following graphs but don't understand
why the pdf() function does produce an empty pdf file.
(I use R1.7.0 on MacOS 10.2.8)
any idea? Is pdf() incompatible with screen?
Thanks a lot,
DLC
## create dataset
x=rnorm(1000,10,2)
y=rpois(1000,5)
## graphs
pdf()
par(col.main=4,omi=c(0,0,1.25,0))
split.screen(c(1,2))