Skip to content

Commit

Permalink
remove legend from plot
Browse files Browse the repository at this point in the history
  • Loading branch information
Devetak authored and AldoGl committed Oct 9, 2024
1 parent 0146895 commit 60e3188
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/utils/plot_data_vector.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,33 +14,31 @@ const quantity_titles = Dict(
)

function plot_data_vector(data_vector::Vector{Data}; titlefont = 9, quantities = default_quantities)

Te = length(data_vector[1].wages)
ps = []

for q in quantities
# define title via the table only if the entry exists
title = haskey(quantity_titles, q) ? quantity_titles[q] : string(q)
if q == :gdp_deflator
push!(ps, errorline(1:Te, data_vector.nominal_gdp ./ data_vector.real_gdp, errorstyle = :ribbon, title = title, titlefont = titlefont))
push!(ps, errorline(1:Te, data_vector.nominal_gdp ./ data_vector.real_gdp, errorstyle = :ribbon, title = title, titlefont = titlefont, legend = false))
else
push!(ps, errorline(1:Te, getproperty(data_vector, q), errorstyle = :ribbon, title = title, titlefont = titlefont))
push!(ps, errorline(1:Te, getproperty(data_vector, q), errorstyle = :ribbon, title = title, titlefont = titlefont, legend = false))
end
end
return ps

end


function plot_data(data::Data; titlefont = 9, quantities = default_quantities)
ps = []
for q in quantities
title = haskey(quantity_titles, q) ? quantity_titles[q] : string(q)
if q == :gdp_deflator
push!(ps, plot(data.nominal_gdp ./ data.real_gdp, title = title, titlefont = titlefont))
push!(ps, plot(data.nominal_gdp ./ data.real_gdp, title = title, titlefont = titlefont, legend = false))
else
push!(ps, plot(getproperty(data, q), title = title, titlefont = titlefont))
push!(ps, plot(getproperty(data, q), title = title, titlefont = titlefont, legend = false))
end
end
return ps
end
end

0 comments on commit 60e3188

Please sign in to comment.