Skip to content

Commit ff28a8b

Browse files
committed
update normalization in plot_conditional_forecast! to replace nothing with NaN
1 parent e953089 commit ff28a8b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ext/StatsPlotsExt.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5239,11 +5239,11 @@ function plot_conditional_forecast!(𝓂::ℳ,
52395239

52405240
view_mat = shock_mat[:, 1:lastcol]
52415241

5242-
# Normalise: replace `nothing` with 0.0
5243-
mat = map(x -> x === nothing ? 0.0 : float(x), view_mat)
5242+
# Normalise: replace `nothing` with NaN
5243+
mat = map(x -> x === nothing ? NaN : float(x), view_mat)
52445244

52455245
# Ignore leading all-zero rows for indexing
5246-
firstrow = findfirst(i -> any(!=(0.0), mat[i, :]), axes(mat, 1))
5246+
firstrow = findfirst(i -> any(!=(NaN), mat[i, :]), axes(mat, 1))
52475247
if firstrow === nothing
52485248
push!(labels, "nothing")
52495249
continue

0 commit comments

Comments
 (0)