对不起,如果重复的话。我似乎在这里或其他解释par和fig的站点上找不到解决方案。
par(mfrow=c(3,2))
sec = df
sec$new[sec$sector=='Apartment']<-TRUE
sec=subset(sec,sec$new==TRUE)
par(fig=c(0.05,0.5,0.66,1),new=TRUE)
scatter.smooth(sec$Look_Back_Months,sec$Ann_TRT_Spread*100, degree =4 , col = "red",pch = 16,main = 'Apartment', ylab = "Annu. Total Return %",xlab = "Months in Look Back Period")
sec = df
sec$new[sec$sector=='Office']<-TRUE
sec=subset(sec,sec$new==TRUE)
par(fig=c(0.5,0.95,0.66,1),new=TRUE)
scatter.smooth(sec$Look_Back_Months,sec$Ann_TRT_Spread*100, degree =4 , col = "red",pch = 16,main = 'Office', ylab = "Annu. Total Return %",xlab = "Months in Look Back Period")
sec = df
sec$new[sec$sector=='Industrial']<-TRUE
sec=subset(sec,sec$new==TRUE)
par(fig=c(0.5,0.95,0.33,0.66),new=TRUE)
scatter.smooth(sec$Look_Back_Months,sec$Ann_TRT_Spread*100, degree =4 , col = "red",pch = 16,main = 'Industrial', ylab = "Annu. Total Return %",xlab = "Months in Look Back Period")
sec = df
sec$new[sec$sector=='Mall']<-TRUE
sec=subset(sec,sec$new==TRUE)
par(fig=c(0.05,0.5,0.33,0.66),new=TRUE)
scatter.smooth(sec$Look_Back_Months,sec$Ann_TRT_Spread*100, degree =4 , col = "red",pch = 16,main = 'Mall', ylab = "Annu. Total Return %",xlab = "Months in Look Back Period")
sec = df
sec$new[sec$sector=='Strip Center']<-TRUE
sec=subset(sec,sec$new==TRUE)
par(fig=c(0.05,0.5,0,0.33),new=TRUE)
scatter.smooth(sec$Look_Back_Months,sec$Ann_TRT_Spread*100, degree =4 , col = "red",pch = 16,main = 'Strip Center', ylab = "Annu. Total Return %",xlab = "Months in Look Back Period")
当我编织时,上面的代码将产生以下页面
为什么不使用整页? 我已经尝试过用无花果进行par测试,但无法显示整页。
对图的编辑很抱歉。数据是轻度敏感的。
谢谢!