Files
dev/script/pinkplot.py
2021-04-28 09:29:19 +02:00

37 lines
917 B
Python

if get_exec_pars().args:
filename=get_exec_pars().args[0]
else:
#Debugging
filename = "2021_03/20210323/20210228_023905_eiger.h5"
pname = filename.split('_')
pname = pname[2]
## load data from file
try:
title = load_data("plot/title", root=filename)
xlabel = load_data("plot/xlabel", root=filename)
ylabel = load_data("plot/ylabel", root=filename)
x = load_data("plot/x", root=filename)
y = load_data("plot/y", root=filename)
y_desc = load_data("plot/y_desc", root=filename)
except:
err = "Invalid pink file"
print err
raise Exception(err)
p1h=plot(None, y_desc[0], title=pname)
p1 = p1h.get(0)
p1.setTitle(title)
p1.getAxis(p1.AxisId.X).setLabel(xlabel)
p1.getAxis(p1.AxisId.Y).setLabel(ylabel)
for i in range(len(y)):
if i>0:
p1.addSeries(LinePlotSeries(y_desc[i]))
p1.getSeries(i).setData(x, y[i])
#if len(y)>1:
p1.setLegendVisible(True)