I do not see how one can usefully estimate a distribution from a plot. You can estimate the distribution from the data used to make a plot, which is what we're doing here.
The approach I would take is to expand the data so that if in a given month the original data have -3 listed as occurring five times, the expanded data show -3 five times. I found a function that does that in the splitstackshape package. There may be such a function in the tidyverse but I found the other one first. I assumed you listed bins indicate the midpoint. If that is not true, you will have to relabel the columns. This code just shows the calculation of the variance.
library(tidyverse)
#> Warning: package 'tibble' was built under R version 4.1.2
DF <- structure(list(Month = 1:10,
Year = c(2008L, 2008L, 2008L, 2008L,
2008L, 2008L, 2008L, 2008L, 2008L, 2008L),
`-3` = c(3L, 5L, 6L,
9L, 6L, 8L, 9L, 5L, 7L, 8L),
`0` = c(2L, 3L, 4L, 4L, 5L, 3L,
5L, 5L, 5L, 6L),
`2` = c(28L, 26L, 27L, 18L, 15L, 17L, 16L, 19L,
22L, 20L),
`4` = c(41L, 40L, 39L, 28L, 29L, 28L, 28L, 29L, 39L,
40L),
`5.5` = c(17L, 15L, 13L, 28L, 29L, 26L, 28L, 26L, 15L,
15L),
`8` = c(3L, 4L, 4L, 5L, 6L, 6L, 4L, 5L, 4L, 4L),
`12.5` = c(5L,
6L, 6L, 7L, 9L, 10L, 9L, 9L, 7L, 7L),
`15` = c(1L, 1L, 1L, 1L,
1L, 2L, 1L, 2L, 1L, 0L)),
class = "data.frame", row.names = c(NA, -10L))
DFlong <- pivot_longer(DF, cols = 3:10,names_to = "BIN")
DFlong
#> # A tibble: 80 x 4
#> Month Year BIN value
#> <int> <int> <chr> <int>
#> 1 1 2008 -3 3
#> 2 1 2008 0 2
#> 3 1 2008 2 28
#> 4 1 2008 4 41
#> 5 1 2008 5.5 17
#> 6 1 2008 8 3
#> 7 1 2008 12.5 5
#> 8 1 2008 15 1
#> 9 2 2008 -3 5
#> 10 2 2008 0 3
#> # ... with 70 more rows
library(splitstackshape)
#> Warning: package 'splitstackshape' was built under R version 4.1.2
Expanded <- expandRows(DFlong, count = "value")
#> The following rows have been dropped from the input:
#>
#> 80 #dropped because it has value = 0, i.e. 0 counts.
Expanded$BIN <- as.numeric(Expanded$BIN)
head(Expanded)
#> # A tibble: 6 x 3
#> Month Year BIN
#> <int> <int> <dbl>
#> 1 1 2008 -3
#> 2 1 2008 -3
#> 3 1 2008 -3
#> 4 1 2008 0
#> 5 1 2008 0
#> 6 1 2008 2
STATS <- Expanded |> group_by(Month,Year) |>
summarize(VAR=var(BIN))
#> `summarise()` has grouped output by 'Month'. You can override using the `.groups` argument.
STATS
#> # A tibble: 10 x 3
#> # Groups: Month [10]
#> Month Year VAR
#> <int> <int> <dbl>
#> 1 1 2008 8.68
#> 2 2 2008 10.6
#> 3 3 2008 11.2
#> 4 4 2008 13.6
#> 5 5 2008 13.4
#> 6 6 2008 16.0
#> 7 7 2008 14.9
#> 8 8 2008 14.0
#> 9 9 2008 12.5
#> 10 10 2008 11.8
Created on 2022-02-22 by the reprex package (v2.0.1)