PhysiologyPlotting methods
To load PyPlot as a backend, export it with
using PhysiologyPlotting
using PyPlot
PhysiologyPlotting.plot_experiment
— Methodplot_experiment(axis::T, exp::Experiment; kwargs...)
plot_experiment(axis::Vector{T}, exp::Experiment; kwargs...)
plot_experiment(exp::Experiment; kwargs...)
Plot the experiment data on the given axis or axes.
Arguments
axis
: The axis to plot the data on.exp
: TheExperiment
object containing the data.
Keyword Arguments
channels
: Channels to plot (default: 1).sweeps
: Sweeps to plot (default: :all).yaxes
: Whether to display the y-axis (default: true).xaxes
: Whether to display the x-axis (default: true).xlims
: X-axis limits (default: nothing).ylims
: Y-axis limits (default: nothing).color
: Color or colormap for the plot (default: :black).cvals
: Custom color values (default: nothing).clims
: Color limits for colormap (default: (0.0, 1.0)).ylabel
: Y-axis label (default: nothing).xlabel
: X-axis label (default: nothing).linewidth
: Line width for the plot (default: 1.0).layout
: Layout for multiple plots (default: nothing).channels
: Channels to plot (default: nothing).st
: Style of the plot, can be :trace, :waveplot, or :trace3D (default: :trace).
kwargs
: These are keyword arguments common to PyPlot.jl. Please see: https://github.com/JuliaPy/PyPlot.jl or https://matplotlib.org/stable/index.html for further documentation
Returns
- The plot object.
Examples
plot_experiment(axis, my_experiment; channels=1, sweeps=:all)
PhysiologyPlotting.add_scalebar
— Method add_scalebar(axis, loc::Tuple{T,T}, dloc::Tuple{T,T};
fontsize=10.0, lw=3.0, xlabeldist=30.0, ylabeldist=15.0,
xunits="ms", yunits="μV", xconvert=1000.0, yconvert=1.0, xround=true, yround=true, kwargs...) where {T<:Real}
Add a scale bar to the plot at the specified location.
Arguments
axis
: The axis to add the scale bar to.loc
: The (x, y) location where the scale bar starts.dloc
: The (dx, dy) dimensions of the scale bar.
Keyword Arguments
fontsize
: Font size for the scale bar labels (default: 10.0).lw
: Line width of the scale bar (default: 3.0).xlabeldist
: Distance for the x-axis label (default: 30.0).ylabeldist
: Distance for the y-axis label (default: 15.0).xunits
: Units for the x-axis (default: "ms").yunits
: Units for the y-axis (default: "μV").xconvert
: Conversion factor for x-axis units (default: 1000.0).yconvert
: Conversion factor for y-axis units (default: 1.0).xround
: Whether to round the x-axis label (default: true).yround
: Whether to round the y-axis label (default: true).
Examples
add_scalebar(axis, (0.0, 0.0), (1.0, 1.0))
PhysiologyPlotting.add_sig_bar
— Method add_sig_bar(axes, x::Real, y::Real;
level = "*", color = :black, pointer = false,
pointer_dx = 0.5, pointer_ylims = [2.0, 3.0],
lw = 1.0, fs = 12.0, ls = "solid")
add_sig_bar(axis, xs::Vector{T}, ys::Vector{T}; kwargs...) where T <: Real
Add a significance bar to the plot at the specified x and y coordinates.
Arguments
axes
: The axis or axes to add the significance bar to.x
,y
: The x and y coordinates for the significance bar.
Keyword Arguments
level
: Significance level (default: "*").color
: Color of the significance bar (default: :black).pointer
: Whether to include a pointer (default: false).pointer_dx
: Horizontal distance for the pointer (default: 0.5).pointer_ylims
: Vertical limits for the pointer (default: [2.0, 3.0]).lw
: Line width (default: 1.0).fs
: Font size (default: 12.0).ls
: Line style (default: "solid").
Examples
add_sig_bar(axis, 1.0, 2.0; level="*")
PhysiologyPlotting.draw_axes_border
— Method draw_axes_border(ax; lw = 2.5, color = :black)
Draw a border around the axes.
Arguments
ax
: The axis to draw the border around.
Keyword Arguments
lw
: Line width (default: 2.5).color
: Color of the border (default: :black).
Examples
draw_axes_border(ax; lw=2.5)