How can I extract data from this picture of a graph?
i = Import["https://i.stack.imgur.com/Ac8m0.png"];
The caption of the picture reads: " Two-dimensional histogram values measured . Tick labels on the color bar are bin counts (17 force bins, 32 lifetime bins, and n = 803 observations)"
Plan of Attack
I divided the image into two parts: 1st the main graph and 2nd the legend. I am trying to extract average pixel in the each block but I am not able to do so becuase the edges between the boxes are not well defined... so, I am trying to define the edges, which is kinda hard to do accurately.
I am trying to use ComponentMeasurements
and MorphologicalComponents
. Before using those two tools, I need to have well-defined boxes.
Do you guys have better algorithm to extract data?
UPDATE
@SimonWoods did a great job of extracting all these data. Now, I am trying to make sense out of this data. Using the data from legend, I made a list:
m = {{0, keycols[[1]]}, {1, keycols[[2]]}, {2, keycols[[3]]}, {3, keycols[[4]]}, {4, keycols[[5]]}, {5, keycols[[6]]}, {6, keycols[[7]]}, {7, keycols[[8]]}, {8, keycols[[9]]}, {9, keycols[[10]]}, {10, keycols[[11]]}, {11, keycols[[12]]}, {12, keycols[[13]]}, {13, keycols[[14]]}, {14, keycols[[15]]}, {35, keycols[[19]]}, {96, keycols[[24]]}}
Then, I tried to interpolate:
ip = Interpolation[m, Method -> "Spline", InterpolationOrder -> 1]
(I don't know if assuming it's linear is correct or not but if the total count is correct then I can be sure if not then I can try different interpolation order)
and I got this:
However, what I want is a function that takes in the RGB and gives count. So, I want inverse of this interpolation, which I couldn't get.
Science
paper and I want to extract data from this graph to do some analysis. I really do not understand their scaling. They do not do a good job describing it in the paper $\endgroup$