Origin Version: OriginPro 2023
Service Release: 10.0.0.154
Operating System: Windows 11
Hello everybody,
a couple of days ago, some collaborators, asked my help to evaluate the samples they prepared using different methods (they varied 4/5 preparation parameters) using X-Ray Diffraction. I observed 7 peaks that I have analysed externally, and for each peak I would like to analyse 7 figures of merits (i.e. position, width, area, ...). In short, it means LOTS of datasets. And in theory I would like to make similar plots where each time I'm comparing the results vs. one of the preparation parameters.
My idea was then to prepare a folder with all the plots where the X data was one of the preparation parameters, copy the folder, change the X data using the following script (thanks for the version goes to YimingChen in https://my.originlab.com/forum/topic.asp?TOPIC_ID=48241):
range XDataCol=[fitData]1!93; // my new X data
doc -ef P { // loop over graph windows in the current folder
doc -ef LW { // loop over the layers in the current window
layerNo=Page.active;
doc -ef DY { // loop over the datasets in the current layer
int nplot = layer.plot;
layer -cx XDataCol $(nplot); // set the range "XDataCol" to be used as X data in plot # nplot
}
}
doc -uw; // tried this and other version of the command to force an update
}
This code more or less work because it changes the X data associated with all the datasets to the correct column in the "Plot setup" window (and if I click on "Preview" there, I can see the correct graph), however the graph itself remain unchanged (old x data are still used).
What am I doing wrong? How can I fix my script/force a graph update?
Thanks in advance,
Jacopo