AddLinesToRasterPlot: Add eg voltage traces to existing spike raster plot

Description Usage Arguments Details See Also Examples

Description

First thing this does is scale waves to 0-1 range using scale.ts Assumes that number of waves and number of boxes (odours) on spike raster plot actually match. It doesn't check!

Usage

1
AddLinesToRasterPlot(waves, ylim, col = "black", ...)

Arguments

waves

an mts object

ylim

min and max value to plot y axis of wave data (eg voltage)

col

vector or function of colours that will be passed to lines

...

additional arguments passed to lines.ts function

Details

If col is a function then it will be called with the number of waves

See Also

PlotRasterFromSweeps,lines

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
## Not run: 
# First plot the rasters
spikes8=CollectSpikesFromSweeps('/Volumes/JData/JPeople/Shahar/Data/120308/nm20120308c0',8)
spike8_split=split(spikes8)
PlotRasterFromSweeps (spike8_split)
# Now plot the voltages
avgwaves=read.table(
  '/Volumes/JData/JPeople/Shahar/Data/120308/nm20120308c0/008_Avg_RG0_A0++.txt',
  header=T)
avgwavests=ts(avgwaves,start=0,freq=10)
AddLinesToRasterPlot(avgwavests,col='red')
# same but with rainbow colouring
PlotRasterFromSweeps (spike8_split)
AddLinesToRasterPlot(avgwavests,col='red')
# same but voltage lines underneath spikes
PlotRasterFromSweeps (spike8_split, panel.first=AddLinesToRasterPlot(avgwavests,col='red'))
# same but without spikes or dividers
PlotRasterFromSweeps (spike8_split,PlotSpikes=FALSE,PlotDividers=FALSE)
AddLinesToRasterPlot(avgwavests,col='red')

## End(Not run)

jefferis/gphys documentation built on June 5, 2019, 9:45 p.m.