Author |
Topic |
|
Zenbeggar
7 Posts |
Posted - 10/28/2015 : 3:08:56 PM
|
Origin Version 8.6 OS Win 7
In my plot are 3 groups of plots each with a different palette and two single line plots whith individual colour. I ungrouped it afterwards, so evry plot has a How do I keep the colours and change the thickness of the lines in legend? It seems that the color code extracted by get -c is wrong. For instance, it should be dark greenish, but is orange instead.
Regards, Zen
|
|
snowli
USA
1387 Posts |
Posted - 10/28/2015 : 4:05:55 PM
|
Hello,
"get %c -c nColor" only gets the active plot %C's color.
if you run %C= you can see which plot it refers to.
Choose Data menu with graph window active to pick other plots as active, only at a time. Then run get %c -c nColor to get the plot's color.
BTW, we will try to improve it so that there will be scaler factors of line thickness, etc. without chaning other attributes of the plot.
Thanks, Snow |
|
|
Zenbeggar
7 Posts |
Posted - 10/28/2015 : 5:43:53 PM
|
How can I labtalk to switch the active plot? doesn't doc -e D {} loop over all Data plots? I rather think it is a mistake in color code extraction: As you can see, the plots from bias= 0.55V to 0.9V are greenish, but show different colors in the legend. They were retrieved by:
string str$=""; int nColor = 0, nn = 1; %A = %; doc -e D { get %C -c nColor; type $(nColor); //for control str$ += "\l(L $(nColor),%1) %A($(nn))%(CRLF)"; // %1 is argument for line thickness nn++; } str$ = str.Trim()$; Legend.Text$ = str$;
Somehow it does not work. |
|
|
Zenbeggar
7 Posts |
Posted - 10/28/2015 : 6:07:57 PM
|
How does the color code work? I mean the 8 digit number I get from "get %C -c color". Just for information, those are the color numbers I get 1 (black ofc) (bias=-1 V) 32238556 32366020 32493483 32686483 32813946 32941666 33069129 33262129 33389592 33517056 32400384 31348992 30232320 29180928 28064256 27012864 25896192 24844800 23728128 2 (red) (bias =0 V) 27340724 27670462 27934664 28264147 28528349 28858087 30046957 31170291 32359417 33548287 16797184 16803328 16809216 16815360 16821504 16828416 16835584 16842496
Thanks, Zen |
|
|
lkb0221
China
497 Posts |
Posted - 10/29/2015 : 09:45:34 AM
|
The description of color is: http://www.originlab.com/doc/LabTalk/ref/Color-func
Try the following script again, if not, we might need to play with your opj to see waht's happening: string str$; int Count; int nColor; layer -c; loop (ii, 1, Count) { layer.plot = ii; get %c -c nColor; str$ += "\L(L $(nColor), 3) %($(ii))%(CRLF)"; } str$=;
Btw, you can always make a ghost layer for legend. For example, duplicate your graph, make the new graphs' line thicker, and merge it back to the original one and hide it. Thus you can read the plot form the hidden layer from legend. |
|
|
Zenbeggar
7 Posts |
Posted - 10/29/2015 : 2:37:13 PM
|
Your code does the same as before. The color code numbers are the same as I have posted before. It doesn't matter if the dtata plots are grouped or not. The ghost layer is a nice hack. =) |
|
|
Zenbeggar
7 Posts |
Posted - 10/29/2015 : 3:19:43 PM
|
As it seems, the problem with "false" colors happens, when in the palette editor some values are at 0. For example If I use the green palette and the palette editor reads: red 0 0 4 green 78 173 255 blue 0 0 4. The color of the first 5 legend lines is orange, rather than greenish. For now I will just set the 0 values to 4. It will not really change colors much but the error disappeares. |
|
|
|
Topic |
|
|
|