Hello Guys!
I need a help. i want make this heatmap:
I’m trying with that code:
Plots.heatmap(cor(Matrix(df[!,[:Age,:Balance, :Tenure,:NumOfProducts,:EstimatedSalary]]))
)
**
But how can i put the annotations of the correlation values and the columns names in the ticks?
**
Another try but using a DataFrame:
a = DataFrame(cor(Matrix(df[!,[:Age,:Balance, :Tenure,:NumOfProducts, :EstimatedSalary]])), [:Age,:Balance, :Tenure,:NumOfProducts, :EstimatedSalary])
Age | Balance | Tenure | NumOfProducts | EstimatedSalary | |
---|---|---|---|---|---|
Float64 | Float64 | Float64 | Float64 | Float64 | |
1 | 1.0 | 0.0283084 | -0.00999683 | -0.0306801 | -0.00720104 |
2 | 0.0283084 | 1.0 | -0.0122539 | -0.30418 | 0.0127975 |
3 | -0.00999683 | -0.0122539 | 1.0 | 0.0134438 | 0.00778383 |
4 | -0.0306801 | -0.30418 | 0.0134438 | 1.0 | 0.0142042 |
5 | -0.00720104 | 0.0127975 | 0.00778383 | 0.0142042 | 1.0 |
begin
@df a Plots.heatmap(cols([:Age,:Balance, :Tenure,:NumOfProducts,:EstimatedSalary]))
annotate!([(1, 1, (a[1,1], 8, :red, :center))])
end
Here i used annotate to create the correlation value, but i made this manually and have no idea of how to put the column names in the ticks.
Have another clever or easier way to do that?
Thx!