On Fri, Feb 27, 2015 at 11:30 PM, Daniel Rothenberg [email protected] wrote:
As of Bokeh 0.8.1, is there a recommended way to set the properties of non-selected glyphs on say, a plot generated with circle()? I’d like to hack both the size of these glyphs (make the much smaller) and the color to differentiate them from the selected ones.
In : from bokeh.plotting import *
In : from bokeh.models import GlyphRenderer
In : fig = figure()
In : fig.circle([1,2,3], [1,2,3], radius=1.0)
Out: <bokeh.plotting.Figure at 0x7f41d6385dd0>
In : fig.select(dict(type=GlyphRenderer))
Out: <bokeh.models.renderers.GlyphRenderer at 0x7f41d9884e50>
In : _5.nonselection_glyph.fill_color = ‘red’
In : _5.nonselection_glyph.radius = 0.1
The non-obvious part is , because fig.circle() returns the figure itself, not the newly created glyph renderer. Perhaps even better would be to use fig.renderers[-1], because fig.circle() simply adds new glyph renderer to fig.renderers. I’m not sure why fig.circle() doesn’t return the glyph renderer (maybe others could explain that).
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].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/ed8d2492-526c-4a42-be55-699f2a629815%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.