Can't format labels in plot

Trying to make a plot of weighted locations for each year. I have attached my code to make the plot below. An issue that I've been having is labelling the density "bubbles" within the plot properly. It is not imperative that I include all of the years in my data on the plot as it goes from 1968-2017. But I would like to have at least 3, ie 1968, 1984, 2017. I have also attached my data table. Perhaps this is an easier fix than I assume...

par(mfrow=c(1,1))
yrinc<-c(fluke$Year==1968,1984,2017)
map("world", fill=T, col="gray90",xlim = c(-85,-60),ylim=c(27,45))
map.axes()
yrs<-unique(fluke$Year)
resolution<- 101
points(cog.lat~cog.lon, data=indices.df, pch=16,
       col=colorRampPalette(c("blue","red"), space="Lab")(resolution)
       [as.numeric(cut(1968:2017, breaks=seq(1968,2017, length.out=resolution+1),
                       include.lowest=T))],
       text(x=indices.df$cog.lon,y=indices.df$cog.lat,labels=yrinc, pos = 4, offset =2 ))


Hello, it is difficult to work with your data as it's a picture of the data, not the data itself.

Can you please share a small part of the data set in a copy-paste friendly format?

In case you don't know how to do it, there are many options, which include:

  1. If you have stored the data set in some R object, dput function is very handy.

  2. In case the data set is in a spreadsheet, check out the datapasta package. Take a look at this link.

hi, I linked the csv via github:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.