コード例 #1
0
from bokeh.transforms import image_downsample
from blaze.server.client import Client
from blaze import Data

N = 1000

x = np.linspace(0, 10, N)
y = np.linspace(0, 10, N)
xx, yy = np.meshgrid(x, y)
d = np.sin(xx) * np.cos(yy)

output_server("remote_image")

c = Client('http://localhost:5006')
d = Data(c)
source = image_downsample.source()
source.from_blaze(d.array, local=True)

plot = figure(
    x_range=[0, 10],
    y_range=[0, 10],
)
plot.image(source=source,
           image="image",
           x="x",
           y="y",
           dw="dw",
           dh="dh",
           palette="Spectral11",
           tools="pan,wheel_zoom,box_zoom,reset,previewsave")
コード例 #2
0
ファイル: remote_image.py プロジェクト: asmeurer/bokeh
the remote data directory in the bokeh checkout has the sample data for this example

In addition, you must install ArrayManagement from this branch (soon to be master)
https://github.com/ContinuumIO/ArrayManagement
"""

N = 1000

x = np.linspace(0, 10, N)
y = np.linspace(0, 10, N)
xx, yy = np.meshgrid(x, y)
d = np.sin(xx)*np.cos(yy)

output_server("remote_image")
source = image_downsample.source(data_url="/defaultuser/array.table/array", 
                                 owner_username="******")

image(
    source=source,
    image="image",
    x="x",
    y="y",
    dw="dw",
    dh="dh",
    width=200,
    height=200,
    palette="palette",
    x_range=Range1d(start=0, end=10), 
    y_range=Range1d(start=0, end=10),
    tools="pan,wheel_zoom,box_zoom,reset,previewsave"
)
コード例 #3
0
the remote data directory in the bokeh checkout has the sample data for this example

In addition, you must install ArrayManagement from this branch (soon to be master)
https://github.com/ContinuumIO/ArrayManagement
"""

N = 1000

x = np.linspace(0, 10, N)
y = np.linspace(0, 10, N)
xx, yy = np.meshgrid(x, y)
d = np.sin(xx) * np.cos(yy)

output_server("remote_image")
source = image_downsample.source(data_url="/defaultuser/array.table/array",
                                 owner_username="******")

image(source=source,
      image="image",
      x="x",
      y="y",
      dw="dw",
      dh="dh",
      width=200,
      height=200,
      palette="Spectral11",
      x_range=[0, 10],
      y_range=[0, 10],
      tools="pan,wheel_zoom,box_zoom,reset,previewsave")

show()
コード例 #4
0
ファイル: remote_image.py プロジェクト: CatherineH/bokeh
from bokeh.transforms import image_downsample
from blaze.server.client import Client
from blaze import Data

N = 1000

x = np.linspace(0, 10, N)
y = np.linspace(0, 10, N)
xx, yy = np.meshgrid(x, y)
d = np.sin(xx)*np.cos(yy)

output_server("remote_image")

c = Client('http://localhost:5006')
d = Data(c)
source = image_downsample.source()
source.from_blaze(d.array, local=True)

plot = figure(x_range=[0,10],
              y_range=[0,10],
)
plot.image(
    source=source,
    image="image",
    x="x",
    y="y",
    dw="dw",
    dh="dh",
    palette="Spectral11",
    tools="pan,wheel_zoom,box_zoom,reset,previewsave"
)