Author |
Topic  |
|
Francesco84
Italy
21 Posts |
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 |
|
yuki_wu
896 Posts |
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
|
 |
|
Francesco84
Italy
21 Posts |
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
896 Posts |
|
Francesco84
Italy
21 Posts |
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 |
 |
|
|
Topic  |
|
|
|