本文整理汇总了Python中uk.ac.diamond.scisoft.analysis.SDAPlotter.plot方法的典型用法代码示例。如果您正苦于以下问题:Python SDAPlotter.plot方法的具体用法?Python SDAPlotter.plot怎么用?Python SDAPlotter.plot使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类uk.ac.diamond.scisoft.analysis.SDAPlotter
的用法示例。
在下文中一共展示了SDAPlotter.plot方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: plotdata
# 需要导入模块: from uk.ac.diamond.scisoft.analysis import SDAPlotter [as 别名]
# 或者: from uk.ac.diamond.scisoft.analysis.SDAPlotter import plot [as 别名]
def plotdata(filename, dataType=MAC, plotPane="DataPlot", Overlay=True):
'''Plot existing data on "MAC, PSD", or "SRS" (if any) Panel, the default is MAC data on DataPlot panel and overlay is True.
syntax:
plotdata(filename,[MAC|SRS|PSD],["MAC"|"Mythen"|"DataPlot"],[True|False])
where:
filename: the filename string in quote.
dataType: the input data types or formats available
MAC - plot MAC data on MAC panel
PSD - plot PSD data on Mythen panel
SRS - plot SRS data on SRS panel
plotPane: the graph panel to display the plot
Overlay:
'True': plot over the exist data on the graph (Default)
'False': clear existing plot data from the graph before plotting new data
'''
print("Data plotting to " + plotPane + " panel, please wait ...")
if dataType == MAC:
sfh = loadMacData(filename)
dataset=sfh.getAxis(1)
dataset.setName(filename)
if Overlay:
Plotter.plotOver(plotPane, sfh.getAxis(0), dataset)
else:
Plotter.plot(plotPane, sfh.getAxis(0), dataset)
elif dataType == SRS:
sfh = loadSRSData(filename)
if Overlay:
Plotter.plotOver(plotPane, sfh.getAxis(0), sfh.getAxis(1))
else:
Plotter.plot(plotPane, sfh.getAxis(0), sfh.getAxis(1))
elif dataType == PSD:
if not str(filename).find("mythen") == -1:
# mythen data file
dataset = loadMythenData(filename)
data=dataset.getCountDataSet()
data.setName(filename)
if Overlay:
Plotter.plotOver(plotPane, dataset.getAngleDataSet(), data)
else:
Plotter.plot(plotPane, dataset.getAngleDataSet(), data)
else:
parts = str(filename).split(File.separator)
name=parts[-1]
names=str(name).split(".")
if representsInt(names[0]):
# Mythen SRS file
for each in loadMythenSRSFile(filename):
dataset = loadMythenData(str(each) + ".dat")
data=dataset.getCountDataSet()
data.setName(each)
if Overlay:
Plotter.plotOver(plotPane, dataset.getAngleDataSet(), data)
else:
Plotter.plot(plotPane, dataset.getAngleDataSet(), data)
else:
dataset = loadMythenData(filename)
data=dataset.getCountDataSet()
data.setName(filename)
if Overlay:
Plotter.plotOver(plotPane, dataset.getAngleDataSet(), data)
else:
Plotter.plot(plotPane, dataset.getAngleDataSet(), data)
elif dataType == RAW:
# mythen raw data file
dataset = loadMythenRawData(filename)
data=DoubleDataset(dataset.getCountArray(), dataset.getCountArray().length)
channeldata=DoubleDataset(dataset.getChannelArray(),dataset.getChannelArray().length)
data.setName(filename)
if Overlay:
Plotter.plotOver(plotPane, channeldata, data)
SDAPlotter.addPlot(plotPane, "", channeldata, data, "delta", "counts")
else:
Plotter.plot(plotPane, channeldata, data)
SDAPlotter.plot(plotPane, "", channeldata, data, "delta", "counts")
else:
print "Data Type is not recognised or supported."
print "Plotting completed."
示例2: plot_line
# 需要导入模块: from uk.ac.diamond.scisoft.analysis import SDAPlotter [as 别名]
# 或者: from uk.ac.diamond.scisoft.analysis.SDAPlotter import plot [as 别名]
def plot_line(*arg, **kwarg):
_plotter.plot(*arg, **kwarg)