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 XII

use specific marker in Graph Builder?

I have encountered an issue in JMP when plotting multiple levels of information in one plot.

For example, the colour in the top graph is defined by age, while the colour in the bottom graph is defined by sex.


By default, JMP uses the same marker type for all plots.

This makes it difficult for the human eye to interpret the information in the legend and in the plot ('Is the purple dot 15 or F?'); even the human brain needs time to process the information.

"I am in the upper plot - with ages. I can ignore the F & M and focus on the numbers in the legend. Purple corresponds to "age=15".

hogi_2-1754644128440.png

 

you can use this script to optimize the plot on your own:

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
Graph Builder(
	Size( 485, 480 ),
	Summary Statistic( "Median" ),
	Graph Spacing( 4 ),
	Variables(
		X( :height ),
		Y( :weight ),
		Y( :weight ),
		Color( :age ),
		Color( :sex )
	),
	Elements( Position( 1, 1 ), Points( X, Y, Color( 1 ) ) ),
	Elements( Position( 1, 2 ), Points( X, Y, Color( 2 ) ) )
);

 
NB:
This example was chosen to highlight the problem.
Clearly, for this example, more meaningful settings would be to have just one plot and sex = marker | age= color
... which is not possible for the real, more complex application case.

9 REPLIES 9
hogi
Level XII

Re: use specific marker in Graph Builder?

much better:

hogi_0-1754644305731.png
Here, the human eye has the possibility to analyze the information with minimal processing by the human brain.


This plot is great for the audience - but rather difficult to create.

- what is the minimum number of mouse clicks to get this plot?

- what is the best JSL approach to get this plot?


Maybe something like

Elements( Position( 1, 1 ), Points( X, Y, Color( 1 ), Marker("circle") ) )

?

hogi
Level XII

Re: use specific marker in Graph Builder?

Yesterday two new students have been added to the class:

current data table() << add row({:sex="M",age=20, height=55, weight=160});
current data table() << add row({:sex="F",age=18, height=55, weight=150})


... are  ages = 18 | 20 displayed as circles?

hogi
Level XII

Re: use specific marker in Graph Builder?

changing the marker setting manually:

 

adding 2 new rows:

 

 

 

there seems to be some improvement with JMP19:

 


Re: use specific marker in Graph Builder?

Hi Hogi, 

 

I think I'd approach this using the "Color or Mark by Column" options to set the Markers initially. I'd then use this as the basis for an update script when new data is added - if the data update is automated via a script then it should be easy to include in one step, but manual data updating may need manual running of the update script.

 

The script below should illustrate this process

// Open sample data table
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

// Add markers and colour using Color or Mark by column

dt << Color or Mark by Column(
    	:sex,
    	Color Theme( "JMP Default" ),
    	Marker Theme( "Paired" )
    );

// Create plot to visualise issue

dt << Graph Builder(
    	Size( 570, 444 ),
    	Show Control Panel( 0 ),
    	Variables( X( :height ), Y( :weight ), Group Y( :sex ) ),
    	Elements( Points( X, Y, Legend( 2 ) ) )
    );

// Add Update Marker script to table for future use

dt << New Script(
	"Update Markers",
	Data Table ("Big Class") << Color or Mark by Column(
		:sex,
		Color Theme( "JMP Default" ),
		Marker Theme( "Paired" )
	)
)
Hope that helps,
 
Stuart
 
 
hogi
Level XII

Re: use specific marker in Graph Builder?

Hi @Stuart_Little , thanks for your suggestion.

Unfortunately, your script produces this graph:

hogi_1-1754995241009.png

This is not the graph which is needed.

The task:
Specify a marker type for a plot (i.e. all the data points in that plot) -- without affecting any other plot.

Row states are ideal for:
Specify a marker type for some data points - simultaneously for every plot.

Is there a trick how I can use Marker States for my purpose?

hogi
Level XII

Re: use specific marker in Graph Builder?

Maybe:
I can use rows states and define the marker state for every row as "circle".
As expected, all data points in the first plot are "circles"  : )

 

- but it does more than that! It also affects the he bottom plot - and all the other plots which were created from the same data table. [this is why I don't like Row States!]

 

We are somehow back with the original problem: same markers in both plots
(just circles instead of dots).

hogi_2-1754996415983.png

 


The task changed to:
How can I reset the markers for male AND female in the bottom plot ?

hogi
Level XII

Re: use specific marker in Graph Builder?

Re: use specific marker in Graph Builder?

Hi Hogi, 

 

I've had a good look through the documentation and it's stumped me too - I was sure that there was a way via labeling the data in the table for both plots, but alas it doesn't appear to work. I'd suggest adding this one to the wishlist, and as an interim step, I'd probably create the two plots separately, then combine into a single report to show both - obviously this won't look as clean as you'd like though. Happy to mock something up to illustrate this if it helps.

 

Stuart

hogi
Level XII

Re: use specific marker in Graph Builder?

Hi @Stuart_Little ,

Thanks for confirming and for offering a workaround – really appreciate that. It’s a bit surprising that something as fundamental as consistent marker control isn’t already built in JMP : (

 


@Stuart_Little wrote:

and as an interim step, I'd probably create the two plots separately, then combine into a single report to show both


The actual application case is an overlapping plot, with points and circles - and a point inside a circle shows a perfect match.
Unfortunately, I have to invest a lot of effort to get points inside circles  - and not points hiding behind points.


I'd suggest adding this one to the wishlist ...

Here it is: consistent marker control in Graph Builder 

As an alternative:
The idea of a Value Markers column property (like Value Colors) has been on the Wish List for a while: new Column Property: Value Markers . It looks like an easy solution and would save a lot of manual steps.
With 21 Kudos it's among the top 2% pending features in JMP.

hogi_0-1755191857828.png

Recommended Articles