Skip to content

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

Closed

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)

Activity

  1. added 4 commits that reference this issue on Jan 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions