cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP 19 is here! See the new features at jmp.com/new.
  • Register to attend Discovery Summit 2025 Online: Early Users Edition, Sept. 24-25.
Choose Language Hide Translation Bar
hogi
Level XIII

Value Colors from another column

Hi @Jordan_Hiller , it was nice to meet you at the Discovery Summit 2025 (online) 

 

An issue I still suffer with:
How to assign colors to line plots, especially when line is used in combination with smoother:
Graph Builder. Combine Smoother and Line - how? 

hogi_0-1758860224150.png

I wished this option was available in JMP: Graph Builder: Line - possibility to add breaks 

Hm ...

 

 


Here is another interesting task - transferred to Big Class:

 

  • I want to apply colour to a large number of curves.
    So, let's use the students of big class and plot name  (39 values!) on the x-axis.
    Imagine that the bars are actually line plots in different colors.
  • I don't want to see all the data at once, but "zap" through the data - age by age
    so let's add a data filter to restrict the view to a specific age
  • The task: In this view, every (visible) student should be represented by a unique color.
    please remember: the bar graph will be complicated curves. So, we don't want 2 curves in a plot with the same color.

    We can use the new col score() which was introduced in JMP19:New in Graph Builder for JMP 19 
    so helpful! - so easy to use! - a huge benefit!
    We sort the students within an age group alphabetically
    [ the 1st students are:  Jaclyn (age:12), Alice (age: 13) , the second ones: James & Barbara ...]

    This Score can be used to assign a unique color: different score - different color.

Now, when we cycle through the age groups, we see: 
no duplicate colors in any of the age groups  hogi_0-1758875289309.png  (indeed, we can use a better color scale with more distinct colors : )

Color_by_ColScore.gif

So far: great! Now, let's address the problem.

For this plot, you can disable the legend as it provides little benefit — it just shows the value of the auxiliary column 'col score'.

Here, the students are clearly visible on the x-axis.

 

However, this is just a dummy graph. In reality, the x-axis has to be used for a continuous variable and, instead of boring bar graphs, we have complicated curves. The only way to identify the 'students' is via the legend.

 

So, how can the color settings be transferred from the auxiliary column 'col score' to the 'name' column, such that the legend makes sense?


Any suggestions or alternatives are highly welcome.

 

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class Families.jmp" );
dt << New Formula Column(
	Operation( Category( "Aggregate" ), "Score Unique" ),
	Columns( :name ),
	Group By( :age )
);
Graph Builder(
	Variables( X( :name ), Color( :"Score Unique[name][age]"n ) ),
	Elements( Bar( X, Legend( 3 ) ) ),
	Local Data Filter( Add Filter( columns( :age ), Where( :age == 12 ) ) )
);

 

 

 

2 REPLIES 2

Re: Value Colors from another column

Hi @hogi ,

 

Another cool thing you can do in JMP is use the tags to assign column properties like colour values, that way unique colours are assigned and you don't see any duplicates - you can take that tag over to different properties too.

 

Ben_BarrIngh_0-1758873357684.png

Cheers,

Ben

 

“All models are wrong, but some are useful”
hogi
Level XIII

Re: Value Colors from another column

Hi Ben, this is what I do in general - but I don't see a way how it can help here.

How can I use Value Colors for this use case? What is your suggestion?

 

Some details which might help to understand the issue.

The tricky thing:
in the columns properties of "name" I have close to 0 chance to assign meaningful colors to 40 students such that the above mentioned task can be fulfilled.

 

This is why I developed the intermediate step with the Col Score values.

But when I assign specific colors in the auxiliary column Col Score, the legend won't show the names of the students.
So: dead end?

Sore, with scripting, I can map the groups from  Col Scores to Colors for column "name". 

But is there a more elegant solution? Maybe even without the need of Col Score?

Recommended Articles