You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
plotly.tools.make_subplots() breaks down if rows>=100 #1031
With plotly.py version 3 we get a more informative error (instead of the jumbled result you were seeing)
ValueError:
Invalid value of type 'builtins.float' received for the 'domain[1]' property of layout.yaxis
Received value: 1.0000000000000007
The 'domain[1]' property is a number and may be specified as:
- An int or float in the interval [0, 1]
Looks like a numerical precision error. We probably just need a min(1.0, val) somewhere.
It looks like the issue is still not resolved.
make_subplots breaks down at rows > 70
Here is an example code:
from plotly.offline import plot
import plotly.graph_objs as go
from plotly import tools
X = list(range(50))
Y = list(range(50))
n_rows = 70 # make_subplots breaks down if rows > 70
fig = tools.make_subplots(rows=n_rows, cols=1)
fig['layout'].update(height=5000, width=1000)
for i in range(n_rows):
trace = go.Scatter(x = X, y = Y)
fig.append_trace(trace, i+1, 1)
plot(fig)
@Rimesh, I gave it a try and I don't see an error message, but I do see that the subplot y-axes start overlapping. If this is what you're seeing as well, could you open a new issue? I think this is a different underlying issue. Thanks!
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!
Reacted by 4iar, nancunpei, bryan-alexander and Roberto Rocha
Activity
jonmmease commentedon Aug 4, 2018
Thanks for the report @oiegorov,
I think this is the same issue that was brought up in the forums here: https://community.plot.ly/t/domain-issues-with-multiple-subplots/12282/2
With plotly.py version 3 we get a more informative error (instead of the jumbled result you were seeing)
Looks like a numerical precision error. We probably just need a
min(1.0, val)somewhere.jonmmease commentedon Aug 7, 2018
Hi @oiegorov ,
I just pushed out release candidates for plotly.py 3.1.1 and plotlywidget 0.2.1. Installation instructions for the release candidates are at https://github.com/plotly/plotly.py/blob/bc1d4d188ab999cd9c21e3a7908729f156bc200f/README.md.
If you have a chance to confirm that this issue is resolved in the release candidate that would be awesome!
Rimesh commentedon Oct 5, 2018
Hi @jonmmease ,
It looks like the issue is still not resolved.
make_subplots breaks down at rows > 70
Here is an example code:
jonmmease commentedon Oct 5, 2018
Hi @Rimesh, thanks for letting us know. Could you add the error message that you're seeing?
jonmmease commentedon Oct 5, 2018
@Rimesh, I gave it a try and I don't see an error message, but I do see that the subplot y-axes start overlapping. If this is what you're seeing as well, could you open a new issue? I think this is a different underlying issue. Thanks!
baasman commentedon Apr 15, 2019
I'm seeing this as well, using 3.5.0
elanter commentedon Nov 19, 2019
Seeing this as well. using 4.2.1
albertsugi-tallridge commentedon Feb 21, 2020
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!
robroc commentedon May 15, 2020
I'm having this issue with Plotly Express in Plotly 4.7.1, when trying to create faceted subplots with 92 plots (at 6 per row it's 16 rows).
nicolaskruchten commentedon Jun 9, 2020
@albertsugi-tallridge you're encountering bug #2556 and you can get around it by reducing your
vertical_spacing@robroc yours is more akin to #2026
nicolaskruchten commentedon Jul 16, 2020
In Plotly Express you can now (as of version 4.9) avoid this problem by using
facet_row_spacingandfacet_col_spacinghttps://plotly.com/python/facet-plots/#controlling-facet-spacing