making a graph of a sequence<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />Hi all,
I have a data table that presents a sequence over time and records only when there is a change (un equal time intervals).
I would like to produce a graph with time on the horizontal axis and parallel horizontal lines representing the three categorical variables (place, condition and condition 2).
The colors along the lines will represent the different categories of place and conditions.
I manage to produce a somewhat fake presentation by setting start time as X and end time as Y, connecting with a line, coloring by category and compressing the Y axis so the line looks horizontal.
attached is the data table with two scripts to run.
I would be very thankful for any suggestions,
Thanks,
Ron

Re: making a graph of a sequenceMay I know how you plot this type of graph further in detail?
Thank you in advance
Re: making a graph of a sequencethank you Ian@JMP ,
this is an outstanding contribution and just what i need.
ron
Re: making a graph of a sequenceFWIW, I wrote the attached script, which generates this kind of plot (basically a 'Cell Plot' with a proportionate time axis):

No doubt it could be much improved, but it's a start if anyone has the inclination to do more. I've also attached a modified version of the data from ron_horne .
Re: making a graph of a sequenceThank you stanley.koprowski1
i took your idea and tried to mix it with my inflated table concept but it is not easy.
the idea is that if in your chart i had a dot every minute it would give the look of the continuous sequence.
Apparently, once I inflate the rows by duration i get issues with stacking and joining back. how can i do the stack in a way that will accommodate the unique time indicators?
attached is the inflated file
ron
Re: making a graph of a sequenceThank you jerry.cooper ,
this must be the right solution. Yet, for what ever reason I can't produce it with JMP11. The colors just don't work out. my outcome looks like this:

Re: making a graph of a sequenceHi Ron,
Here is another option.
I stacked the columns first. I then joined the stacked table back with the original table.
Best,
Stan
Data Table( "graph.jmp" ) << Stack(
columns( :Place, :Condition, :Condition 2 ),
Source Label Column( "Category" ),
Stacked Data Column( "Positional Input" ),
Output Table("stacked")
);
Data Table( "graph.jmp" ) << Join(
With( Data Table( "stacked" ) ),
Merge Same Name Columns,
By Matching Columns( :start Date = :start Date ),
Drop multiples( 0, 0 ),
Include Nonmatches( 0, 0 ),
Preserve main table order( 1 ),
Output Table( "test" )
);
Graph Builder(
Size( 693, 562 ),
Show Control Panel( 0 ),
Variables(
X( :start Date ),
Y( :Condition 2 ),
Y( :Condition ),
Y( :Place ),
Color( :Positional Input )
),
Elements( Position( 1, 1 ), Points( X, Y, Legend( 24 ) ) ),
Elements( Position( 1, 2 ), Points( X, Y, Legend( 25 ) ) ),
Elements( Position( 1, 3 ), Points( X, Y, Legend( 26 ) ) ),
SendToReport(
Dispatch(
{},
"start Date",
ScaleBox,
{Min( 3485228794.98433 ), Max( 3487017600 ), Interval( "Day" ),
Inc( 5.78703703703704 ), Minor Ticks( 1 ), Label Row Nesting( 3 )}
)
)
);

Re: making a graph of a sequenceHi Ron,
I was able to generate the below chart by creating two new formula columns. The first column is a sequence that increases by one each time the Place entry switches I called it Place Group. Then a second column was created using Col Sum for Place Duration with Place Group as the Group By variable. Change the Place Group Modeling Type to Nominal. Then, in Graph Builder, put the place duration on the X-axis and switch to a bar chart, put Place Group in the overlay zone, and Place in the color zone. Switch the Bar type to stacked and leave Mean as the summary statistic:

This will work for the other two conditions, as well, but, I think you will need to do separate graphs... maybe you can combine them in one window...
I've attached the jmp file with the new columns and Graph Builder scripts. Hope that gets you closer to what you're wanting to do.
-Jerry
Re: making a graph of a sequenceHi Bill,
i gave the idea of inflating the table rows a go. the result is much closer but their are still a few issues.
now i create a graph in which each row (inflated) is a dot along the axes of row number.
i would like the dots to be in one line for place (in and out). visually this will be a good enough illusion of the sequence i want to see.
another problem is that i can only color by place or by condition but not both separately in the same graph.

attached is the row inflated data table with the script for this output.
thanks!
ron
Re: making a graph of a sequencehi Bill,
This is the file. It has a stat date, end date, duration in minutes and three categorical columns.
it looks like this. the truth is the graph i seek would look very similar apart that the length of the colors would be proportional to the duration.
do you think it would be useful to inflate the file (rows) by duration first? (as in this link: Expand by Frequency Column Add-In )
thanks!

Re: making a graph of a sequenceRon,
I was playing around with my data set and I cannot come up with a way to make your graph. Do you have a sample data set you can share?
Bill
Re: making a graph of a sequenceyes Ian@JMP
i think you got it right.
i was trying to produce this graphe using bars and ranges but without successes so far.
thanks,
ron
Re: making a graph of a sequence(Just want to check my understanding of what you are looking for . . . ).
You have three 'processes' (say p1, p2 and p3), each one of which can exist in several states (n1, n2 and n3 respectively). Each state is to be represented as a colour. You add a new row to the table when any one of the variables changes its state, and record the time at which that happens. You then want a (horizontal) timeline for each process showing changes in state.
Is that correct, please? If so, that doesn't sound too hard with a graphics script using a series of filled rectangles.
Re: making a graph of a sequencehi bill,
this is quite close since it allows "Format" categories to start and end multiple times. do you think it is possible to show in one bar various starting and ending points of the same category?
ron
Re: making a graph of a sequenceHi Ron,
See the image below and let me know if this is more like what you are looking for or not.

Best,
Bill
Re: making a graph of a sequencethanks txnelson ,
I know about that add in, just couldn't get it to do what i want. in terms of that platform my "tasks" start and end multiple times. for example, The location "task" switches from "in" to "out" many times and i didn't get the platform to represent that. Did i miss anything?
using the example given with the add in, i would like to have all the tasks in one bar with different segments of time indicating the different tasks. in my case there is no overlap in time between "in" and "out"
ron
Re: making a graph of a sequenceRon,
There is a Gantt Chart addin in the JMP File Exchange, that you may want to look at. It uses a method to produce a chart of sequences.
Gantt Chart Add-In
Re: making a graph of a sequenceSince JMP19 (with the new setting: within row), this type of plots is very easy now in JMP:
https://community.jmp.com/t5/Discussions/How-do-I-make-start-stop-bar-charts/m-p/913541/highlight/true#M107348
stack the 3 columns of interest, use Label on the Y axis, start Date and end Date on the X axis and Data as Color:

Data Table( "graph" ) << Stack(
columns( :Place, :Condition, :Condition 2 )
);
Graph Builder(
Size( 1110, 347 ),
Show Control Panel( 0 ),
Variables( X( :start Date ), X( :End Date, Position( 1 ) ), Y( :Label ), Color( :Data ) ),
Elements( Line( X( 1 ), X( 2 ), Y, Ordering( "Within Row" ) ) )
);