From 438d5c1eeaa052d50130a7ba864d2b60dff77382 Mon Sep 17 00:00:00 2001 From: Sven Augustin Date: Fri, 12 May 2023 11:17:18 +0200 Subject: [PATCH] added image example --- grum/exampledata.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/grum/exampledata.py b/grum/exampledata.py index 1925b55..c6edab9 100644 --- a/grum/exampledata.py +++ b/grum/exampledata.py @@ -1,6 +1,6 @@ import numpy as np -from .descs import PlotDescription +from .descs import PlotDescription, ImageDescription X = np.arange(100) / 10 @@ -31,4 +31,18 @@ for name, (xs, ys) in exampledata_raw.items(): ) +name = "image" +xdim = ydim = 100 +size = xdim * ydim +shape = (xdim, ydim) + +img = np.arange(size).reshape(shape) / size +img += np.random.random(shape) / 10 + +exampledata[name] = ImageDescription( + name, + image=img +) + +