StatsPlots & corrplot -- missing color scheme?

I’m trying to do an example at GitHub - JuliaPlots/StatsPlots.jl: Statistical plotting recipes for Plots.jl on how to use corrplot:

M = randn(1000,4)
M[:,2] .+= 0.8sqrt.(abs.(M[:,1])) .- 0.5M[:,3] .+ 5
M[:,3] .-= 0.7M[:,1].^2 .+ 2
corrplot(M, label = ["x$i" for i=1:4])

Instead of getting a nice plot, I get an error message:

MethodError: no method matching get_colorscheme(::RGBA{Float64})
Closest candidates are:
  get_colorscheme(::PlotUtils.AbstractColorList) at C:\Users\User_name\.julia\packages\PlotUtils\es5pb\src\colorschemes.jl:4
  get_colorscheme(::AbstractVector{var"#s45"} where var"#s45"<:Colorant) at C:\Users\User_name\.julia\packages\PlotUtils\es5pb\src\colorschemes.jl:298
  get_colorscheme(::AbstractVector{T} where T) at C:\Users\User_name\.julia\packages\PlotUtils\es5pb\src\colorschemes.jl:299
  ...

What is wrong?

using StatsPlots v0.14.28 got no errors but the heatmaps are displayed all in black, not as advertised.

1 Like

Hm. I used StatsPlots v0.14.28, too – and got this error. I’m still on Julia v1.6.1 – perhaps some other packages are being held back. I’ll do a Pkg.update() and see what happens then.

OK – I updated Julia and packages. I turned out I used an outdated version of Matplotlib. STILL, corrplot does not work with pyplot. But it works with gr()… And the historgrams are ugly/black – by default.

If I specify the fill color to, say :thermal, it looks better:

In my real-life case, I need to fix the number of digits along the axes, though – right now, the numbers overwrite the neighbor number…

1 Like