1

I created a plot(A, numberOfA) in R. On the X axis, I have A's parameters which the number of them are too many. By default, the plot show them in horizontal direction which isn't interesting when you see it due to the number of A's parameters. I was wondering if an argument exist in the plot function in R to change the direction of parameters on X axis to vertical. I googled, but couldn't find.

Spacedman
  • 92,590
  • 12
  • 140
  • 224
Richard
  • 69
  • 2
  • 10

1 Answers1

1

See las in ?par:

las numeric in {0,1,2,3}; the style of axis labels.

0: always parallel to the axis [default],

1: always horizontal,

2: always perpendicular to the axis,

3: always vertical.

Also supported by mtext. Note that string/character rotation via argument srt to par does not affect the axis labels.

So plot(A, numberOfA, las = 3) should get you the desired result.


And to quickly see it in action:

plot(factor(letters), seq_along(letters))

plot(factor(letters), seq_along(letters), las = 3)

Mikko Marttila
  • 10,972
  • 18
  • 31