<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic how to adjust Bivariate plot x axis scale with weekly date/time data in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/how-to-adjust-Bivariate-plot-x-axis-scale-with-weekly-date-time/m-p/81559#M36971</link>
    <description>&lt;P&gt;Hello everyone:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is my first posting. I am still a neophite with JSL and I've been trying to solve my problem for couple of days. Here is the problem setup...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a datafile that I need to analyze every Friday. This datafile consists of a date/time log of some values captured real time. So every Friday, this datafile has a new date range. I wrote a script to plot this data in a bivariate plot where the x axis is date/time and the y axis is some parameter of interest:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;trendChart = Bivariate(
	Y( :PARAMETER ),
	X( :DATE ),
	SendToReport(
		Dispatch(
			{},
			"1",
			ScaleBox,
			{Format( "m/d/y", 10 ), Min( &lt;FONT color="#FF0000"&gt;minDate&lt;/FONT&gt; ), Max( &lt;FONT color="#FF0000"&gt;maxDate&lt;/FONT&gt; ),
			Interval( "Day" ), Inc( 7 ), Minor Ticks( 6 ),
			Label Row( Label Orientation( "Vertical" ) )}
		),
		Dispatch(
			{},
			"2",
			ScaleBox,
			{Max( myMaxValue ), Label Row( {Show Major Grid( 1 ), Show Minor Grid( 1 )} )}
		),
		Dispatch(
			{},
			"Bivar Plot",
			FrameBox,
			{Frame Size( 720, 360 ), Row Legend(
				PROGRAM_NAME,
				Color( 1 ),
				Color Theme( "JMP Vibrant" ),
				Marker( 1 ),
				Marker Theme( "Hollow" ),
				Continuous Scale( 0 ),
				Reverse Scale( 0 ),
				Excluded Rows( 0 )
			)}
		)
	)
);&lt;/PRE&gt;&lt;P&gt;I want this plot to be automatically scaled in the x-axis so that the minimum point is the oldest date in the datafile and the maximum point is the youngest date in the datafile. I think the best way to do this is to have 2 variables that depend on the actual contents of the datafile, &lt;STRONG&gt;minDate&lt;/STRONG&gt; and &lt;STRONG&gt;maxDate&lt;/STRONG&gt; and I defined these as:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;&lt;FONT color="#FF0000"&gt;minDate&lt;/FONT&gt; = col min(dt1, :DATE);
&lt;FONT color="#FF0000"&gt;maxDate&lt;/FONT&gt; = col max(dt1, :DATE);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Running these code snips in my larger script generates an empty plot (no data shown). Debugging shows that both &lt;FONT color="#FF0000"&gt;minDate&lt;/FONT&gt; and &lt;FONT color="#FF0000"&gt;maxDate&lt;/FONT&gt; are blank so I must not be defining these variables correctly.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would appreciate some insight.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your help.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 26 Oct 2018 19:17:51 GMT</pubDate>
    <dc:creator>abpc1</dc:creator>
    <dc:date>2018-10-26T19:17:51Z</dc:date>
    <item>
      <title>how to adjust Bivariate plot x axis scale with weekly date/time data</title>
      <link>https://community.jmp.com/t5/Discussions/how-to-adjust-Bivariate-plot-x-axis-scale-with-weekly-date-time/m-p/81559#M36971</link>
      <description>&lt;P&gt;Hello everyone:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is my first posting. I am still a neophite with JSL and I've been trying to solve my problem for couple of days. Here is the problem setup...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a datafile that I need to analyze every Friday. This datafile consists of a date/time log of some values captured real time. So every Friday, this datafile has a new date range. I wrote a script to plot this data in a bivariate plot where the x axis is date/time and the y axis is some parameter of interest:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;trendChart = Bivariate(
	Y( :PARAMETER ),
	X( :DATE ),
	SendToReport(
		Dispatch(
			{},
			"1",
			ScaleBox,
			{Format( "m/d/y", 10 ), Min( &lt;FONT color="#FF0000"&gt;minDate&lt;/FONT&gt; ), Max( &lt;FONT color="#FF0000"&gt;maxDate&lt;/FONT&gt; ),
			Interval( "Day" ), Inc( 7 ), Minor Ticks( 6 ),
			Label Row( Label Orientation( "Vertical" ) )}
		),
		Dispatch(
			{},
			"2",
			ScaleBox,
			{Max( myMaxValue ), Label Row( {Show Major Grid( 1 ), Show Minor Grid( 1 )} )}
		),
		Dispatch(
			{},
			"Bivar Plot",
			FrameBox,
			{Frame Size( 720, 360 ), Row Legend(
				PROGRAM_NAME,
				Color( 1 ),
				Color Theme( "JMP Vibrant" ),
				Marker( 1 ),
				Marker Theme( "Hollow" ),
				Continuous Scale( 0 ),
				Reverse Scale( 0 ),
				Excluded Rows( 0 )
			)}
		)
	)
);&lt;/PRE&gt;&lt;P&gt;I want this plot to be automatically scaled in the x-axis so that the minimum point is the oldest date in the datafile and the maximum point is the youngest date in the datafile. I think the best way to do this is to have 2 variables that depend on the actual contents of the datafile, &lt;STRONG&gt;minDate&lt;/STRONG&gt; and &lt;STRONG&gt;maxDate&lt;/STRONG&gt; and I defined these as:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;&lt;FONT color="#FF0000"&gt;minDate&lt;/FONT&gt; = col min(dt1, :DATE);
&lt;FONT color="#FF0000"&gt;maxDate&lt;/FONT&gt; = col max(dt1, :DATE);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Running these code snips in my larger script generates an empty plot (no data shown). Debugging shows that both &lt;FONT color="#FF0000"&gt;minDate&lt;/FONT&gt; and &lt;FONT color="#FF0000"&gt;maxDate&lt;/FONT&gt; are blank so I must not be defining these variables correctly.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would appreciate some insight.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your help.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Oct 2018 19:17:51 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/how-to-adjust-Bivariate-plot-x-axis-scale-with-weekly-date-time/m-p/81559#M36971</guid>
      <dc:creator>abpc1</dc:creator>
      <dc:date>2018-10-26T19:17:51Z</dc:date>
    </item>
    <item>
      <title>Re: how to adjust Bivariate plot x axis scale with weekly date/time data</title>
      <link>https://community.jmp.com/t5/Discussions/how-to-adjust-Bivariate-plot-x-axis-scale-with-weekly-date-time/m-p/81715#M36983</link>
      <description>&lt;P&gt;The structure of the Col Min() function is&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;x = Col Min( Column, By Column );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The column you are specifying in your code&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;minDate = col min(dt1, :DATE);
maxDate = col max(dt1, :DATE);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;appears to not be asking for the :Date column to find the minimum and maximum values for, but for a column called "dt1".&amp;nbsp; I assume that "dt1" is actually a pointer to your data table.&amp;nbsp; I believe your code should be:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;minDate = col min( :DATE);
maxDate = col max( :DATE);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 28 Oct 2018 02:13:45 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/how-to-adjust-Bivariate-plot-x-axis-scale-with-weekly-date-time/m-p/81715#M36983</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2018-10-28T02:13:45Z</dc:date>
    </item>
  </channel>
</rss>

