Displaying 20 results from an estimated 6000 matches similar to: "Write text in the "device region" of a graphic device"
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
2007 May 07
1
different hights & centering in one device region
Hello,
I have a question. I creat a PDF file with four rows and
two cols.
Is it possible to:
-create a plot regions with different hights (example: rows 1 & 2-4)
-ro center an image in the whole width (example: rows 4)
Thank's a lot.
Felix
example:
--------
Title
--------------------------------
|Text |Text |
|Text |Text |
---------------------------------
| | |
| | |
2009 Nov 30
1
Plotting color.legend() outside of plot region
Dear List,
I am trying to plot a color.legend() in the right outer margin of my device region. I have read multiple threads on the subject and still can't get it right. I have stolen an example from one of the threads to demonstrate my problem. I have extended the outer margin using par(oma()), and have used par(xpd=NA) to tell it to plot in the device region. I can get the legend to plot
2012 Jun 02
1
mtext bug
Sir,
I have hit a the limits of my understanding of text / par / opar etc...
I have a few related xts data frames which have multiple columns, and have
written a for-loop to make a set of charts - however i do not get any
margin text when i run the loop.
when i test the code outside of the loop the margin text appears - however
when i run the loop the margin text does not appear ... what gives?
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
2000 Jan 10
1
'at' parameter in mtext(.., adj=0, outer=T) (PR#396)
Depending on the setting of par()$usr,
the 'at' setting in mtext(.., adj=0, outer=T) may cause the
text to appear in an anomalous position (e. g. in the first
instance below, at the left of the plot region rather than
at 'at=0' in the figure region), or the text may not appear
at all.
If one does not set the 'at' parameter the text appears
(with 'adj=0') on the
2012 Oct 23
2
multi-panel figure: overall title for each row
Dear all,
I have a 3x2 plot and in addition to the title of the individual plots I
would like to have an overall title
for each row. I managed to get an overall title for the whole plot matrix
with mtext:
par(mfrow=(c(3,2)), mar=c(6.4,4.5,4.2, 1.8), oma=c(0,0,3,0))
for (i in 1:6)
barplot(sample(1:10,5), main=paste("Plot #",i))
mtext("Overall Title Row 1", outer=TRUE)
but I
2008 Jul 18
1
problem with putting text in outer margins (mtext outer=TRUE)
Hi there,
I'm trying to get some text in the outer margins of my plots and am
having trouble - the margin text is overlapping my plots, even though
the outer margin I'm trying to put it in is very big.
I've simplified my problem down to this:
-------------------------
X11(width=7.5,height=10)
par(mfrow=c(6,1),oma=c(20,0,20,0), mar=c(0,3.1,1,2.1))
for (i in 1:6) {
2008 Jul 08
0
Multiple Plots and y Axis Labels
Hi,
I'm using the mfrow parameter in par() to plot several timeseries with a
common time x axis as a sequence of plots one below the other. I reduced
the top and bottom margins to zero to get a very nice looking plot but
sometimes the labels on the y axes from one plot overlap with the y axis
labels on the plot above or below.
Any ideas how I can prevent this without losing the look of the
2011 Nov 15
1
Plot alignment with mtext
I would like the text plotted with 'mtext' to be alighned like it is for
printing on the console. Here is what I have:
> print(emt)
ME RMSE MAE
MPE MAPE MASE
original -1.034568e+07 1.097695e+08 2.433160e+07 -31.30554 37.47713
1.5100050
xreg 1.561235e+01 2.008599e+03 9.089473e+02 267.05490 280.66734
2007 Sep 02
2
Different behavior of mtext
Dear R Users,
I am quite surprised to see that mtext gives different results when it
is used with 'pairs' and with "plot'. In the two following codes, it
seems that the 'at' argument in mtext doesn't consider the same unit system.
I would appreciate your comments on this issue.
Sebastien
##### Pairs
mydata<-data.frame(x=1:10,y=1:10)
par(cex.main=1,
1998 Jan 13
0
funny axis ranges; GPretty(.) vs. pretty(.) and all that...
[This is something like a bug report;
maybe somewhat longish & technical ..]
As an introduction, just try the following code
(it should work both in R and S).
I think it screws up the postscript() driver both for S and R, but this is
not the issue here.
is.R <- function() { ## returns 'TRUE' iff we are using 'R'
exists("version") && !is.null(vl
2012 Feb 07
1
Problem with plotting a square 1 x 3 plot and placement of outer margin text
Dear R-helpers,
Please see the attached plot.
The problem is that I have too much space between the x-axis label
(which is mtext in an outer margin) and the plots.
My par settings for this plot are:
>par(mfrow=c(1,3),oma=c(2,2,2,2),mar=c(5.1,4.1,4.1,2.1),pty="s")
>#here is the code that produces the three plots, which I have deleted for simplicity
>mtext("Log Wetland
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
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()
2017 Jun 20
1
Help with the plot function
Dear all,
I found the last example of this link (
https://sites.ualberta.ca/~lkgray/uploads/7/3/6/2/7362679/6c_-_line_plots_with_error_bars.pdf)
very similar to the one I need to make for my paper, and I think I got what
I wanted by applying some of the suggestions of this mail list.
Here it is the code I devised (maybe there will be further improvements
from the list):
YEAR <- c(1996 ,
2012 Mar 18
1
problem saving gplot.hexbin using file save as pdf - "Error: invalid graphics state
I can save to png, TIFF and jpg but get an error "Error: invalid graphics
state" when trying to save as pdf and I have to restart R.
This happens when I add mtext lines.
There are a few other questions e.g. I want to move the mtext on side 1 to
the left, but that is the main issue for now.
I'm not using the ylab inside gplot.hexbin because it writes over the
numbers on the axis.
2004 Aug 10
0
Check failed after compilation (PR#7159)
Full_Name: Madeleine Yeh
Version: 1.9.1
OS: AIX 5.2
Submission from: (NULL) (151.121.225.1)
After compiling R-1.9.1 on AIX 5.2 using the IBM cc compiler, I ran the
checks. One of them failed. Here is the output from running the check solo.
root@svweb:/fsapps/test/build/R/1.9.1/R-1.9.1/tests/Examples:
># ../../bin/R --vanilla < stats-Ex.R
R : Copyright 2004, The R
2009 Apr 06
0
mtext problem - grainy and massive file size
Hi Team,
I'm on a mac, 0SX 10.5.6, R 2.7.2.
I consistently make pairs plots and use mtext() to put labels on top of the
plot in the outer margin. All of a sudden, this text has become really
grainy in the final product and is making huge files. I have no idea why
this has just started happening. The only thing I've done lately is install
the new version of GIMP and run the script to
2010 Nov 16
1
Force evaluation of variable when calling partialPlot
Greg,
Two thoughts:
1. It might be possible that 'vars' is a reserved word of sorts and if you change the name of your vector RF might be happier
2. A way that works for me is to call importance as follows:
sel.imp <- importance(sel.rf, class=NULL, scale=TRUE, type=NULL)
and then use the 'names' of the imp data frame to be absolutely clear to RF you are talking about the