AustralianAntarcticDivision / SOmap

Southern Ocean round maps
https://australianantarcticdivision.github.io/SOmap/
24 stars 6 forks source link

Fix #L164 by adding is.null(tlabs) condition #106

Closed KimBaldry closed 1 year ago

KimBaldry commented 1 year ago

https://github.com/AustralianAntarcticDivision/SOmap/blob/0d13a345997884c84610f2ce6fc76c03284e4984/R/SOleg.R#L164

I am trying to make a SOmap legend with a log scale (specifying tick labels on a normal scale, at breaks in the log scale).

trans <- function(x){log(x,10)} inv = inverse(trans,lower = 0)

               mylegend = SOleg(x = range, position = "topright", col = viridisLite::viridis(80),
                                  trim = -30, label = lab, breaks = unlist(lapply(seq(inv(range[1]),inv(range[2]), length.out = 5),FUN = trans)), tlabs = as.character(round(seq(inv(range[1]),inv(range[2]), length.out = 5),1)),
                                   type = "continuous",tcex = 0.5, lcex = 0.5,ticks = 5)

Returning error: Error in SOleg_inner(x = x, position = position, col = col, ticks = ticks, : object 'lmins' not found

I dont think I need a lmins defined. Should be fixed with this small change.

KimBaldry commented 1 year ago

Fixed and pull request submitted

https://github.com/AustralianAntarcticDivision/SOmap/pull/107#issue-1516815427

image

raymondben commented 1 year ago

https://github.com/AustralianAntarcticDivision/SOmap/commit/f2da965631e7eb477707eeabe3aeb9d90c41edeb