cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
Evan_Morris
Level IV

Graph legend color pallete align with default

When I build a graph in JMP there is a default color palette (JMP Default).   It's based on the order, alphabetical I think.

 

Sometimes I need to adjust the colors, but I would still like them to be the same as the default colors.  So for instance in 1 case I have 3 lines in my top graph (blue red green) and three lines in my bottom graph (purple orange....teal?).  And I want to change the 3 lines in the bottom graph to be the same as the top (blue red green).

 

The problem is that from what I can tell the colors I can choose (with right click->line color) are not aligned with the JMP default palette.  I can't actually get the same color red.   It's either a little darker or a little lighter.

 

Does anyone know a good way to get around this?  Because I like the JMP default pallete, but it's very hard to recreate the colors.

3 REPLIES 3
jthi
Super User

Re: Graph legend color pallete align with default

Not sure how easy to use this idea is, but you could go to Other from Line Color menu and set those colors to Custom Colors. You might have to set Blue three times, red twice and green once as they will overwrite colors.

jthi_0-1691327414245.png

Then you can get the colors from Custom Colors to other lines.

jthi_1-1691327486241.png

 

Also depending on how you are creating your plots, there could be some other ways also.

-Jarmo
Evan_Morris
Level IV

Re: Graph legend color pallete align with default

Yeah this was the method I was thinking of but really was hoping there was a more straightforward solution.    Are you able to extract the RGB H/S/L values for the default colors somehow?  Otherwise it's going to be a pretty painstaking process of guess and check

jthi
Super User

Re: Graph legend color pallete align with default

I do know one way of getting those values, but they are based in index (or something...). You can have a table with a lot of different nominal/ordinal values and then set column property value colors with the theme you want. This will give a script like this

Data Table("Big Class"):name << Set Property(
	"Value Colors",
	{"ALFRED" = -13912408, "ALICE" = -4042310, "AMY" = -4354269, "BARBARA" =
	-13400361, "CAROL" = -2668175, "CHRIS" = -10628061, "CLAY" = -12893483, "DANNY"
	 = -2600622, "DAVID" = -12921289, "EDWARD" = -9351208, "ELIZABETH" = -2661054,
	"FREDERICK" = -13576604, "HENRY" = -9282864, "JACLYN" = -6995852, "JAMES" =
	-1524612, "JANE" = -9458080, "JEFFREY" = -14452073, "JOE" = -6391856, "JOHN" =
	-2745505, "JUDY" = -10199751, "KATIE" = -7150697, "KIRK" = -10513726, "LAWRENCE"
	 = -8381519, "LESLIE" = -3502441, "LEWIS" = -3615440, "LILLIE" = -13925307,
	"LINDA" = -11502354, "LOUISE" = -7449196, "MARION" = -9229791, "MARK" = -4074344,
	"MARTHA" = -13050224, "MARY" = -12565885, "MICHAEL" = -2068529, "PATTY" =
	-4494272, "PHILLIP" = -11824110, "ROBERT" = -8734293, "SUSAN" = -13849421, "TIM"
	 = -13294235, "WILLIAM" = -1078076}
);

And I think those can be converted by using Color To RGB or Color To HLS

Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");

Column(dt, "name") << Set Property(
	"Value Colors",
	{"ALFRED" = -13912408, "ALICE" = -4042310, "AMY" = -4354269, "BARBARA" =
	-13400361, "CAROL" = -2668175, "CHRIS" = -10628061, "CLAY" = -12893483, "DANNY"
	 = -2600622, "DAVID" = -12921289, "EDWARD" = -9351208, "ELIZABETH" = -2661054,
	"FREDERICK" = -13576604, "HENRY" = -9282864, "JACLYN" = -6995852, "JAMES" =
	-1524612, "JANE" = -9458080, "JEFFREY" = -14452073, "JOE" = -6391856, "JOHN" =
	-2745505, "JUDY" = -10199751, "KATIE" = -7150697, "KIRK" = -10513726, "LAWRENCE"
	 = -8381519, "LESLIE" = -3502441, "LEWIS" = -3615440, "LILLIE" = -13925307,
	"LINDA" = -11502354, "LOUISE" = -7449196, "MARION" = -9229791, "MARK" = -4074344,
	"MARTHA" = -13050224, "MARY" = -12565885, "MICHAEL" = -2068529, "PATTY" =
	-4494272, "PHILLIP" = -11824110, "ROBERT" = -8734293, "SUSAN" = -13849421, "TIM"
	 = -13294235, "WILLIAM" = -1078076}
);

colors = Column(dt, "name") << Get Property("Value Colors");

color_aa = Parse(Substitute(Char(colors), "=", "=>", "{", "[", "}", "]"));
color_list = color_aa << get values;
Color To RGB(color_list[1]);
Color to HLS(color_list[1]);

Depending on the use cases you have, you might be able to write a script to do the color correction in graph builder. Other option would to be have data in such a format (stacked most likely), that you could have a column which you can use to determine the  colors

-Jarmo