-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
project.org] On Behalf Of Greg Snow
Sent: Monday, January 07, 2013 3:59 PM
To: David Winsemius
Cc: r-help; Uwe Ligges; Michael Rennie
Subject: Re: [R] Changing mtext direction, or using text for the
margin?
And look at the grconvertX and grconvertY functions for possibly ways
to
compute positioning information when using text with base graphics.
On Mon, Jan 7, 2013 at 11:35 AM, David Winsemius
<dwinsemius at comcast.net>wrote:
On Jan 7, 2013, at 8:06 AM, Michael Rennie wrote:
Any thoughts on what that dirty hack might be or any leads on where
start? Perhaps a whole new plot region in the margin or something?
even possible? I'm having a difficult time imagining how I can do
The `text` function accepts the 'xpd' argument for `par`.
?par
?text
(Similar but not exactly the same as R-FAQ "7.27 How can I create
axis labels?")
I'm not sure what sort of "dirt" Uwe was expecting, but I'm guessing
meant that you probably were not going to be getting exactly what you
wanted with the first attempt and were going to need to adjust the
locations "by hand" after digging around in the par documentation.
--
David.
Mike
On 07.01.2013 07:00, Michael Rennie wrote:
Hi all,
I have read through the archives, but can't find a solution to
problem.
I need the text direction on "dependent B", plotted in margin 4,
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, ylab="", xlab="", xaxt="n")
axis(1, at=b, labels=FALSE, tick=TRUE)
plot(c~b, ylab="", xlab="", xaxt="n", yaxt="n")
axis(1, at=b, labels=FALSE, tick=TRUE)
axis(4, at=c(22,24,26,28,30), labels=TRUE, tick=TRUE)
plot(a~b, ylab="")
plot(c~b, ylab="", yaxt="n")
axis(4, at=c(22,24,26,28,30), labels=TRUE, tick=TRUE)
mtext(side=1, "independent", outer=TRUE, line=1, padj=1)
mtext(side=2, "dependent A", las=0, outer=TRUE, line=0.25)
mtext(side=4, "dependent B", las=0, outer=TRUE, line=0.25)
I have seen an example in help where i can use text and (srt) to
manipulate this with a single panel plot, but not for a multi-
example. Any help would be greatly appreciated.
You cannot do that with mtext, you rather need a dirty hack with
I believe.
Best,
Uwe Ligges
Cheers,