user2227801
user2227801

Reputation: 85

Change direction labels of axes in plot

In drawing a plot with R, the X-axe labels are horizontal, I want a vertical labels.Is it possible?

For example, such this:

Fig1

Upvotes: 1

Views: 903

Answers (1)

agstudy
agstudy

Reputation: 121568

The question of rotating isduplicated ad is answered many times here. But I add this answer for 2 reasons :

  1. the ticks labels are long so we need to add margins at bottom
  2. the ticks labels are a little bit complicated and created using plotmath

enter image description here This is the code:

par(mar=c(8, 4, 2, 4))
plot(1:5,1:5,xaxt='n',frame.plot=FALSE,xlab='')
expr1 <- expression(L[2](delta[J~S](X,W),theta))
expr2 <- expression(L[4](delta[J~S](X,W),theta))
axis(1,las=2,labels=c(expr1,expr1),at=2:3,pos=1)
arrows(0,1,5,1)

Upvotes: 1

Related Questions