pcolormesh substitute in bokeh

Hello,
Just wanted to ask if anyone got this issue solved. I am trying to create something like the below example and would like to know how to do it in bokeh.
"
r = np.arange(0, 2*a ,0.01)
theta= np.linspace(0, 2 * np.pi ,100)

R, Theta = np.meshgrid(r, theta)
A,B = Rnp.cos(Theta),Rnp.sin(Theta)

def I(l,r,Theta):
Z=np.zeros(R.shape,np.float64)
Z[np.where(R<=a)] = jv(l, (x[m] * R[np.where(R<=a)]/ a)) * np.cos(l_Theta[np.where(R<=a)])
Z[np.where(R>a)] = jv(l,x[m]) / kv(l, t[m]) * kv(l,(t[m] * R[np.where(R>a)]/ a)) * np.cos(l_Theta[np.where(R>a)])
return Z

plt.pcolormesh(A, B, I(l,r,Theta))
plt.show()
"
this is the result:

step index

Cheers

Hi,

You are trying to obtain a color-mapped image of 2D scalar array? Bokeh supports "image" and "image_rgba" glyphs, perhaps these can accomplish what you need:

  http://bokeh.pydata.org/en/latest/docs/gallery/image.html

  http://bokeh.pydata.org/en/latest/docs/gallery/image_rgba.html

pcolormesh is arguably a slightly higher level interface, perhaps a higher level color-mapped image chart would make sense for the bokeh.charts interface.

Thanks,

Bryan

···

On Apr 30, 2016, at 9:23 AM, [email protected] wrote:

Hello,
Just wanted to ask if anyone got this issue solved. I am trying to create something like the below example and would like to know how to do it in bokeh.
"
r = np.arange(0, 2*a ,0.01)
theta= np.linspace(0, 2 * np.pi ,100)

R, Theta = np.meshgrid(r, theta)
A,B = Rnp.cos(Theta),Rnp.sin(Theta)

def I(l,r,Theta):
Z=np.zeros(R.shape,np.float64)
Z[np.where(R<=a)] = jv(l, (x[m] * R[np.where(R<=a)]/ a)) * np.cos(lTheta[np.where(R<=a)])
Z[np.where(R>a)] = jv(l,x[m]) / kv(l, t[m]) * kv(l,(t[m] * R[np.where(R>a)]/ a)) * np.cos(lTheta[np.where(R>a)])
return Z

plt.pcolormesh(A, B, I(l,r,Theta))
plt.show()
"
this is the result:

Cheers

--
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/d6b54e82-3c85-4a6d-ad8a-ae20f8334da6%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.