topic Re: How to plot data from two tables without combining the tables in Discussions
https://community.jmp.com/t5/Discussions/How-to-plot-data-from-two-tables-without-combining-the-tables/m-p/37972#M22236
<P>Thank you for the reaction,</P><P> </P><P>unfortunately this is not what I am looking for, in my measurements there is not always a relation with the filtered data. Some values are excluded and considered as outliers. But I still would like to plot them and be aware of the outliers.</P>Tue, 11 Apr 2017 07:09:34 GMTKees_de_Vries2017-04-11T07:09:34ZHow to plot data from two tables without combining the tables
https://community.jmp.com/t5/Discussions/How-to-plot-data-from-two-tables-without-combining-the-tables/m-p/37970#M22234
<P>Hello World,</P><P> </P><P>We do measurements in our lab and we always end up with multiple data tables which contain measured data and filtered data. For some practical reasons we do not want to combine the tables in order to plot the measured data and filtered data. Is it possible to plot the x y data from one table and the x y data from the other table on the same axis in a "Fit y by x" (jmp graph type) like scatter plot?</P><P> </P><P>I am looking for the same flexibility Matlab offers with the plot function.</P><P> </P><P>Scripting or explaination of how to acchief this with the JMP gui are both appreciated.</P><P> </P><P> </P>Tue, 11 Apr 2017 06:54:05 GMThttps://community.jmp.com/t5/Discussions/How-to-plot-data-from-two-tables-without-combining-the-tables/m-p/37970#M22234Kees_de_Vries2017-04-11T06:54:05ZRe: How to plot data from two tables without combining the tables
https://community.jmp.com/t5/Discussions/How-to-plot-data-from-two-tables-without-combining-the-tables/m-p/37971#M22235
<P>Maybe this is what you need?</P><P> </P><P><A href="http://www.jmp.com/support/help/13/Virtually_Join_Data_Tables.shtml" target="_blank">http://www.jmp.com/support/help/13/Virtually_Join_Data_Tables.shtml</A></P><P> </P>Tue, 11 Apr 2017 06:56:27 GMThttps://community.jmp.com/t5/Discussions/How-to-plot-data-from-two-tables-without-combining-the-tables/m-p/37971#M22235shoffmeister2017-04-11T06:56:27ZRe: How to plot data from two tables without combining the tables
https://community.jmp.com/t5/Discussions/How-to-plot-data-from-two-tables-without-combining-the-tables/m-p/37972#M22236
<P>Thank you for the reaction,</P><P> </P><P>unfortunately this is not what I am looking for, in my measurements there is not always a relation with the filtered data. Some values are excluded and considered as outliers. But I still would like to plot them and be aware of the outliers.</P>Tue, 11 Apr 2017 07:09:34 GMThttps://community.jmp.com/t5/Discussions/How-to-plot-data-from-two-tables-without-combining-the-tables/m-p/37972#M22236Kees_de_Vries2017-04-11T07:09:34ZRe: How to plot data from two tables without combining the tables
https://community.jmp.com/t5/Discussions/How-to-plot-data-from-two-tables-without-combining-the-tables/m-p/37975#M22238
<P>Something like this might work. The example below has 2 data tables, one with valid data and one with outliers. Then to use the 2 together, a new, "Private" data table is created, and the chart is run from it.</P>
<PRE><CODE class=" language-jsl">Names Default To Here( 1 );
// Create the data table with the good data
New Table( "Big Class",
Add Rows( 36 ),
New Column( "name",
Character,
"Nominal",
Set Values(
{"KATIE", "LOUISE", "JANE", "JACLYN", "LILLIE", "TIM", "JAMES", "BARBARA", "ALICE",
"SUSAN", "JOHN", "JOE", "MICHAEL", "DAVID", "LESLIE", "CAROL", "PATTY", "FREDERICK",
"HENRY", "LEWIS", "EDWARD", "CHRIS", "JEFFREY", "MARY", "AMY", "ROBERT", "WILLIAM",
"CLAY", "MARK", "DANNY", "MARTHA", "MARION", "PHILLIP", "LINDA", "KIRK", "LAWRENCE"}
)
),
New Column( "age",
Numeric,
"Ordinal",
Set Values(
[12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14,
14, 14, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 17, 17, 17]
)
),
New Column( "sex",
Character( 1 ),
"Nominal",
Set Values(
{"F", "F", "F", "F", "F", "M", "M", "F", "F", "F", "M", "M", "M", "M", "F", "F", "F",
"M", "M", "M", "M", "M", "M", "F", "F", "M", "M", "M", "M", "M", "F", "F", "M", "F",
"M", "M"}
)
),
New Column( "height",
Numeric,
"Continuous",
Format( "Fixed Dec", 5, 0 ),
Set Values(
[59, 61, 55, 66, 52, 60, 61, 60, 61, 56, 65, 63, 58, 59, 65, 63, 62, 63, 65, 64, 68,
64, 69, 62, 64, 67, 65, 66, 62, 66, 65, 60, 68, 62, 68, 70]
)
),
New Column( "weight",
Numeric,
"Continuous",
Format( "Fixed Dec", 5, 0 ),
Set Values(
[95, 123, 74, 145, 64, 84, 128, 112, 107, 67, 98, 105, 95, 79, 142, 84, 85, 93, 119,
92, 112, 99, 113, 92, 112, 128, 111, 105, 104, 106, 112, 115, 128, 116, 134, 172]
)
),
New Column( "source",
Character,
"Nominal",
Set Values(
{"Valid", "Valid", "Valid", "Valid", "Valid", "Valid", "Valid", "Valid", "Valid",
"Valid", "Valid", "Valid", "Valid", "Valid", "Valid", "Valid", "Valid", "Valid",
"Valid", "Valid", "Valid", "Valid", "Valid", "Valid", "Valid", "Valid", "Valid",
"Valid", "Valid", "Valid", "Valid", "Valid", "Valid", "Valid", "Valid", "Valid"}
)
)
);
// Create the outlier data table
New Table( "Outliers",
Add Rows( 4 ),
New Column( "name",
Character,
"Nominal",
Set Values( {"ROBERT", "JUDY", "ELIZABETH", "ALFRED"} )
),
New Column( "age",
Numeric,
"Ordinal",
Format( "Fixed Dec", 5, 0 ),
Set Values( [12, 14, 14, 14] )
),
New Column( "sex", Character( 1 ), "Nominal", Set Values( {"M", "F", "F", "M"} ) ),
New Column( "height",
Numeric,
"Continuous",
Format( "Fixed Dec", 5, 0 ),
Set Values( [51, 61, 62, 64] )
),
New Column( "weight",
Numeric,
"Continuous",
Format( "Fixed Dec", 5, 0 ),
Set Values( [79, 81, 91, 99] )
),
New Column( "source",
Character,
"Nominal",
Set Values( {"Outlier", "Outlier", "Outlier", "Outlier"} )
)
);
// Display chart by creating a nondisplayed data table
p1 = Data Table( "Big Class" ) << Concatenate( Data Table( "Outliers" ), private );
p1 << color by column( :source );
p1 << Bivariate( Y( :height ), X( :weight ), Fit Line( {Line Color( {213, 72, 87} )} ) );
</CODE></PRE>Tue, 11 Apr 2017 11:16:33 GMThttps://community.jmp.com/t5/Discussions/How-to-plot-data-from-two-tables-without-combining-the-tables/m-p/37975#M22238txnelson2017-04-11T11:16:33ZRe: How to plot data from two tables without combining the tables
https://community.jmp.com/t5/Discussions/How-to-plot-data-from-two-tables-without-combining-the-tables/m-p/37978#M22240
<P>Jim, Thanks for the proposed sollution, this only works when the two columns in both tables have the same name. Actually I am looking for a solution where this is not the case. I can hear you ask why not change the column names :) I work with a lot of datasets containing in many cases different column names per project. I which there will be a jmp plotting function in the future which makes it possible to choose multiple x and y columns from multiple datatables.</P><P> </P><P> </P>Tue, 11 Apr 2017 13:51:16 GMThttps://community.jmp.com/t5/Discussions/How-to-plot-data-from-two-tables-without-combining-the-tables/m-p/37978#M22240Kees_de_Vries2017-04-11T13:51:16ZRe: How to plot data from two tables without combining the tables
https://community.jmp.com/t5/Discussions/How-to-plot-data-from-two-tables-without-combining-the-tables/m-p/37983#M22241
<P>You can make your own graphs with JSL like this. Selecting points in the graphs will not select rows in the tables because copies of the data are used. If you need a legend you'll have to make that too, perhaps using text(...) as shown. You'll be missing some other features provided by different platforms (splines, fits) which may make other ideas that temporarily combine the tables look a lot better. </P>
<PRE><CODE class=" language-jsl">ab = New Table( "ab data",
Add Rows( 4 ),
New Column( "a", Numeric, "Continuous", Format( "Best", 12 ), Set Values( [11, 12, 15, 17, 19] ) ),
New Column( "b", Numeric, "Continuous", Format( "Best", 12 ), Set Values( [30, 40, 20, 70, 50] ) )
);
cd = New Table( "cd data",
Add Rows( 4 ),
New Column( "c", Numeric, "Continuous", Format( "Best", 12 ), Set Values( [21, 22, 25, 27] ) ),
New Column( "d", Numeric, "Continuous", Format( "Best", 12 ), Set Values( [10, 20, 30, 60] ) )
);
New Window( "Example",
Graph Box(
Y Scale( 0, 80 ),
X Scale( 10, 30 ),
FrameSize(500,200),
Title( "ab and cd" ),
// comma delimited parameters above, semicolon delimited statements below
Pen Color( "red" );
Text Color( "red" );
Pen Size( 4 );
Marker Size( 6 );
Marker( ab:a[1 :: N Rows( ab )], ab:b[1 :: N Rows( ab )] );
Line( ab:a[1 :: N Rows( ab )], ab:b[1 :: N Rows( ab )] );
Text( {ab:a[N Rows( ab )], ab:b[N Rows( ab )]}, " ab" );
Pen Color( "green" );
Text Color( "green" );
Pen Size( 2 );
Marker Size( 3 );
Marker( cd:c[1 :: N Rows( cd )], cd:d[1 :: N Rows( cd )] );
Line( cd:c[1 :: N Rows( cd )], cd:d[1 :: N Rows( cd )] );
Text( {cd:c[N Rows( cd )], cd:d[N Rows( cd )]}, " cd" );
)
);</CODE></PRE>
<P>(There's a lot of repetition in this example; it is simpler than it looks.)</P>
<P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Thick red curve and thin green curve from different tables" style="width: 637px;"><img src="https://community.jmp.com/t5/image/serverpage/image-id/5834i7FF6F3F0BCAA7A56/image-size/large?v=v2&px=999" role="button" title="TwoCurves.PNG" alt="Thick red curve and thin green curve from different tables" /><span class="lia-inline-image-caption" onclick="event.preventDefault();">Thick red curve and thin green curve from different tables</span></span></P>Tue, 11 Apr 2017 15:34:15 GMThttps://community.jmp.com/t5/Discussions/How-to-plot-data-from-two-tables-without-combining-the-tables/m-p/37983#M22241Craige_Hales2017-04-11T15:34:15ZRe: How to plot data from two tables without combining the tables
https://community.jmp.com/t5/Discussions/How-to-plot-data-from-two-tables-without-combining-the-tables/m-p/38020#M22263
<P>Thanks for your response <A href="https://community.jmp.com/t5/user/viewprofilepage/user-id/982" target="_blank">Craige_Hales</A>,</P><P> </P><P>As you already pointed out it is not possible to use the awsome feature of making selections in the graphs and directly see the corresponding relations in other graphs. I start to believe that there is not easy solution except for renaming the columns and merge the tables in order to get the data with all the features in a single graph.</P><P> </P><P>Hopefully there will be a easy solution in a future release of jmp :)</P><P> </P>Wed, 12 Apr 2017 08:53:36 GMThttps://community.jmp.com/t5/Discussions/How-to-plot-data-from-two-tables-without-combining-the-tables/m-p/38020#M22263Kees_de_Vries2017-04-12T08:53:36Z