plotAna <- function(sweep_data,
anaDef = getAnadef(sweep_data),
sweeps = 1:ncol(sweep_data$y),
xlim = getAnadef(sweep_data)$cursors$zoom$range,
...) {
# if only one sweep is slected, we have to select the correct eventcursors
if(length(sweeps)==1){
swp<-paste0("s",sweeps,":")
}else{
swp=NA
}
anaDef$cursors <- series_events(anaDef$cursors, sweep_data, swp)
if (is.null(anaDef$plot.fun)) {
anaDef$plot.fun <- default.plot.fun
}
sweep_data2 <- calculate.cursors(sweep_data, anaDef)
anaDef$plot.fun(
sweeps_data = sweep_data2,
cursors = anaDef$cursors,
sweeps = sweeps,
xlim = xlim,
...
)
}
getAnadef <- function(sweep_data) {
if (exists("CURSORS")) {
CURSORS[[sweep_data$Stimulus]]
} else {
NULL
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.