plotly.tools.make_subplots() breaks down if rows>=100
See original GitHub issueFor some reason all data in subplots get jumbled up if ‘rows’ is 100 or higher. It works fine for rows=99. Here is an example code:
N = 100
v_space = 0
fig = tools.make_subplots(
rows=N,
cols=1,
vertical_spacing=v_space
)
for i in range(N):
x1 = 1
y1 = 1
trace = go.Scatter(
x=[x1],
y=[y1],
)
fig.append_trace(trace, i + 1, 1)
fig['layout'].update(height=N * 200)
py.iplot(fig)
If vertical_spacing is not zero and fig['layout'].update(height=N*(200+vertical_spacing))
, it breaks down for smaller values of ‘rows’.
Issue Analytics
- State:
- Created 5 years ago
- Comments:11 (6 by maintainers)
Top Results From Across the Web
plotly.subplots.make_subplots — 5.11.0 documentation
print_grid() method on the resulting figure. Space between subplot columns in normalized plot coordinates. Must be a float between 0 and 1. Space...
Read more >Python Examples of plotly.subplots.make_subplots
The following are 12 code examples of plotly.subplots.make_subplots(). You can vote up the ... rows + 1), range(1, cols + 1)): if x...
Read more >Plotly: Plot multiple figures as subplots - python - Stack Overflow
Here's a short function in a working example to save a list of figures all to a single HTML file.
Read more >plotly package — 5.11.0 documentation - Plotly Help Center
If both row and col are None, addresses the first subplot if subplots exist, ... Only valid if figure was created using plotly.tools.make_subplots...
Read more >Creating Various Plot Types and Subplots with Plotly
To do this, we can add multiple bar charts to our figure first, and then use fig.update_layout() to change the mode of the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @jonmmease , I am using plotly 4.5.1 and am getting this error too as i tried creating a subplot with 63 rows. it gives an error if the row is bigger than 58 rows.
Here is the code:
fig = make_subplots(rows=63, cols=1, shared_xaxes=True, vertical_spacing=0.02) size = len(asinhourlydict) xvalues = ["12am", "1am", "2am","3am","4am","5am","6am","7am","8am","9am","10am","11am","12pm","1pm", "2pm","3pm","4pm","5pm","6pm","7pm","8pm","9pm","10pm","11pm" ] for key,value in asinhourlydict.items(): fig.add_trace(go.Bar(x=xvalues,y=value),row=size,col= 1) fig.update_yaxes(title_text=key, row=size, col=1) size = size -1 fig.write_html('violationbarchart.html', config={ "displayModeBar" : False} )
and here is the error:
ValueError: Invalid value of type 'builtins.float' received for the 'domain[0]' property of layout.yaxis Received value: 1.0038095238095237 The 'domain[0]' property is a number and may be specified as: - An int or float in the interval [0, 1]
Is there a way to fix this? Or is it my code that have bugs? Thanks in advance!
Seeing this as well. using 4.2.1