Skip to content

ggplotly doesn't respect legend.position from theme() #2187

@mcaselli

Description

@mcaselli

The legend position for plots produced with ggplotly() doesn't reflect the position specified in ggplot, e.g. theme(legend.positon="bottom").

on 2022-09-22 this issue is visible on the plotly docs site entry for Change the legend position

image

library(plotly)
library(ggplot2)

ToothGrowth$dose <- as.factor(ToothGrowth$dose)

p <- ggplot(ToothGrowth, aes(x=dose, y=len, fill=dose)) + 
  geom_boxplot()

p + theme(legend.position="bottom")

ggplotly(p)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions