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
 Origin Forum
 Bug? Using user-defined colors in the legend

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
johannes.kastl Posted - 08/30/2012 : 07:19:07 AM
Hello everyone,

one can define up to 16 colors and store them in the user-defined colors. You can use them as fill colors, symbol colors, etc. or when used in an index column to set different bars in a bar diagramm do different colors. The index is 25 to 40, 1 to 24 are the Origin colors.

Also, in the legend you can manually plot symbols, e.g. if your symbol size is very small in the diagramm, so you want the displayed bigger in the legend.

Syntax is:
\L(O SymEdgeColor,Sym,Fill,Size,ColorLn,LineStyle,Gap,LnWidth,SymFillColor, EdgeThickness)


Works like a charm, except I am not able to use the user-defined colors (25 to 40) in that syntax, I always end up with black. I tested with SymEdgeColor, ColorLn and SymFillColor. None worked.

Seems like a bug to me, if this is not intended. But what should it be for?

Origin Ver. and Service Release (Select Help-->About Origin): 8.6.0G SR3, Operating System: WinXP

Thanks in advance,
Johannes
6   L A T E S T    R E P L I E S    (Newest First)
johannes.kastl Posted - 09/04/2012 : 04:29:51 AM
Hi Sam,

unfortunately its inconsistent, if you use 'real' RGB values for user-defined colors or RGB columns, see
http://www.originlab.com/www/helponline/origin/en/UserGuide/Using_a_Dataset_to_Control_Plot_Color.html#Direct_RGB


I don't know if this confuses people, I think not too many need these features. But may a short paragraph for clarification (difference between RGB and color() function) would be nice on these pages.

Jm2c,
Johannes
Sam Fang Posted - 09/03/2012 : 04:20:58 AM
Hi Johannes,

you are right. The result in the page is wrong.
http://wiki.originlab.com/~originla/wiki/index.php?title=LabTalk:Color_%28function%29

I have corrected it. Thanks for your reporting.

We use the shift of 16777216 for RGB value because we use 1-24 for 24 builit-in colors in the color list. If we use 2 for RGB(2,0,0), then 2 can't represent the second color in the color list: red.

Sam
OriginLab Technical Services
johannes.kastl Posted - 08/31/2012 : 03:17:52 AM
Seems like color() takes the value calculated from the RGB values and adds 16777216. So black (0,0,0 or 0) gets 16777216, and white is no longer 16777215 but 33554431. Everything over 16777215 therefore is a color()-value.

Would be nice if you could use the 'normal' values calculated from RGB in the legend, not only the ones from color().

Regards,
Johannes
johannes.kastl Posted - 08/31/2012 : 02:44:30 AM
Hello,

thanks for confirming that it is not working, and thanks for looking into it.

@easwar:
Thank for the tip, I already used this. Its just that sometimes I need to show symbols different from the plots, e.g. when single points or bars have been modified.

@Sam:
I tried your example, which worked fine. Then I tried the numbers I have in the CustomColors.ini, in which the user-defined colors are stored by Origin (this file has been created with Origin 8.1, but worked in 8.6 without problems, at least up until now).
And these numbers did not work, all I got was black.

I then checked the actual RGB values, and put them into the color() function. And each result was different from the value in CustomColors.ini

Example: One of the custom colors is RGB(237,255,181), which is a light green. The value in CustomColors is 11927533, color() says its 28704749.

I found:
http://wiki.originlab.com/~originla/wiki/index.php?title=LabTalk:Color_%28function%29
There, color(1,2,3) results in 16777216, my Origin puts out 16974337.

http://www.originlab.com/www/helponline/origin/en/UserGuide/Using_a_Dataset_to_Control_Plot_Color.html#Direct_RGB
This page says the values are calculated with
R + (256 * G) + (65536 * B)
So Red (255,0,0) should yield 255. color() says otherwise (16777471).

Am I missing something here? I thought I could use the values directly, but it seems I have to recalculate each custom color with color().

Regards,
Johannes
Sam Fang Posted - 08/31/2012 : 02:07:05 AM
You can use rgb value for the custom color in the syntax.

e.g. for yellow color, you can type the script in the Script Window:
color(255,255,0)=


It will output:
color(255,255,0)=16842751

So you can use 16842751 to represent the color in the legend's syntax.

We have reported your suggestion to our bug tracking database. We will support custom color index in the script in the future.

Thanks.

Sam
OriginLab Technical Services
easwar Posted - 08/30/2012 : 10:44:59 AM
Hi Johannes,

Thank you for catching and reporting this issue. Yes, color index numbers above 24 are not working with this syntax, we will look into this.

For now if you just want to increase symbol size, you could use the simpler expression of:
\L(DataListPosition,s:p##)
such as:
\l(1,s:p100) %(1)
and this works fine, as it only specifies size, and not the color index.

Easwar
OriginLab

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