I am trying to plot a heatmap where the data is coming from a DataFrame
. The arrays look like the following
yvals = df_normal[:, :county]
xvals = names(df_normal)[dbegin:dend]
zvals = Matrix(df_normal[:, dbegin:dend])
where df_normal
is my dataframe. The xvals
and yvals
are just strings, as seen by
julia> typeof(yvals)
Array{String,1}
julia> eltype(yvals)
String
except for some reason, heatmap does not work. If I pass in yvals
, I get a message (not a warning/error),
julia> heatmap(xvals, yvals, zvals, size=(1000,1000))
y points not sorted in ascending order
and the heatmap itself is completely blank.
I can get it to work if I change the y axis to a numerical array… something like
julia> heatmap(xvals, 1:length(yvals), zvals, size=(1000,1000))
but then I lose my y axis strings.
Any idea?