I want to vary the size of points created with stat_summary_2d, at present they are all the same size which isn't informative. I would normally use geom_point() but because I want the points central to their correct bins it isn't appropriate, they are inconsistent in their placement relative to the bin centres so an offset also doesn't work.
The code relevant for creating the points is:
stat_summary_2d(data = filter(ni_eff, fishyear %in% c('2013', '2014', '2015', '2016') & coverage),
mapping = aes(x = start_long, y = start_lat, z=event_key),
binwidth = c(1, 1),
geom = 'point',
colour = 'red',
shape = 1,
# size = event_key,
fun = n_distinct) +
Stat_summary_2d doesn't like size in the aesthetics, and also doesn't recognise event_key if it is entered to determine size. I think it should be possible but haven't worked out how, so any help would be appreciated.
Ultimately, I want points centred on 1*1 degree lat-long bins that vary in size given a column event_key within the dataframe with their co-ordinates.