diff options
author | Suraj Yerramilli | 2016-02-23 10:35:21 +0530 |
---|---|---|
committer | Suraj Yerramilli | 2016-02-23 10:35:21 +0530 |
commit | cd227908cdbb0dbd51d6da70ad14f87950bb02b0 (patch) | |
tree | 46cfbe84c032b16b40a91d8a57ee421fd8bf0aac | |
parent | 2fad722f972bc590b18b91c76b2c0541dac6318c (diff) | |
download | SysID-R-code-cd227908cdbb0dbd51d6da70ad14f87950bb02b0.tar.gz SysID-R-code-cd227908cdbb0dbd51d6da70ad14f87950bb02b0.tar.bz2 SysID-R-code-cd227908cdbb0dbd51d6da70ad14f87950bb02b0.zip |
added title for each channel in bode plot
-rw-r--r-- | R/idframe.R | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/R/idframe.R b/R/idframe.R index 8ee668e..566a254 100644 --- a/R/idframe.R +++ b/R/idframe.R @@ -181,12 +181,15 @@ plot.idfrd <- function(x,col="steelblue",lwd=1){ df <- data.frame(Frequency=x$freq[,],Magnitude=mag[i,], Phase = phase[i,]) melt_df <- reshape2::melt(df,id.var="Frequency") + yindex <- (i-1)%/%nin + 1;uindex <- i-nin*(yindex-1) + subtitle <- paste("From: u",uindex," to y",yindex,sep="") g[[i]] <- ggplot(melt_df, aes(Frequency, value)) + geom_line(size=lwd,color=col) + scale_x_log10() + facet_grid(variable ~ .,scale="free") + - theme_bw(14,"sans") + ylab("") + - theme(axis.title.x=element_text(size=11)) + - geom_vline(xintercept=max(x$freq),size=1.2) + theme_bw(14,"sans") + ylab("") + ggtitle(subtitle) + + theme(axis.title.x=element_text(color = "black",face = "plain"), + title=element_text(size=9,color = "gray",face="bold")) + + geom_vline(xintercept=max(x$freq),size=1) } multiplot(plotlist=g,cols=nin) |