StatsPlots.jl icon indicating copy to clipboard operation
StatsPlots.jl copied to clipboard

Corrplot histograms are black

Open OctarineSourcerer opened this issue 4 years ago • 5 comments

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

image It certainly doesn't match up with the screenshot in the docs. image

I have no idea how to work around this - any help in the meantime with that would be very much appreciated.

OctarineSourcerer avatar Oct 26 '20 14:10 OctarineSourcerer

Could be something with the clims- can you try to adjust those manually?

mkborregaard avatar Oct 26 '20 14:10 mkborregaard

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)

OctarineSourcerer avatar Oct 27 '20 14:10 OctarineSourcerer

Same for me (using pyplot())

Julia Version 1.5.2
Commit 539f3ce943
[f3b207a7] StatsPlots v0.14.5

lssimoes avatar Oct 28 '20 11:10 lssimoes

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.

OctarineSourcerer avatar Nov 04 '20 11:11 OctarineSourcerer

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.

diegozea avatar Jan 19 '22 19:01 diegozea