Skip to content

Commit ebf336c

Browse files
committed
tidy
1 parent 14dc433 commit ebf336c

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

R/plot.R

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -780,19 +780,19 @@ bb2merc = function(x, cls = "ggmap") { # return bbox in the appropriate "web mer
780780
axis(side, at = at, labels = labels, ...)
781781
}
782782

783-
# given range r = (a,b), return a value range that:
784-
# * scales such that (b-a)/(y-x)=l
785-
# * shifts linearly within [x,y] such that a==x if o==0, or b==y if o==1
783+
# find out where to place the legend key:
784+
# given range r = (a, b), key.length l, key offset o, return a value range that:
785+
# * scales such that (b - a) / (y - x) = l
786+
# * shifts linearly within [x, y] from a = x when o = 0 to b = y when o = 1
786787
xy_from_r = function(r, l, o) {
787788
stopifnot(length(r) == 2, l <= 1, l > 0, o >= 0, o <= 1)
788-
a = r[1]
789-
b = r[2]
789+
a = r[1]; b = r[2]
790790
if (o == 1) {
791791
y = b
792-
x = b - (b-a)/l
792+
x = b - (b - a)/l
793793
} else {
794-
i = o / (o-1)
795-
y = (a + (b-a)/l - i * b)/(1 - i)
794+
i = o / (o - 1)
795+
y = (a + (b - a)/l - i * b)/(1 - i)
796796
x = i * (y - b) + a
797797
}
798798
c(x, y)

0 commit comments

Comments
 (0)