StatsPlots.jl
StatsPlots.jl copied to clipboard
Corrplot histograms are black
When running the documentation's example code:
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])
I get a corrplot with only black for the histograms (including the heatmaps), which pretty much removes the use of heatmaps
It certainly doesn't match up with the screenshot in the docs.
I have no idea how to work around this - any help in the meantime with that would be very much appreciated.
Could be something with the clims
- can you try to adjust those manually?
Sorry for such a late reply! Calling corrplot(M, label = ["x$i" for i=1:4], clims=(-10,10))
seems to have the same result, and so does calling corrplot(M, label = ["x$i" for i=1:4], c=:thermal)
Same for me (using pyplot()
)
Julia Version 1.5.2
Commit 539f3ce943
[f3b207a7] StatsPlots v0.14.5
As an update, I've found this can be worked around by adding fillcolor=cgrad()
to the corrplot, for example:
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], fillcolor=cgrad())
I assume you could pass in another gradient and have it be fine.
The relevant line in corrplot.jl
looks like this: fillcolor --> Plots.fg_color(plotattributes)
, but I'm not familiar enough with the library to know why that might have gone awry.
I am seeing the same problem with StatsPlots 0.14.30
; the fillcolor=cgrad()
is doing the trick. However, the doc tells that seriescolor
is controlling the colors of the bi-dimensional histograms.