BookmarkSubscribeRSS Feed
Choose Language Hide Translation Bar
Suttree

New Contributor

Joined:

Oct 3, 2018

Changing Time Data to be Night-Focused

Hi everyone,

 

I have some activity data from nocturnal animals that begins around 9:30 PM and ends around 6:30 AM that I would like to visualize. However, JMP naturally "starts" time data at 12 AM, thus when I go to graph it it looks like this:image.png

 

Further, the data doesn't "wrap", in that if I manually drag the axis so that the times line up to where I want them, the values are missing:

image.png

 

A quick workaround that I tried was to set the value ordering on the data so that the values from 9:30 to 11:59 PM were ordered before those of 12 AM, and this at least allowed the data to be displayed properly, allowing me to show relative activity in four different treatments:image.pngimage.png

 

However, as you can see it has really messed up the axis values!

 

I'd really appreciate any advice you can give! 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
gzmorgan0

Super User

Joined:

Jul 25, 2016

Solution

Re: Changing Time Data to be Night-Focused

I like to use deviations from midnight (Time Relative to Midnight). The file below contains a new column with an axis property to label the units.

image.png 

The column formula, takes any value after 5 pm and subtracts midnight, so it will have negative values, otherwise, just use the time value. Note 11pm is -(60*60) or -3600

	New Column( "Time Relative to Midnight",
		Numeric,
		"Continuous",
		Format( "hr:m:s", 13, 0 ),
		Input Format( "h:m:s", 0 ),
		Set Property(
			"Axis",
			{Rotated Labels( 0 ), Format( "hr:m:s", 13, 0 ), Min( -10800 ),
			Max( 25200 ), Interval( "Hour" ), Inc( 2 ), Minor Ticks( 0 ),
			Add Ref Line( -3600, "Solid", "Black", "11 pm", 1 ),
			Add Ref Line( -7200, "Solid", "Black", "10 pm", 1 ),
			Add Ref Line( -10800, "Solid", "Black", "9 pm", 1 ),
			Add Ref Line( 0, "Solid", "Black", "Midnight", 1 ),
			Add Ref Line( 3600, "Solid", "Black", "1 am", 1 ),
			Add Ref Line( 7200, "Solid", "Black", "2 am", 1 ),
			Add Ref Line( 10800, "Solid", "Black", "3 am", 1 ),
			Add Ref Line( 14400, "Solid", "Black", "4 am", 1 ),
			Add Ref Line( 18000, "Solid", "Black", "5 am", 1 ),
			Add Ref Line( 21600, "Solid", "Black", "6 am", 1 ),
			Add Ref Line( 25200, "Solid", "Black", "7 am", 1 ),
			Label Row(
				{Automatic Font Size( 1 ), Automatic Tick Marks( 1 ),
				Label Orientation( "Automatic" )}
			)}
		),
		Formula( If( :Time > 60 * 60 * 17, :Time - 60 * 60 * 24, :Time ) ),
		Suppress Eval
	)
6 REPLIES 6
uday_guntupalli

Community Trekker

Joined:

Sep 15, 2014

Re: Changing Time Data to be Night-Focused

@Suttree
      Have you already tried editing the axis settings ? 

 

image.png

Best
Uday
Suttree

New Contributor

Joined:

Oct 3, 2018

Re: Changing Time Data to be Night-Focused

Yes, I have - there's no setting that would fix my problem, unfortunately

uday_guntupalli

Community Trekker

Joined:

Sep 15, 2014

Re: Changing Time Data to be Night-Focused

@Suttree,

 Can you upload a small sample subset of your data ? 

 

 

Best
Uday
Suttree

New Contributor

Joined:

Oct 3, 2018

Re: Changing Time Data to be Night-Focused

Sure, please see attached

gzmorgan0

Super User

Joined:

Jul 25, 2016

Solution

Re: Changing Time Data to be Night-Focused

I like to use deviations from midnight (Time Relative to Midnight). The file below contains a new column with an axis property to label the units.

image.png 

The column formula, takes any value after 5 pm and subtracts midnight, so it will have negative values, otherwise, just use the time value. Note 11pm is -(60*60) or -3600

	New Column( "Time Relative to Midnight",
		Numeric,
		"Continuous",
		Format( "hr:m:s", 13, 0 ),
		Input Format( "h:m:s", 0 ),
		Set Property(
			"Axis",
			{Rotated Labels( 0 ), Format( "hr:m:s", 13, 0 ), Min( -10800 ),
			Max( 25200 ), Interval( "Hour" ), Inc( 2 ), Minor Ticks( 0 ),
			Add Ref Line( -3600, "Solid", "Black", "11 pm", 1 ),
			Add Ref Line( -7200, "Solid", "Black", "10 pm", 1 ),
			Add Ref Line( -10800, "Solid", "Black", "9 pm", 1 ),
			Add Ref Line( 0, "Solid", "Black", "Midnight", 1 ),
			Add Ref Line( 3600, "Solid", "Black", "1 am", 1 ),
			Add Ref Line( 7200, "Solid", "Black", "2 am", 1 ),
			Add Ref Line( 10800, "Solid", "Black", "3 am", 1 ),
			Add Ref Line( 14400, "Solid", "Black", "4 am", 1 ),
			Add Ref Line( 18000, "Solid", "Black", "5 am", 1 ),
			Add Ref Line( 21600, "Solid", "Black", "6 am", 1 ),
			Add Ref Line( 25200, "Solid", "Black", "7 am", 1 ),
			Label Row(
				{Automatic Font Size( 1 ), Automatic Tick Marks( 1 ),
				Label Orientation( "Automatic" )}
			)}
		),
		Formula( If( :Time > 60 * 60 * 17, :Time - 60 * 60 * 24, :Time ) ),
		Suppress Eval
	)
Suttree

New Contributor

Joined:

Oct 3, 2018

Re: Changing Time Data to be Night-Focused

VERY interesting workaround - I wouldn't have thought of that. Thanks very much!