mirror of
https://github.com/m-labs/artiq.git
synced 2024-12-25 03:08:27 +08:00
thumbnail: add example
This commit is contained in:
parent
88495f2ea9
commit
6773d9e734
21
artiq/examples/master/repository/thumbnail.py
Normal file
21
artiq/examples/master/repository/thumbnail.py
Normal file
@ -0,0 +1,21 @@
|
||||
import io
|
||||
|
||||
import numpy as np
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
from artiq.experiment import *
|
||||
|
||||
|
||||
class Thumbnail(EnvExperiment):
|
||||
def build(self):
|
||||
pass
|
||||
|
||||
def run(self):
|
||||
pass
|
||||
|
||||
def analyze(self):
|
||||
plt.plot([1, 2, 0, 3, 4])
|
||||
f = io.BytesIO()
|
||||
plt.savefig(f, format="PNG")
|
||||
f.seek(0)
|
||||
self.set_dataset("thumbnail", np.void(f.read()))
|
Loading…
Reference in New Issue
Block a user