Hello everyone,
I have some trouble with greyscale plotting. The data for the plot shown in this example is a 256x256 greyscale 2d-numpy-array with 16bit resolution.
1.) I would like to to make the plot look like the right picture with higher greyscale resolution. How can I achieve that?
2) Within the “figure” function I can define the size of the plot, but actually it is not the size of the plot but the size of the canvas element.
I would like to have the image-area itself with 256x256 without the white borders around them. Is there a setting to disable the border?
The code:
import numpy as np
from bokeh.plotting import figure, show, output_file
size = 256
image = open("rawpicdata", "rb")
array = np.fromfile(image, dtype=np.uint16)
img_array = array.reshape(size, size)
output_file("greyscale.html", title="Greyscale_Image")
p = figure(x_range=[0,size], y_range=[0,size], plot_width=size, plot_height=size)
p.image(image=[img_array[::-1]], x=[0], y=[0], dw=[size], dh=[size])
p.xaxis.visible = False
p.yaxis.visible = False
show(p)
Thank you
kju

