I’m trying to get the following code working but can’t figure out what I need to do.
function plot_type_wealth(dataframe)
type_vector = [:Supplier, :Consumer]
label_vector = ["Supplier" "Consumer"]
@df dataframe plot(type_vector,
title="Median wealth per actor type\n",
label=label_vector,
xlabel="Time",
ylabel="Median wealth")
end
The following piece of code DOES work:
function plot_type_wealth(dataframe)
label_vector = ["Supplier" "Consumer"]
@df dataframe plot([:Supplier, :Consumer],
title="Median wealth per actor type\n",
label=label_vector,
xlabel="Time",
ylabel="Median wealth")
end
The reason I want the first version to work is that I want to pass the columns that need to be plotted as a variable in the function. I know that it has to do with the @df macro but I can’t figure out how to also make it work with the variable.
Thanks in advance,
Stef