添加Y坐标名称的命令是什么

时间:2016-02-03 22:20:38

标签: dm-script

当我们将CSV线图文件导入DM时,添加Y坐标名称的命令/代码是什么?如强度或计数等。

string filename
dircontents.taggroupgettagasstring("["+i+"]:Name", filename)
string extension=pathextractextension(filename,0)
if(extension!="csv" && extension!="CSV" && extension!="txt" && extension!="TXT")
{
    result("\nSkipped file "+filename+". Files must be .csv or .txt")
                continue
}

string thisfilepath=pathconcatenate(directory, filename)
image array=ReadandDisplayCSV(thisfilepath, headerline) 
drawlineplot(array, headerline, filename, IncludeError)

1 个答案:

答案 0 :(得分:0)

LinePlot

命令 - 如“图像”一章末尾的F1帮助中所述 - 是

ImageSetIntensityScale ImageSetIntensityOrigin ImageSetIntensityUnitString

F1 help

您可以按照以下示例使用它们:

image linePlot := realImage( "Spectrum", 4, 200 )
linePlot = cos( icol/iwidth * 5 * Pi() ) + random()*0.1
linePlot.ShowImage()
OKDialog( "Add X calibration" )
linePlot.ImageSetDimensionCalibration( 0, 100, 0.5, "eV" , 0 ) 

OKDialog( "Add intensity calibration" )
linePlot.ImageSetIntensityScale( 0.5 ) 
linePlot.ImageSetIntensityOrigin( 100 ) 
linePlot.ImageSetIntensityUnitString( "counts" )