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
 Plot colors

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
Francesco84 Posted - 05/13/2019 : 12:00:09 PM
Origin Ver. 2019b
Operating System: Windows 10

Good evening,
I would like to ask a question.

I have a worksheet with 100 columns; the odd ones are X, while the even ones are Y.

I have to do a graph with all the functions, which are therefore 50.

I use this method:
for (int i=1; i<=50; i++)
{
plotxy iy:=[Book1]1!(col($((i*2)-1)),col($(i*2))) plot:=200 ogl:=[Graph1]1!
}

What is the best way to assign a different color to each chart?

Thank you
Francesco
4   L A T E S T    R E P L I E S    (Newest First)
Francesco84 Posted - 05/24/2019 : 03:45:00 AM
Thanks Yuki,

following your advice, I defined an array of colors to use for the plots.

StringArray Colors;
Colors.Add("color(255,0,0)");
Colors.Add("color(0,255,0)");
.
.
.

for (int i=1; i<=50; i++)
{
plotxy iy:=[Book1]1!(col($((i*2)-1)),col($(i*2))) plot:=200 ogl:=[Graph1]1!;

layer1.plot = i;

set %C -c %(Colors.GetAt(i)$);
}

Regards,
Francesco
yuki_wu Posted - 05/14/2019 : 11:24:45 PM
Hi Francesco,

To set more colors for the plots, you need to use the command below:

set DatasetName -c value;

so that you could set color by RGB value or HTML value, which have more choices.
https://www.originlab.com/doc/LabTalk/ref/Options_for_DataPlots#-c

Regards,
Yuki
OriginLab
Francesco84 Posted - 05/14/2019 : 08:29:10 AM
Hi Yuky,
Thanks for the reply.

The problem is that with the method you told me only 12 colors are generated for the curves, then they start again from the first one.

Isn't there a way to add more colors?

Thank you,
Francesco
yuki_wu Posted - 05/13/2019 : 10:42:06 PM
Hi Francesco,

After plot the data as you mentioned, we can group all the plots to set different color automaticall:
layer -g 1 50;

If you have already set the plot designation as XYXYXY… in worksheet, we can plot all columns in that worksheet directly and the plots will be set in different colors:
plotxy iy:=(?,1:end) plot:=200;

Regards,
Yuki
OriginLab

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