question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Make_subplots: specify only row/col if cols=1/rows=1

See original GitHub issue

When using make_subplot() with multiple rows and cols=1, I think it should suffice to specify only row.

For instnace, this should work:

y = np.random.normal(scale=0.1, size=500)

fig = go.FigureWidget(make_subplots(rows=2, cols=1))
fig.add_scatter(y=np.cumsum(y), row=1)
fig.add_scatter(y=y, row=2)
fig.layout.update(showlegend=False)
fig

Similarly with rows=1.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
velezbeltrancommented, Jul 5, 2020

@sursu I see what you mean now. I was confused and thought you were referring to the make_subplots function itself. I will wait for the PR and take try to take a look to it afterwards

1reaction
sursucommented, Jul 5, 2020

You’re missing something. This doesn’t work:

fig = make_subplots(cols = 2)
fig.add_scatter(x=[1, 2, 3], y=[4, 5, 6], col=1)
fig.add_scatter(x=[20,30,40], y=[50,60,70], col=2)
fig.show()
Read more comments on GitHub >

github_iconTop Results From Across the Web

plotly.subplots.make_subplots — 5.11.0 documentation
Assign shared (linked) x-axes for 2D cartesian subplots ... Only valid if type='xy'. ... cell (tuple, default=(1,1)): (row, col) index of the.
Read more >
Plotly (python) subplot raises error when specifying row and ...
It is a simplified version of a longer code which I stripped to include only the plotting part of interest. The variables SPD...
Read more >
plotly package — 5.11.0 documentation - Plotly Help Center
If 'all', addresses all rows in the specified column(s). If both row and col are None, addresses the first subplot if subplots exist,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found