summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--R/idframe.R9
-rw-r--r--man/plot.idframe.Rd5
2 files changed, 10 insertions, 4 deletions
diff --git a/R/idframe.R b/R/idframe.R
index 2bb416b..22a36ac 100644
--- a/R/idframe.R
+++ b/R/idframe.R
@@ -57,6 +57,7 @@ idframe <- function(output,input=NULL,Ts = 1,start=0,end=NULL,
#' @param col line color, to be passed to plot.(Default=\code{"steelblue"})
#' @param lwd line width, in millimeters(Default=\code{1})
#' @param main the plot title. (Default = \code{NULL})
+#' @param size text size (Default = \code{12})
#'
#' @examples
#' data(cstr)
@@ -65,7 +66,7 @@ idframe <- function(output,input=NULL,Ts = 1,start=0,end=NULL,
#' @import ggplot2 reshape2
#'
#' @export
-plot.idframe <- function(x,col="steelblue",lwd=1,main=NULL){
+plot.idframe <- function(x,col="steelblue",lwd=1,main=NULL,size=12){
if(nInputSeries(x)==0){
data <- outputData(x)
} else{
@@ -74,8 +75,10 @@ plot.idframe <- function(x,col="steelblue",lwd=1,main=NULL){
}
ggplot(melt(data.frame(time=as.numeric(time(data)), data), id.vars="time"),
aes(time, value)) + geom_line(size=lwd,color=col) +
- facet_grid(variable ~ .,scale="free") + theme_bw(14) + ylab("") +
- theme(axis.title.x=element_text(size=11)) + ggtitle(main)
+ facet_grid(variable ~ .,scale="free") + theme_bw(size) +
+ ylab("Amplitude") + ggtitle(main) +
+ xlab(paste("Time (",x$unit,")",sep=""))
+ #theme(axis.title.x=element_text(size=11)) + ggtitle(main)
}
#' @export
diff --git a/man/plot.idframe.Rd b/man/plot.idframe.Rd
index a925b29..2a34888 100644
--- a/man/plot.idframe.Rd
+++ b/man/plot.idframe.Rd
@@ -4,7 +4,8 @@
\alias{plot.idframe}
\title{Plotting idframe objects}
\usage{
-\method{plot}{idframe}(x, col = "steelblue", lwd = 1, main = NULL)
+\method{plot}{idframe}(x, col = "steelblue", lwd = 1, main = NULL,
+ size = 12)
}
\arguments{
\item{x}{an \code{idframe} object}
@@ -14,6 +15,8 @@
\item{lwd}{line width, in millimeters(Default=\code{1})}
\item{main}{the plot title. (Default = \code{NULL})}
+
+\item{size}{text size (Default = \code{12})}
}
\description{
Plotting method for objects inherting from class \code{idframe}