Skip to content

Commit e2f10b4

Browse files
committed
Merge branch 'vjust' of github.com:krlmlr/ggplot2 into krlmlr-vjust
2 parents 7fdb328 + a51b730 commit e2f10b4

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

NEWS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@ ggplot2 0.9.3.1.99
4545
* theme: new theme settings panel.margin.x and panel.margin.y (units) allow
4646
specifying horizontal and vertical gap between panels in facetted plots (for
4747
both grid and wrap). (Kirill Müller. Fixes #839)
48+
* Fix vertical justification for rotated text. This will change the appearance
49+
of plots that use textual elements that are rotated by 90° or 270° and have a
50+
`vjust` parameter other than the default 0.5; the interpretation of `vjust`
51+
and `hjust` is now the same for both rotated and non-rotated text elements
52+
(0 = top/left, 1 = bottom/right, 0.5 = centered). (@krlmlr, #883)
53+
4854
* `aes()` no more treats variables like `a..x..b as a calculated aesthetic.
4955
(@krlmlr, #834.)
5056

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)