Skip to content

Commit b17a294

Browse files
author
Kirill Müller
committed
fix vertical justification for rotated text
1 parent 3fda191 commit b17a294

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ ggplot2 0.9.3.1.99
77
* `ggpcp()`, `ggfluctuation()`, `ggmissing()`, `ggstructure()`, and
88
`ggorder()` are now defunct and have been removed.
99

10+
* Fix vertical justification for rotated text. (@krlmlr, #883)
11+
1012

1113
ggplot2 0.9.3.1
1214
----------------------------------------------------------------

R/theme-elements.r

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,15 +196,15 @@ element_grob.element_text <- function(element, label = "", x = NULL, y = NULL,
196196
angle <- angle %% 360
197197

198198
if (angle == 90) {
199-
xp <- vj
199+
xp <- 1 - vj
200200
yp <- hj
201201
} else if (angle == 180) {
202202
xp <- 1 - hj
203-
yp <- vj
203+
yp <- 1 - vj
204204
} else if (angle == 270) {
205205
xp <- vj
206206
yp <- 1 - hj
207-
}else {
207+
} else {
208208
xp <- hj
209209
yp <- vj
210210
}

0 commit comments

Comments
 (0)