rotating axis / mtext labels

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

rotating axis / mtext labels

IAIN GALLAGHER
Hello list.

Is it possible to use par(srt=45) to rotate text by 45 degrees along the
x-axis of a plot. Using:

<code>

x_names<-c("C57 Nv", "C57 Vacc", "129 Nv", "129 Vacc", "IFNgR Nv", "IFNgR Vacc")
par(srt=45)
mtext(font=2, x_names, side=1, line=1, at=l, cex=1.2)
par(srt=0)

</code>

doesn't seem to work in R 2.2.0 on SUSE linux.

Suggestions would be appreciated thanks.

Iain

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: rotating axis / mtext labels

Uwe Ligges
Iain Gallagher wrote:

> Hello list.
>
> Is it possible to use par(srt=45) to rotate text by 45 degrees along the
> x-axis of a plot. Using:
>
> <code>
>
> x_names<-c("C57 Nv", "C57 Vacc", "129 Nv", "129 Vacc", "IFNgR Nv", "IFNgR Vacc")
> par(srt=45)
> mtext(font=2, x_names, side=1, line=1, at=l, cex=1.2)
> par(srt=0)
>
> </code>
>
> doesn't seem to work in R 2.2.0 on SUSE linux.
>
> Suggestions would be appreciated thanks.


mtext does not support string rotation. You can rather use text() with
par(xpd=TRUE) if you need it.

Uwe Ligges

> Iain
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: rotating axis / mtext labels

Marc Schwartz (via MN)
In reply to this post by IAIN GALLAGHER
On Wed, 2006-02-08 at 10:33 +0000, Iain Gallagher wrote:

> Hello list.
>
> Is it possible to use par(srt=45) to rotate text by 45 degrees along the
> x-axis of a plot. Using:
>
> <code>
>
> x_names<-c("C57 Nv", "C57 Vacc", "129 Nv", "129 Vacc", "IFNgR Nv", "IFNgR Vacc")
> par(srt=45)
> mtext(font=2, x_names, side=1, line=1, at=l, cex=1.2)
> par(srt=0)
>
> </code>
>
> doesn't seem to work in R 2.2.0 on SUSE linux.
>
> Suggestions would be appreciated thanks.
>
> Iain


See R FAQ 7.27 How can I create rotated axis labels:

http://cran.r-project.org/doc/FAQ/R-FAQ.html#How-can-I-create-rotated-axis-labels_003f

HTH,

Marc Schwartz

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html