Skip to content

Incorrect warning in layout() when using bargroupgap #2458

@SCasanova

Description

@SCasanova

When using the bargroupgap argument, the following waring is thrown:

Warning message:
'layout' objects don't have these attributes: 'bargroupgap'
Valid attributes include: ...

However the attribute clearly exists and works

library(ggplot2)
library(plotly)


test <- tibble::tibble(
  A = c(1,2,3),
  B = c(3,2,1),
  C = c(4,1,4)
)

plot_ly(
  test,
  y = ~A,
  type = 'bar',
  name = 'Option A',
  marker = list(
    color = '#4E0F53'
  )
) |> 
  add_trace(
    y = ~B,
    name = 'Option B',
    marker = list(
      color = '#DC9542'
    )
  ) |> 
  add_trace(
    y = ~C,
    name = 'Option C',
    marker = list(
      color = '#a8aaad'
    )
  ) |> 
  layout(
    barmode = 'group',
    bargroupgap = 0.1
  )

Image


plot_ly(
  test,
  y = ~A,
  type = 'bar',
  name = 'Option A',
  marker = list(
    color = '#4E0F53'
  )
) |> 
  add_trace(
    y = ~B,
    name = 'Option B',
    marker = list(
      color = '#DC9542'
    )
  ) |> 
  add_trace(
    y = ~C,
    name = 'Option C',
    marker = list(
      color = '#a8aaad'
    )
  ) |> 
  layout(
    barmode = 'group'
  )
Image

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