Plot a representative spontaneous current trace
Source:R/Plot-data.R
plot_spontaneous_current_trace.Rd
plot_spontaneous_current_trace()
generates a plot of raw current amplitude
over time for a specified sweep from an ABF file. It requires a dataframe
generated from raw .abf data with import_ABF_file()
. The function returns a
ggplot object with an optional scale bar.
Usage
plot_spontaneous_current_trace(
file,
plot_colour,
include_scale_bar = "yes",
plot_episode = "epi1",
scale_bar_x_start = 1.25,
scale_bar_x_length = 0.5,
scale_bar_y_start = 15,
scale_bar_y_length = 20,
plot_x_min = 1,
plot_x_max = 5,
plot_y_min = -100,
plot_y_max = 35,
save_plot_pngs = "no"
)
Arguments
- file
A dataframe containing at least these columns:
time
,episode
,current
,voltage
,time_sec
. An easy way to obtain this is by importing a raw .abf file through theimport_ABF_file()
function.- plot_colour
A character value naming the colour of the plot.
- include_scale_bar
A character value that determines if a scale bar will be added to the plot. Allowed values are "yes" and "no".
- plot_episode
A character value describing the sweep (e.g.
epi1
) that will be used for the plot.- scale_bar_x_start
A numeric value describing the x-axis position of the scale bar.
- scale_bar_x_length
A numeric value describing the horizontal span (in seconds) of the scale bar. This will automatically be converted and displayed in milliseconds.
- scale_bar_y_start
A numeric value describing the y-axis position of the scale bar.
- scale_bar_y_length
A numeric value describing the vertical span (in pA) of the scale bar.
- plot_x_min
A numeric value describing the minimum value on the x-axis (in seconds).
- plot_x_max
A numeric value describing the maximum value on the x-axis (in seconds).
- plot_y_min
A numeric value describing the minimum value on the y-axis (in pA).
- plot_y_max
A numeric value describing the maximum value on the y-axis (in pA).
- save_plot_pngs
A character ("yes" or "no") defining if the plot should be saved as a PNG through
ggplot::ggsave()
.