I am unable to plot numpy arrays with a single dimension - The plot turns up empty. I’m pretty sure this was possible on an earlier release of Bokeh (maybe 0.10?, I’m not a 100% sure)
Below is a code sample that gives me an error
from bokeh.io import output_file
from bokeh.plotting import figure, show
import numpy as np
dat = np.random.randn(100)
output_file(‘temp.html’)
plt = figure()
plt.circle(dat)
show(plt)
Okay, thanks! That’s the workaround I’m using now.
Are there any plans to support this in the future? If implementing this doesn’t involve javascript, I’m happy to take a look and see if I can help with it!
I am unable to plot numpy arrays with a single dimension - The plot turns up empty. I’m pretty sure this was possible on an earlier release of Bokeh (maybe 0.10?, I’m not a 100% sure)
Below is a code sample that gives me an error
from bokeh.io import output_file
from bokeh.plotting import figure, show
import numpy as np
dat = np.random.randn(100)
output_file(‘temp.html’)
plt = figure()
plt.circle(dat)
show(plt)
Thanks!
Srikrishna Sekhar
–
You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
I can't say we have any plans, tho if you wanted to submit a PR it could be discussed. However, I don't think it would be entirely trivial. In order to support automated docs generation and boilerplate reduction, the glyph functions are actually derived programmatically, e.g. here:
And the issue is that this type of capability would only be appropriate for a subset of the glyph methods, not all of them, which means modifying the automation machinery in a way that makes it works on the subset of glyphs that it makes sense for. It would probably involve adding some kind of static class metadata to the Glyph classes that woudl support this optimization, and then having _glyph_function inspect for that.
Bryan
···
On May 22, 2016, at 10:51 AM, Sri Krishna <[email protected]> wrote:
Okay, thanks! That's the workaround I'm using now.
Are there any plans to support this in the future? If implementing this doesn't involve javascript, I'm happy to take a look and see if I can help with it!
Srikrishna Sekhar
On 22 May 2016 at 15:34, Bryan Van de Ven <[email protected]> wrote:
I'm about certain this has never worked. You can just pass x=list(range(len(dat)))
I am unable to plot numpy arrays with a single dimension - The plot turns up empty. I'm pretty sure this was possible on an earlier release of Bokeh (maybe 0.10?, I'm not a 100% sure)
Below is a code sample that gives me an error
from bokeh.io import output_file
from bokeh.plotting import figure, show
import numpy as np
dat = np.random.randn(100)
output_file('temp.html')
plt = figure()
plt.circle(dat)
show(plt)
I agree that doing it this way would be non-trivial. But, I like this idea
of having other constructor classmethods, possibly decorated in some way to
indicate how they match arguments. So, in spirit, similar to the
MultipleDispatch library, but matching based on the number (and perhaps,
the shape) of positional args, rather than their types. And you would want
to generically handle positional vs keyword arguments.
The real challenge will be the logic involved shape transformation, e.g.
"unzipping" lists of 2-tuples into two lists of scalars. This seems like a
very common and useful capability to have in the library, but it doesn't
fit with how things are implemented. (This also gets into things like,
lists of dicts, and transposing that into a ColumnDataSource...)
-Peter
···
On Fri, Jun 3, 2016 at 11:17 PM, Bryan Van de Ven <[email protected]> wrote:
I can't say we have any plans, tho if you wanted to submit a PR it could
be discussed. However, I don't think it would be entirely trivial. In order
to support automated docs generation and boilerplate reduction, the glyph
functions are actually derived programmatically, e.g. here:
And the issue is that this type of capability would only be appropriate
for a subset of the glyph methods, not all of them, which means modifying
the automation machinery in a way that makes it works on the subset of
glyphs that it makes sense for. It would probably involve adding some kind
of static class metadata to the Glyph classes that woudl support this
optimization, and then having _glyph_function inspect for that.
Right to do this in general, it seems like you need hooks on the glyph methods to delegate (*args, **kwargs) parsing into some defined "internal" interface specification. I'm not sure it's "hard" per se, but it is actual work, and would require both tests as well as the appropriate hooks into the documentation automation machinery.
On Fri, Jun 3, 2016 at 11:17 PM, Bryan Van de Ven <[email protected]> wrote:
I can't say we have any plans, tho if you wanted to submit a PR it could be discussed. However, I don't think it would be entirely trivial. In order to support automated docs generation and boilerplate reduction, the glyph functions are actually derived programmatically, e.g. here:
And the issue is that this type of capability would only be appropriate for a subset of the glyph methods, not all of them, which means modifying the automation machinery in a way that makes it works on the subset of glyphs that it makes sense for. It would probably involve adding some kind of static class metadata to the Glyph classes that woudl support this optimization, and then having _glyph_function inspect for that.
I agree that doing it this way would be non-trivial. But, I like this idea of having other constructor classmethods, possibly decorated in some way to indicate how they match arguments. So, in spirit, similar to the MultipleDispatch library, but matching based on the number (and perhaps, the shape) of positional args, rather than their types. And you would want to generically handle positional vs keyword arguments.
The real challenge will be the logic involved shape transformation, e.g. "unzipping" lists of 2-tuples into two lists of scalars. This seems like a very common and useful capability to have in the library, but it doesn't fit with how things are implemented. (This also gets into things like, lists of dicts, and transposing that into a ColumnDataSource...)