Skip to content

First subplot too big when using layout.grid attribute #1427

Closed
@michaelbabyn

Description

@michaelbabyn

I can already use plotly.js's grid layout attribute to make subplots with pie charts and 3d charts in R (ie traces with a domain attribute) but specifying subplots using x and y axes doesn't work because plotly_build sets a default domain of [0,1] for the first xaxis and yaxis.

p <- plot_ly(type = 'scatter',mode = 'lines', y = c(5,1,3), xaxis = 'x', yaxis = 'y') %>%
  add_trace(y = c(2,1,5), xaxis = 'x2', yaxis = 'y2') %>%
  add_trace(y = c(2,1,5), xaxis = 'x3', yaxis = 'y3')%>%
  add_trace(y = c(2,1,5), xaxis = 'x4', yaxis = 'y4')%>%
  add_trace(y = c(2,1,5), xaxis = 'x5', yaxis = 'y5')%>%
  add_trace(y = c(2,1,5), xaxis = 'x6', yaxis = 'y6')%>%
  layout(grid = list(rows = 2, columns = 3, pattern ='independent'))
p

first plot too big

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions