在ggplot和barplot中在上升和下降x轴之间交换

时间:2016-04-23 14:56:46

标签: r sorting plot ggplot2

我知道这应该很简单,之前可能会问过,但我找不到它。我有这个代码用于ggplot中的条形图:

barplot((agg.table.year$prc),axes=T,ylim=c(0,100),
        names.arg = agg.table.year$YR,
        cex.names=0.8,las=2,space=0.5,col="black",density=19,
        main=paste("Fraction of government-funded studies"))

enter image description here

使用相同的数据,x轴(年)是一个因子,以下条形图代码:

@IBOutlet weak var amobBan: GADBannerView!
[•••]
amobBan.delegate = self
amobBan.adUnitID = "ca-app-pub-xxxxxxx" // I used mine in other apps : it works.
amobBan.rootViewController = self // NB: I also tried with tabBarController istead "self"
amobBan.loadRequest(GADRequest())

给出了这个情节:

enter image description here

我没有掌握如何以任何一种方式在升降X轴之间切换,但我绝望地学习。我用Google搜索并阅读了R Cookbook,但我没有得到它。

0 个答案:

没有答案