- 
                Notifications
    You must be signed in to change notification settings 
- Fork 636
Closed
Description
The legend title is not shown for legends in horizontal orientation.
Here's a line plot with a legend.
library(ggplot2)
library(plotly)
plt <- ggplot(Orange, aes(age, circumference, group = Tree, color = Tree)) + 
  geom_line()The plotly version with a vertical legend correctly displays the title.
ggplotly(plt)If I change to horizontal orientation, the title is no longer present
ggplotly(plt) %>% 
  layout(
    legend = list(
      orientation = "h"
    )
  )Notice that the word "Tree" is not present in this image.
This is a low priority bug since there is a workaround: you can manually specify the legend title.
ggplotly(plt) %>% 
  layout(
    legend = list(
      orientation = "h", 
      title = list(text = "Tree")
    )
  )Metadata
Metadata
Assignees
Labels
No labels


