How do I add multiple data to the same graph?Good morning/afternoon everyone.
I feel like this should be really very straight forward, but I am struggling to work out how to do this. In OriginPro this is really easy, but I am having to use JMP for work for the first time and so I am a total novice with this program.
The problem: I have two sets of XRD data. One from an older machine, one from a brand new machine. The data is taken over the same domain, from roughly -6000 to +3000 arc seconds. However, the spacing of the data points is different between the two machines.
So I have these two datasets and I need to overlay them on the same plot. Definitions of x (angle in arcseconds) and y (intensity in CPS) are the same.
For both data sets the main reflection occurs at approximately 0 arcseconds (as expected). Attached are plots of data from the two machines (D1 and V1).
I have tried to use Graph Builder to add these data to the same graph, to overlay one on top of the other. I have tried dragging both x domains to the x axis, but this does not result in the desired behaviour. Rather than D1 being plotted against "it's" x, and V1 being plotted "it's" x, both data sets are being plotted using only one of the x ranges. So this results in one of the datasets being either compressed or stretched, depending which x is used. Attached is both datasets plotted in graph builder, and you can see the problem.
All I want is the x range to be fixed, and for the multiple y to be plotted against an x axis.
Given that I am still new to JMP an interactive solution would be preferable, but if a script is the only possible way then I will accept that as well.
Thanks in advance for your help.
GraphicsRe: How do I add multiple data to the same graph?The data for the graph has to come from a single data table. Therefore, what you need to do is to take your 2 data tables and join or concatenate them together so you end up with your 1 X column, and 2 Y columns. Then all you need to do is to open Graph Builder and drag the X column to the X drop area, and then select both of the Y columns and drag them to the Y drop area
Use
Tables=>Join
or
Tables=>Concatenate
to put the data together. Make sure the X column name is the same in both data tables, and the Y column names are different.
Re: How do I add multiple data to the same graph?Here's one way to do it:
- Add a column to each of your datasets, e.g. "Machine". The value in the V1 table would be V1, and in the P1 table it would be P1.
- Now concatenate the two tables.
- Run graph builder and drag Omega to X, and the Y column to Y
- Drag Machine to Overlay
Here's some code that shows how to do it:
dt = New Table( "Test Combo", Add Rows( 6 ),
New Column( "Omega", Numeric, "Continuous", Format( "Best", 12 ),
Set Values( [1, 2, 3, 1, 2, 3] ) ),
New Column( "Y", Numeric, "Continuous", Format( "Best", 12 ),
Set Values( [1, 4, 10, 2, 7, 20] ) ),
New Column( "Machine", Character, "Nominal",
Set Values( {"D1", "D1", "D1", "V1", "V1", "V1"} ) )
);
dt << Graph Builder( Size( 527, 452 ), Show Control Panel( 0 ),
Variables( X( :Omega ), Y( :Y ), Overlay( :Machine ) ),
Elements( Line( X, Y, Legend( 13 ) ) ),
SendToReport( Dispatch( {}, "Y", ScaleBox,
{Scale( "Log" ), Format( "Best", 12 ), Min( 0.7 ),
Max( 20.3648979591837 ), Inc( 1 ), Minor Ticks( 1 )}
)
)
);Re: How do I add multiple data to the same graph?Here's the table:

Here's the resulting graph:

Re: How do I add multiple data to the same graph?The data are both in the same data table, but to reiterate, the problem is that they do not share the same set of x values, so your answer does not work.
Re: How do I add multiple data to the same graph?That works, but that is such an awful hack.
Is this really the only way to do this? There's genuinely no easier way to get something as basic as this done?