Closed
Description
This plot works fine:
library(ggplot2)
testdat <- data.frame(
Var = 1:4,
Mean = c(1.5, 3, 2.2, 4.6),
Low = c("Happy", "Peaceful", "Excited", "Content"),
High = c("Sad", "Angry", "Hopeless", "Anxious"))
p <- ggplot(testdat, aes(x = Mean, y = Var)) +
geom_point(shape = 18, size = 7, colour = "grey50") +
scale_y_reverse("",
breaks = seq_along(testdat$Low),
labels = testdat$Low,
sec.axis = dup_axis(
breaks = seq_along(testdat$Low),
labels = testdat$High))
print(p)
The y axes go from 1 to 4. If I want to specify limits on the x axis (the limits of possible response items on the affect adjectives) I try something like this:
p + coord_cartesian(
xlim = c(1, 5),
ylim = c(.5, 4.5),
expand = FALSE)
which results in that image. Actually the x and y limits look fine, but I can't understand why the labels on the left (Happy, etc) are all gone now. It did not use to do this, although I can't recall at what version it actually stopped / changed how it worked.
Whatever is expected, its hard for me to believe dropping one of my axis labels is the intended behaviour?
Metadata
Metadata
Assignees
Labels
No labels