Skip to content

Commit

Permalink
return scale attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
davidcarslaw committed Jan 29, 2024
1 parent 2ba8fce commit f5fe62c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions R/polarPlot.R
Original file line number Diff line number Diff line change
Expand Up @@ -1068,6 +1068,9 @@ polarPlot <-
labels <- pretty(c(mydata[[x]], upper) + min.scale)
## offset the lines/labels if necessary
intervals <- intervals + (min(labels) - min.scale)

# return radial scale as attribute "radial_scale" on returned data
radial_scale <- intervals

## add zero in the middle if it exists
if (min.scale != 0) {
Expand Down Expand Up @@ -1187,6 +1190,9 @@ polarPlot <-
}

newdata <- res

# return attribute of scale used - useful for data with negative scales such as air_temp
attr(newdata, "radial_scale") <- range(radial_scale)
output <- list(plot = plt, data = newdata, call = match.call())
class(output) <- "openair"

Expand Down

0 comments on commit f5fe62c

Please sign in to comment.