Author |
Topic |
|
algarhyplasma
USA
4 Posts |
Posted - 10/30/2023 : 12:41:35 PM
|
I'm trying to plot doubleY graph with 2 layers or 2Ys Y-Y graph. I'm using the following code. But I need to make a different color for each line. Does anyone know how to change the color of each line?
string filePath$ = "C:\Users\User1\Desktop\Alldata.xlsx"; newbook; impExcel -o %C filePath$;
wks.col1.type = 2;
for (int i = 2; i <= 5; i++) { wks.col(i).type = 3; }
wks.col7.type = 4; for (int i = 8; i <= 14; i++) { wks.col(i).type = 5; // Set the Y2-axis type to Y }
string bkname$ = page.name$; string shname$ = layer.name$; plotxy iy:=((1,2:5)) plot:=200 ogl:=[<new template:=doubleY>]; plotxy iy:=[bkname$]shname$!((7,8:12)) plot:=200 ogl:=2;
mahmoud |
|
ChaoC
USA
174 Posts |
|
algarhyplasma
USA
4 Posts |
Posted - 10/31/2023 : 12:35:28 PM
|
Thank you so much for your kind help. I don't know exactly how to use "Set" to change the color of each line. Could you please give me an example of how to change the color of each line?
best regards Mahmoud
quote: Originally posted by ChaoC
Hello,
You can use the 'set' command to modify the attributes of a data plot.
Please see: https://www.originlab.com/doc/LabTalk/guide/Formatting-Graphs#Data_Plot_Properties
Best, Chao
mahmoud |
|
|
ChaoC
USA
174 Posts |
|
algarhyplasma
USA
4 Posts |
Posted - 10/31/2023 : 4:58:25 PM
|
Thanks, Chao, I already tried to use -c and -cl but unfortunately, it can't change the color of each line, it just changes the color of the whole layer.
Regards,
quote: Originally posted by ChaoC
Hello,
The link provides an example:
// Change plot line color
sec -p 1;
set %C -cl color(red);
You can go to this page to see more options and their examples: https://www.originlab.com/doc/en/LabTalk/ref/Set-cmd#Option_for_Data_Plots
For your case, please see the options "-c" and "-cl"
Best, Chao
mahmoud |
|
|
ChaoC
USA
174 Posts |
|
algarhyplasma
USA
4 Posts |
Posted - 11/01/2023 : 1:40:14 PM
|
Dear Chao, It works. I really appreciate your help. Thank you so much.
Mahmoud
quote: Originally posted by ChaoC
quote: Originally posted by algarhyplasma
it can't change the color of each line, it just changes the color of the whole layer.
You will have to set your grouped plots to be independent. See: https://www.originlab.com/doc/en/LabTalk/ref/Options_for_Other_Options#-gm
Best, Chao
mahmoud |
|
|
|
Topic |
|