Skip to content

Commit

Permalink
add custom plot limits in exported plot script
Browse files Browse the repository at this point in the history
  • Loading branch information
kklmn committed Apr 5, 2024
1 parent d4b6b41 commit 83257ea
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions parseq/core/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,9 @@ def get_prop(self, arrayName, prop):
node. This method can be useful in creating the GUI part of a
transformation node."""

if prop in ('key', 'name'):
return arrayName

if prop not in self.properties:
raise ValueError("unknown prop {0} in arrays['{1}']".format(
prop, arrayName))
Expand Down
6 changes: 4 additions & 2 deletions parseq/core/plotExport.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,9 @@ def plot1Dsilx(nodeData):
if curve is not None:
curve.setSymbolSize(symbolsize)

# # This is how one can set energy limits for XANES:
# if 'eV' in nodeData[3][0]:
# plot.getXAxis().setLimits(5950, 6125) # set energy limits for XANES
# plot.getXAxis().setLimits(5950, 6125)

plot.show()
return plot # end plot1Dsilx
Expand Down Expand Up @@ -295,7 +296,8 @@ def plotSavedData(plots, lib='mpl'):
widgets = []
for nodeData in plots:
ndim = nodeData[2]
plotFunc = globals()['plot{0}D{1}'.format(ndim, lib)] # e.g.plot1Dmpl
plotFuncName = 'plot{0}D{1}'.format(ndim, lib) # e.g. plot1Dmpl
plotFunc = globals()[plotFuncName]
widgets.append(plotFunc(nodeData)) # to keep references to silx polots
if lib == 'mpl':
plt.show() # end plotSavedData
Expand Down

0 comments on commit 83257ea

Please sign in to comment.