Please see the following MWE below for an issue I am currently facing, I have raised an issue on the Plots.jl repo as well but thought I would ask the community in case people have seen similar bugs, I noted some similar errors but all of them were using DateTime etc. objects which I am not.
using CSV
using DataFrames
using Plots
using StatsPlots
df = DataFrame(real_α = [0.025, 0.025, 0.025, 0.025], synth_α = [0.0, 0.01, 0.02, 0.03], weighted_auc = [0.906731, 0.906168, 0.906171, 0.906015], naive_auc = [0.906617, 0.905932, 0.905828, 0.905758])
function plot_real_α(df, α, divergences, metric, t)
mkpath("src/creditcard/plots/$(t)/")
fdf = filter(row -> row[:real_α] == α, df)
print(fdf)
p = @df fdf plot(
:synth_α,
[cols(Symbol("$(div)_$(metric)") for div in divergences)],
title = "$(metric) divergence comparison, real alpha = $(α)",
label = [div for div in divergences],
xlabel = "Synthetic Alpha",
ylabel = metric,
legendtitle = "Divergence",
)
p = plot!(size=(1000, 700), legend=:outertopright)
png(p, "src/creditcard/plots/$(t)/real_alpha_$(α)__$(metric)")
end
julia > plot_real_α(df, 0.025, ["weighted" "naive"], "auc", t)
4×4 DataFrame
│ Row │ real_α │ synth_α │ weighted_auc │ naive_auc │
│ │ Float64 │ Float64 │ Float64 │ Float64 │
├─────┼─────────┼─────────┼──────────────┼───────────┤
│ 1 │ 0.025 │ 0.0 │ 0.906731 │ 0.906617 │
│ 2 │ 0.025 │ 0.01 │ 0.906168 │ 0.905932 │
│ 3 │ 0.025 │ 0.02 │ 0.906171 │ 0.905828 │
│ 4 │ 0.025 │ 0.03 │ 0.906015 │ 0.905758 │
ERROR: InexactError: trunc(Int64, NaN)
Stacktrace:
[1] trunc at ./float.jl:703 [inlined]
[2] round at ./float.jl:367 [inlined]
[3] (::Colon)(::Float64, ::Float64, ::Float64) at ./twiceprecision.jl:419
[4] get_minor_ticks(::Plots.Subplot{Plots.GRBackend}, ::Plots.Axis, ::Tuple{Array{Float64,1},Array{String,1}}) at /Users/harrisonwilde/.julia/packages/Plots/cc8wh/src/axes.jl:306
[5] axis_drawing_info(::Plots.Subplot{Plots.GRBackend}) at /Users/harrisonwilde/.julia/packages/Plots/cc8wh/src/axes.jl:617
[6] gr_display(::Plots.Subplot{Plots.GRBackend}, ::Measures.Length{:mm,Float64}, ::Measures.Length{:mm,Float64}, ::Array{Float64,1}) at /Users/harrisonwilde/.julia/packages/Plots/cc8wh/src/backends/gr.jl:1331
[7] gr_display(::Plots.Plot{Plots.GRBackend}, ::String) at /Users/harrisonwilde/.julia/packages/Plots/cc8wh/src/backends/gr.jl:716
[8] _show(::IOStream, ::MIME{Symbol("image/png")}, ::Plots.Plot{Plots.GRBackend}) at /Users/harrisonwilde/.julia/packages/Plots/cc8wh/src/backends/gr.jl:1922
[9] show at /Users/harrisonwilde/.julia/packages/Plots/cc8wh/src/output.jl:216 [inlined]
[10] png(::Plots.Plot{Plots.GRBackend}, ::String) at /Users/harrisonwilde/.julia/packages/Plots/cc8wh/src/output.jl:8
[11] plot_real_α(::DataFrame, ::Float64, ::Array{String,2}, ::String, ::String) at ./REPL[23]:16
[12] top-level scope at REPL[43]:1
[13] eval(::Module, ::Any) at ./boot.jl:331
[14] eval_user_input(::Any, ::REPL.REPLBackend) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.4/REPL/src/REPL.jl:86
[15] run_backend(::REPL.REPLBackend) at /Users/harrisonwilde/.julia/packages/Revise/Pcs5V/src/Revise.jl:1073
[16] top-level scope at none:0