Author |
Topic |
|
gzforever
Poland
14 Posts |
Posted - 11/09/2016 : 8:12:31 PM
|
Hello everyone,
I am writing the scripts to make my work faster. I want to do a specific type of Graph. I Imported all required files with my srcipt, but i have no idea how to draw properly the stacked lines by Y offset Graph. I did this manually:
I want do the same in my script.
Kind regards, JZ |
|
yuki_wu
896 Posts |
Posted - 11/10/2016 : 02:11:39 AM
|
Hi JZ,
For the stacked lines by Y offset, you can try the following scripts:
//Set the specified range to be the current selection
//(Syntax: worksheet -s c1 r1 c2 r2)
worksheet -s 1,4,0,0;
//Plot stacked lines by Y offset
worksheet -p 200 OffsetStackY;
Note: To select entire columns, set r1 and r2 to zero.
More information of using Worksheet command to set various formatting options, such as -s and -p, could be found here: http://www.originlab.com/doc/LabTalk/ref/Worksheet-cmd
Regards, Yuki OriginLab |
|
|
gzforever
Poland
14 Posts |
Posted - 11/10/2016 : 09:55:23 AM
|
Hi Yuki,
Thanks for your help. I added your scripts to my code and it works fine!
However there is one detail i really want to change:
Appearance of the curves from my graph:
I want them to look like these: (Made in Origin manually):
Is there some easy way to change the color/width of all curves in active layer ? I only know how to do it one by one .
Kind Regards, JZ |
Edited by - gzforever on 11/10/2016 09:58:22 AM |
|
|
yuki_wu
896 Posts |
Posted - 11/13/2016 : 10:03:19 PM
|
Hi JZ,
I am afraid that there is no easy way to change the properties of all stacked lines at one time.
Since the stacked lines is drawn by a group. If you want to reset their colors, you need to ungroup them and change their colors one by one.
However, the colors may turn back to the original colors when you group it again.
I am sorry that I do not find a good way for now.
Yuki OriginLab
|
Edited by - yuki_wu on 11/13/2016 10:03:41 PM |
|
|
gzforever
Poland
14 Posts |
Posted - 12/03/2016 : 11:56:06 AM
|
Hi yuki,
I found strange problem - Graph (stacked lines by offset from this topic) works fine in my origin 2016 (home), but in origin 2015 (lab) the graph isn't rescaled properly. Of course i found the solution, which works. However i wanted to understand something, what doesn't let me sleep :D
I have sections in my code, when i use rescale command right after creating and formating graph - it doesn't work. I have to use this command in the next iteration of loop or after creating last graph (to rescale the last one). The code is big, but it work fine, the only thing i dont get is Rescale command bahavior.
The code is very long (130 lines) so i put it on the webside for coders (just look for rescale in this code - i describe everthing):
http://wklej.org/id/2978190/
Regards, JZ |
|
|
yuki_wu
896 Posts |
Posted - 12/05/2016 : 01:29:13 AM
|
Hi JZ,
You’d better add a pause before rescale. For example:
sec -p 1;// pause for 1 second
rescale;
Hope it helps.
Regards, Yuki OriginLab
|
|
|
gzforever
Poland
14 Posts |
Posted - 12/12/2016 : 6:12:22 PM
|
Hello,
One more question to this topic. Can i somehow revert the order of the curves on this kind of graph ?
Currently i am sorting the columns. I wonder if i can do this some other way.
layer -r doesn't work correctly in OffsetStackY template.
Kind Regards, JZ |
Edited by - gzforever on 12/12/2016 6:14:14 PM |
|
|
yuki_wu
896 Posts |
Posted - 12/12/2016 : 10:33:52 PM
|
Hi JZ,
The stacked lines is drawn by a group. When you reverse the order of the data plots, the data plots will be ungroup at the same time. Thus, you need to group them again:
layer -r;//reverse the order of the data plots
layer -g;//group the data plots
Hope it helps.
Regards, Yuki OriginLab |
|
|
|
Topic |
|