ggvis
ggvis copied to clipboard
Axis labels overlap with graph and axis title when rotated
When axis labels are rotated, ggvis should automatically move the axis title to avoid overlaps with labels.
This is what we would want:
ggplot(iris, aes(x = Species,y = Sepal.Length)) +
geom_bar(stat="identity") +
theme(axis.text.x=element_text(angle = 90,vjust = 0))
In ggvis, when axis labels are rotated, they overlap with both the axis title, and the graph itself:
iris %>%
ggvis(x = ~Species, y = ~Sepal.Length) %>%
layer_bars() %>%
add_axis("x",properties = axis_props(labels = list(angle = -90)))
Even with the "align" property, the label still overlaps with the axis title:
iris %>%
ggvis(x = ~Species, y = ~Sepal.Length) %>%
layer_bars() %>%
add_axis("x",properties = axis_props(labels = list(angle = -90,align = "right")))