library(ggplot2)
m <- matrix(c(0.8, -0.3, 0.5, -0.9, 0.1, 0.6), 2, 3)
df <- matrix_to_hinton(m)
ggplot(df, aes(x = col, y = row, weight = weight)) +
geom_hinton() +
scale_fill_hinton() +
theme_hinton()
Run the code above in your browser using DataLab