NeuroPlots
Documentation for NeuroPlots.
NeuroPlots.ResizeableArtistNeuroPlots.best_scalebar_sizeNeuroPlots.downsamp_patchNeuroPlots.edgefixNeuroPlots.make_dummy_lineNeuroPlots.plot_multi_patchNeuroPlots.plot_offsetsNeuroPlots.plot_spacingNeuroPlots.plot_vertical_spacingNeuroPlots.point_boxesNeuroPlots.raster_plotNeuroPlots.resizeable_spectrogramNeuroPlots.tonumpy
NeuroPlots.ResizeableArtist — Type
Base type for resizeable artists, must implement a setdata method and have a baseinfo field"
NeuroPlots.best_scalebar_size — Function
function best_scalebar_size(
axis_begin::Real,
axis_end::Real,
target_frac::AbstractFloat,
axis_unit_pow10::Integer = 0;
bases = [10, 5, 2, 1],
base_penalties = [0, 5, 10, 20],
target_frac_penalty = 50
)
-> (scalebar_ax_size::Float64, scalebar_units::Int, scalebar_prefix::String)Finds the best scale bar size for an axis with limits axis_begin and axis_end, where the target scale bar fraction of the axis is target_frac. target_frac must be between 0 and 1. The axis may optionally have units other than natural (e.g. if axis units are uV, then set axis_unit_pow10 = -6).
Returns the size of the scalebar in axis units, scalebar_ax_size, the display size, scalebar_units, as well as the base 10 prefix for the scalebar units, scalebar_prefix, e.g. 'k' for 10^3, 'm' for 10^-3 etc.
Rounding is done to match the scalebar to the nearest base specified in bases. Which base is chosen based on base_penalties and target_frac_penalty to minimize target_frac_penalty * abs(frac_at_base - target_frac) + base_penalty. base_penalties and bases must be the same length.
NeuroPlots.downsamp_patch — Method
downsamp_patchPlot a signal as two lines and a fill_between polygon
NeuroPlots.edgefix — Method
Adjust the fraction away from 0 and 1, if possible, otherwise return nothing
NeuroPlots.make_dummy_line — Method
Make a line with place-holder data
NeuroPlots.plot_multi_patch — Method
plot_multi_patchPlot a list of DownSampler objects
NeuroPlots.plot_offsets — Function
plot_offsets(n_line, spacing[, offset = 0])Calculate the offset for each of n_line number of plots with spacing in between them. Optionally start the first line at offset.
NeuroPlots.plot_spacing — Method
plot_spacing(extents[, scale_factor = 1.2])Calculate the spacing between dataseries for plotting, which is the mean of the extents times an optional scale factor.
NeuroPlots.plot_vertical_spacing — Method
plot_vertical_spacingplot a vector of signals with equal y-spacing between them.
The spacing between signals is calculated from y-extent of the signals.NeuroPlots.point_boxes — Method
point_boxesPlot a set of points with boxes around each point, merging if necessary.
NeuroPlots.raster_plot — Function
function raster_plot(
ax::Py,
ticks::AbstractVector{AbstractVector{<:AbstractVector{<:Number}}},
pre = 0,
post = mapreduce(maximum, max, ticks, init = 0),
patch_sets::Union{
Nothing,
AbstractVector{<:AbstractVector{<:AbstractVector}}
} = nothing;
tick_plot_args = (:color => "k",),
patch_plot_args = [(:facecolor => "#9ecae1",), (:facecolor => "#deebf7",)],
top_level::Bool = true
)Make a rasterplot for the activity of multiple units, while also displaying the discrete presence of some behavioral information, such as song syllables, for each trial.
NeuroPlots.resizeable_spectrogram — Function
resizeable_spectrogram(ax, args...; [listen_ax, toplevel], kwargs...)plot the spectrogram of a signal in a resizeable context
NeuroPlots.tonumpy — Method
Convert a Julia array to a numpy ndarray for passing to pyqtgraph.