Plots Heatmap is not showing categorical variable

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?

What’s even more weird is that the example from the Plots.jl documentation works

xs = [string("x", i) for i = 1:10]
ys = [string("y", i) for i = 1:4]
z = float((1:4) * reshape(1:10, 1, :))
heatmap(xs, ys, z, aspect_ratio = 1)

here, xs and ys are strings also … same as mine.

I figured it out. There were duplicates in my yvals and it works now that I’ve fixed it.