R: How can I make a barplot with labels parallel (horizontal) to bars

后端 未结 2 1360
挽巷
挽巷 2021-02-05 05:18

In barplot, is it possible to make the labels parallel to the bars?

Suppose we have the data frame called \"data\".

              Page   PV UniquePgv
1 /         


        
2条回答
  •  清酒与你
    2021-02-05 05:53

    You can use the las graphics parameter. However, if you do that, the names will run off the end of the window, so you need to change the margins. For example:

    par(mai=c(1,2,1,1))
    barplot(data$PV,main="Page Views", horiz=TRUE,names.arg=names,las=1)
    

    enter image description here

提交回复
热议问题