0

I am using the twoord.plot function in the plotrix package and need to rotate the X Axis tick labels 45 degrees. Anyone know how to do so?

Joris Meys
  • 106,551
  • 31
  • 221
  • 263
ansek
  • 443
  • 3
  • 17
  • If you post some example code it will be easier to help you. See http://stackoverflow.com/q/5963269/602276 – Andrie May 21 '11 at 06:50
  • @Ben Bolker : any reason this got the r-faq tag? – Joris Meys May 23 '11 at 16:17
  • well, the solution to "how do I get rotated labels" is in the R FAQ ... or should the r-faq tag be reserved for "questions which are frequently asked on SO"? – Ben Bolker May 23 '11 at 18:28
  • @BenBolker : Ah yeah, you might have missed the discussion in the chat. It was indeed meant to be used for questions frequently asked on SO. So I'll remove it again, but if the question comes up again, it can always be added. – Joris Meys May 26 '11 at 15:30
  • refer to this answer **https://stat.ethz.ch/pipermail/r-help/2014-July/420223.html**,it may help. – tac Apr 10 '19 at 09:17

1 Answers1

2

You need to suppress the usual labeling and put your desired labeling in with text(..., srt=45). Since by default text only goes in the plot region, the y argument may need to be negative, and you will need to extend the plotting region by "lowering" the third argument to usr. This is all described in the R-FAQ.

IRTFM
  • 258,963
  • 21
  • 364
  • 487
  • I tried your suggestion and unfortunately it didn't work. I took a look at the code for the `twoord.plot()` function and it sets many of these parameters in the function which appear to override my temporary global changes of `par()`. Any thoughts? I'm going to try making a custom version of the function which would contain the text rotation using `text(..., srt=45)` as you suggested. – ansek May 22 '11 at 16:04