The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum for Programming
 LabTalk Forum
 DoubleY plot with different color

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
algarhyplasma 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
6   L A T E S T    R E P L I E S    (Newest First)
algarhyplasma 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
ChaoC Posted - 11/01/2023 : 09:55:59 AM
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
algarhyplasma 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 Posted - 10/31/2023 : 2:33:23 PM
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
algarhyplasma 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 Posted - 10/31/2023 : 08:49:02 AM
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

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000