I want to create horizontal stack graph like below
Arr1, Arr2, Arr3, Arr4 are in range 0-1 and length is about 50000 each.
Short Example of length 10:
Array | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
---|---|---|---|---|---|---|---|---|---|---|
Arr1 | 0.1 | 0.1 | 0.1 | 0.2 | 0.2 | 0.2 | 0.7 | 0.7 | 0.4 | 0.7 |
Arr2 | 0.6 | 0.6 | 0.6 | 0.1 | 0.1 | 0.1 | 0.1 | 0.1 | 0.5 | 0.1 |
Arr3 | 0.3 | 0.3 | 0.3 | 0.7 | 0.7 | 0.7 | 0.2 | 0.2 | 0.1 | 0.2 |
Arr4 | 0.4 | 0.6 | 0.7 | 0.2 | 0.1 | 0.3 | 0.4 | 0.5 | 0.3 | 0.9 |
B | a | a | a | b | b | b | a | a | a | b |
How can I plot each Arr1, Arr2, Arr3, Arr4 from light to dark based on their value in horizontal graph (or greyscale with each value be different shade of grey).
The values closer to 0 will me light in color and values closer to 1 will be dark. 0 will be white and 1 will black when using greyscale.
In picture Arr1: low values will be light yellow and high values will be dar yellow(all values are between 0 and 1)
Last bar is different, Array: B
is list of a
and b
, how can I plot different color for each occurrence of a
and b
.
In picture for B: occurrences of a
will be colored green
and occurrences of b
will be colored pink
.
I would not worry much about the layout of the outer box, I would just use ggarrange
to put all graph in a single plot