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.

Unhelpful error when passing invalid argument to gridplot

See original GitHub issue

I often find myself assembling a list of plots and then writing:

$ show(gridplot(plots, n_cols=4))

This will give the following error:

TypeError                                 Traceback (most recent call last)
<ipython-input-25-656b46f60be9> in <module>()
----> 1 show(gridplot(plots, n_cols=4, toolbar_location=None))

~/Dev/bokeh/bokeh/bokeh/layouts.py in gridplot(*args, **kwargs)
    320         row_tools = []
    321         row_children = []
--> 322         for item in row:
    323             if merge_tools:
    324                 if item is not None:

TypeError: 'Figure' object is not iterable

The problem is that I wrote n_cols instead of ncols. At this point I’ve done this dozens and dozens of times. Every time I come back to bokeh after a gap, this always trips me up and I forget the ncols/n_cols thing and think there’s some more fundamental mistake.

Can we validate the input to gridplot better?

One of my favorite features about bokeh is the helpful suggestions when you mess up a parameter. I know this is completely different, and nothing to do with the property machinery, but none-the-less a similar experience would be awesome.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
02akshaycommented, Jul 14, 2019

Try this gridplot([p1,p2],[])

0reactions
bryevdvcommented, Jul 14, 2019

@02akshay You will have elaborate, without context it’s not obvious what point you are trying to make. Are you saying that snippet works? doesn’t work? does something unexpected?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Plotly error 'Invalid argument `figure.data` passed into Graph'
Since this graph is a cufflinks graph, the graph is displayed by setting it as fig as it is, rather than assigning it...
Read more >
Error, (in plots/complexplot) invalid arguments - Maple Help
This error occurs when an argument of an incorrect type is passed to a command. The type of arguments accepted by Maple commands...
Read more >
ArgumentOutOfRangeException Class (System)
An ArgumentOutOfRangeException exception is thrown when a method is invoked and at least one of the arguments passed to the method is not...
Read more >
Invalid argument: status = %s - Teradata Tools and Utilities
TPT02202 Error : Invalid argument: status = %s Explanation: A TPT process, task, component or function encountered an unanticipated and ...
Read more >
NOTE: Invalid argument to function INPUT - SAS Communities
Solved: I'm using an array to convert character variables to numeric. The code executes w/o errors or warnings, but the notes state "...
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