Adding custom vectors/images to a Bokeh plot

Hello,

I am fairly new to using Bokeh. I’ve recently written a script that will import an earthquake data set. This has worked wonderfully. I am, however, also considering the possibility of adding focal mechanisms (they look like little beachballs). https://docs.obspy.org/packages/obspy-imaging-3.png
They can be calculated and generated with the obspy package (obspy.imaging - Plotting routines for ObsPy — ObsPy Documentation (1.2.0)),

>>>from obspy.imaging.beachball import beachball
>>>np1 = [150, 87, 1]
>>>beachball(np1)

but I wouldn’t know where to start with adding these to a Bokeh map. Each beachball would look different for each event and could preferably be color coded based on other attributes in a way similar to other Bokeh glyphs. Any help is appreciated!

-Jesse

Hi,

A brief look at the package seems to indicate that it is fairly well tied to MPL. Bokeh no longer makes any attempt at built-in MPL compatibility, so the only real options are finding a way to convert the current output into something Bokeh understands, or making a new version that uses native Bokeh APIs. If you can get RGBA arrays out of the existing project, could display those directly with Bokeh using the ImageRGBA glyph (or Figure.image_rgba)

Thanks,

Bryan

···

On Sep 1, 2017, at 21:29, [email protected] wrote:

Hello,

I am fairly new to using Bokeh. I've recently written a script that will import an earthquake data set. This has worked wonderfully. I am, however, also considering the possibility of adding focal mechanisms (they look like little beachballs).
They can be calculated and generated with the obspy package (https://docs.obspy.org/packages/obspy.imaging.html\),
>>>from obspy.imaging.beachball import beachball
>>>np1 = [150, 87, 1]
>>>beachball(np1)

but I wouldn't know where to start with adding these to a Bokeh map. Each beachball would look different for each event and could preferably be color coded based on other attributes in a way similar to other Bokeh glyphs. Any help is appreciated!

-Jesse

--
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/e27bb789-03e2-48b6-bf01-ed7612274fa8%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.