Skip to content

Commit

Permalink
fix DDM model density plot
Browse files Browse the repository at this point in the history
  • Loading branch information
itsdfish committed Dec 27, 2023
1 parent b0f9651 commit d8e5cf9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "SequentialSamplingModels"
uuid = "0e71a2a6-2b30-4447-8742-d083a85e82d1"
authors = ["itsdfish"]
version = "0.8.8"
version = "0.8.9"

[deps]
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
Expand Down
14 changes: 9 additions & 5 deletions ext/plots/plot_model.jl
Original file line number Diff line number Diff line change
Expand Up @@ -424,8 +424,10 @@ function plot_top_density!(d::DDM, cur_plot;
pds = gen_pds(d, t_range, n_subplots)
scale_density!(pds, density_scale)
map!(x -> x .+ density_offset, pds, pds)
ymin = minimum(vcat(pds...)) * -1.2
ymax = maximum(vcat(pds...)) * 1.2
pds_vec = vcat(pds...)
filter!(!isnan, pds_vec)
ymin = minimum(pds_vec) * -1.05
ymax = maximum(pds_vec) * 1.05
defaults = get_plot_defaults(d)
return plot!(cur_plot, t_range, pds[1];
ylims = (ymin,ymax), defaults..., kwargs...)
Expand All @@ -437,12 +439,14 @@ function plot_bottom_density!(d::DDM, cur_plot;
pds = gen_pds(d, t_range, n_subplots)
scale_density!(pds, density_scale)
map!(x -> x .+ density_offset, pds, pds)
ymin = minimum(vcat(pds...)) * -1.2
ymax = maximum(vcat(pds...)) * 1.2
pds_vec = vcat(pds...)
filter!(!isnan, pds_vec)
ymin = minimum(pds_vec) * -1.05
ymax = maximum(pds_vec) * 1.05
defaults = get_plot_defaults(d)
dens = -1 * pds[2]
return plot!(cur_plot, t_range, dens;
ylims = (ymin,ymax), defaults..., kwargs...)
defaults..., kwargs...)
end

# function add_mean_drift_rate(model, cur_plot, zs)
Expand Down

0 comments on commit d8e5cf9

Please sign in to comment.