Skip to content
This repository has been archived by the owner on Feb 9, 2024. It is now read-only.

Axis labels overlap with graph and axis title when rotated #455

Open
shreyasgm opened this issue Apr 21, 2016 · 0 comments
Open

Axis labels overlap with graph and axis title when rotated #455

shreyasgm opened this issue Apr 21, 2016 · 0 comments

Comments

@shreyasgm
Copy link

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))

ggplot2-axis-example

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)))

ggvis-axis-example1

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")))

ggvis-axis-example2

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant