first proper prototype

This commit is contained in:
2021-05-19 14:34:07 +02:00
parent 62e8cea4d6
commit 678b1f48a7
5 changed files with 273 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
import numpy as np
from bokeh.plotting import figure
from bokeh.models import ColumnDataSource
class Plot2D:
def __init__(self, *args, **kwargs):
data = {
"image": [np.zeros((1, 1))]
}
self.source = source = ColumnDataSource(data=data)
self.fig = fig = figure()
fig.image(source=source, x=0, y=0, dw=1, dh=1, palette="Spectral11")
def set(self, image):
self.source.data.update(image=[image])