using DataFrames, FreqTables, NamedArrays using Plots gr(size=(400, 300)); # as you like # Heatmap difinition for pivot Plots.heatmap(pivot::NamedArray)= heatmap(names(pivot)..., pivot.array') df = DataFrame(Location = ["NY", "SF", "NY", "NY", "SF", "SF", "TX", "TX", "TX", "DC", "DC", "DC"], Class = ["M","M","H","L","L","H", "H","L","M","M","H","L"], Score = rand(12)) pivot = freqtable(df, :Location, :Class, weights=df.Score) heatmap(pivot)