I'm looking for an easy way to create a custom heat map (in Python, or R, or Tableau). I can't figure out how to personalise colours as I need them.
Basically, I have a .tsv file with feature and their ranking. The ranking goes, for example, from 1 to 10 and from -1 to -10 in the same file.
I need to have white for zeros. Then, darker colours for 1 and -1 that then becomes lighter. So, for example, I need to have dark red for 1 and light red for 10, and then dark blue for -1 and light blue for -10.
Any idea on how I could obtain this result?
edit: This is how my data look:
structure(list(Features = structure(c(1L, 2L, 3L, 4L, 5L, 6L,
7L, 8L, 11L, 12L, 9L, 10L, 13L, 14L, 15L, 16L, 17L, 18L, 19L,
20L, 21L), .Label = c("char_per_tok", "cpos_dist_AUX", "cpos_dist_NUM",
"dep_dist_aux", "dep_dist_nummod", "dep_freq_aux", "dep_freq_nmod",
"dep_freq_nummod", "in_dict", "in_dict_types", "in_FO", "in_FO_types",
"itwac_forme", "itwac_lemmi", "n_prepositional_chains", "prep_dist_3",
"prep_freq_1", "prep_freq_3", "subj_post", "verb_edges_dist_7",
"verb_edges_freq_7"), class = "factor"), A10 = c(1L, -14L, -6L,
-8L, -5L, -7L, 3L, -3L, -1L, -11L, -2L, -4L, 0L, 59L, 4L, -9L,
2L, -10L, 0L, -13L, -12L), A11 = c(3L, -14L, -6L, -8L, -5L, -7L,
4L, -4L, -1L, -11L, -2L, -3L, 1L, 2L, 0L, -9L, 5L, -10L, 0L,
-13L, -12L), A12 = c(3L, 0L, -3L, -5L, -2L, -4L, 0L, -1L, 0L,
0L, 0L, 0L, 1L, 2L, 0L, -6L, 0L, -7L, 0L, -9L, -8L), A13 = c(3L,
0L, -3L, 0L, -2L, 0L, 0L, -1L, 0L, 0L, 0L, 0L, 1L, 2L, 0L, -4L,
0L, -5L, 0L, 0L, 0L), A14 = c(1L, 0L, -3L, 0L, -2L, 0L, 0L, -1L,
0L, 0L, 0L, 0L, 0L, 2L, 0L, -4L, 0L, -5L, 0L, 0L, 0L), A15 = c(2L,
0L, -3L, 0L, -2L, 0L, 0L, -1L, 0L, 0L, 0L, 0L, 1L, 3L, 0L, 0L,
0L, 0L, 0L, 0L, 0L), A16 = c(0L, 0L, -4L, -5L, -1L, 0L, 0L, -2L,
0L, 0L, 0L, 0L, 0L, 1L, 0L, 0L, 0L, 0L, -3L, 0L, 0L)), .Names = c("Features",
"A10", "A11", "A12", "A13", "A14", "A15", "A16"), class = "data.frame", row.names = c(NA,
-21L))