<?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 Re: How to find both peaks and valleys in a data using JSL in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-find-both-peaks-and-valleys-in-a-data-using-JSL/m-p/908922#M106746</link>
    <description>&lt;P&gt;I got everything to work, accepted as solution. However when I try to do chart builder it keeps making the line a mean. I'm assuming something in the script is causing this. Can anyone support in addressing this issue?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 21 Oct 2025 17:28:57 GMT</pubDate>
    <dc:creator>spacejmpuser</dc:creator>
    <dc:date>2025-10-21T17:28:57Z</dc:date>
    <item>
      <title>How to find both peaks and valleys in a data using JSL</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-find-both-peaks-and-valleys-in-a-data-using-JSL/m-p/908638#M106717</link>
      <description>&lt;P&gt;I am new to creating scripts and having trouble creating one that labels the peaks and valleys on the data.&lt;/P&gt;
&lt;P&gt;The goal is to actually label all valleys after the first Peak is detected. I am trying to simplify it by creating a script that graphs the data and labels all peaks and valleys to allow easier data analysis by my team. Tried to follow past instructions and it seems I just can't get it to work.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have tried to explore all existing solutions for this but had trouble implementing a solution that worked for me.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Oct 2025 20:46:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-find-both-peaks-and-valleys-in-a-data-using-JSL/m-p/908638#M106717</guid>
      <dc:creator>spacejmpuser</dc:creator>
      <dc:date>2025-10-20T20:46:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to find both peaks and valleys in a data using JSL</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-find-both-peaks-and-valleys-in-a-data-using-JSL/m-p/908690#M106722</link>
      <description>&lt;P&gt;Your data seems to have character data type which at least requires changing the data to numeric/continuous.&amp;nbsp;Could you use your data, create a plot and mark what you are interested in finding/detecting. Usually you can find peaks/valleys using some combination of Lag/Dif and maybe some if statements&lt;/P&gt;</description>
      <pubDate>Tue, 21 Oct 2025 03:52:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-find-both-peaks-and-valleys-in-a-data-using-JSL/m-p/908690#M106722</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-10-21T03:52:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to find both peaks and valleys in a data using JSL</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-find-both-peaks-and-valleys-in-a-data-using-JSL/m-p/908727#M106726</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CoverMarmoset89_0-1761028166706.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/85427i5616E4EE33A8C07B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="CoverMarmoset89_0-1761028166706.png" alt="CoverMarmoset89_0-1761028166706.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open("$DESKTOP/Sample.jmp");
 
max_value = Col Maximum(Column(dt, "Heat"));
 
total_rows = N Row(dt);
Time_col = Column(dt, "Heat");
row_num = 0;
For(i = total_rows, i &amp;gt;= 1, i--,
	If(Time_col[i] == max_value,
		row_num = i;
		Break();
	)
);
max_time = :Time[row_num];
 
col_data = Column(dt, "Heat") &amp;lt;&amp;lt; Get Values;
min_data = col_data[row_num :: total_rows];
min_value = Minimum(min_data);
min_positions = Loc Min(min_data);
min_time_col = min_positions + (row_num - 1);
min_time = :Time[min_time_col];
 
Graph Builder(
	Size(1032, 646),
	Show Control Panel(0),
	Fit to Window("Off"),
	Variables(X(:Time), Y(:Heat)),
	Elements(Line(X, Y, Legend(14))),
	SendToReport(
		Dispatch({}, "Time", ScaleBox,
			{Format("Best", 12), Min(1.88), Max(5.07800951567129), Inc(0.5), Minor Ticks(4),
			Add Ref Line(
				max_time,
				"Dotted",
				"Black",
				Char(max_time),
				2,
				1,
				Label Settings({Label Color("Red")})
			), Add Ref Line(
				min_time,
				"Dotted",
				"Black",
				Char(min_time),
				2,
				1,
				Label Settings({Label Color("Red")})
			)}
		),
		Dispatch({}, "Heat", ScaleBox,
			{Add Ref Line(
				max_value,
				"Dotted",
				"Black",
				Char(max_value),
				2,
				1,
				Label Settings({Label Color("Red")})
			), Add Ref Line(
				min_value,
				"Dotted",
				"Black",
				Char(min_value),
				2,
				1,
				Label Settings({Label Color("Red")})
			)}
		)
	)
);

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 21 Oct 2025 07:40:28 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-find-both-peaks-and-valleys-in-a-data-using-JSL/m-p/908727#M106726</guid>
      <dc:creator>lwencx</dc:creator>
      <dc:date>2025-10-21T07:40:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to find both peaks and valleys in a data using JSL</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-find-both-peaks-and-valleys-in-a-data-using-JSL/m-p/908742#M106730</link>
      <description>&lt;P&gt;Is there something that isn't being done by that script?&lt;/P&gt;</description>
      <pubDate>Tue, 21 Oct 2025 07:42:00 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-find-both-peaks-and-valleys-in-a-data-using-JSL/m-p/908742#M106730</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-10-21T07:42:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to find both peaks and valleys in a data using JSL</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-find-both-peaks-and-valleys-in-a-data-using-JSL/m-p/908918#M106743</link>
      <description>&lt;P&gt;Thank you for taking the time to share this code! I am running into a problem where when I run the same script the chart that is generated is very different. what am I doing wrong?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Oct 2025 17:03:57 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-find-both-peaks-and-valleys-in-a-data-using-JSL/m-p/908918#M106743</guid>
      <dc:creator>spacejmpuser</dc:creator>
      <dc:date>2025-10-21T17:03:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to find both peaks and valleys in a data using JSL</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-find-both-peaks-and-valleys-in-a-data-using-JSL/m-p/908919#M106744</link>
      <description>&lt;P&gt;If you use the sample table provided it won't work unless you fix the column data types to numeric and &lt;STRONG&gt;modeling types to continuous.&amp;nbsp;&lt;/STRONG&gt;My guess is that you didn't do the modeling type conversion.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Oct 2025 17:11:14 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-find-both-peaks-and-valleys-in-a-data-using-JSL/m-p/908919#M106744</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-10-21T17:11:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to find both peaks and valleys in a data using JSL</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-find-both-peaks-and-valleys-in-a-data-using-JSL/m-p/908920#M106745</link>
      <description>&lt;P&gt;Thank you, after updating everything the chart shows a mean line for summary statistic. It now shows the peak and valley so I will try to figure out how to make the line show the actual data.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Oct 2025 17:17:02 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-find-both-peaks-and-valleys-in-a-data-using-JSL/m-p/908920#M106745</guid>
      <dc:creator>spacejmpuser</dc:creator>
      <dc:date>2025-10-21T17:17:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to find both peaks and valleys in a data using JSL</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-find-both-peaks-and-valleys-in-a-data-using-JSL/m-p/908922#M106746</link>
      <description>&lt;P&gt;I got everything to work, accepted as solution. However when I try to do chart builder it keeps making the line a mean. I'm assuming something in the script is causing this. Can anyone support in addressing this issue?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Oct 2025 17:28:57 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-find-both-peaks-and-valleys-in-a-data-using-JSL/m-p/908922#M106746</guid>
      <dc:creator>spacejmpuser</dc:creator>
      <dc:date>2025-10-21T17:28:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to find both peaks and valleys in a data using JSL</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-find-both-peaks-and-valleys-in-a-data-using-JSL/m-p/908923#M106747</link>
      <description>&lt;P&gt;It will use mean line because you have multiple measurements happening exactly at the same time.&lt;/P&gt;
&lt;P&gt;Edit: Make sure your data is ordered correctly and then use Row order&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1761068155941.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/85481iE779819EFBDD8FE6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1761068155941.png" alt="jthi_0-1761068155941.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;This way it shouldn't be using summary statistics and will order the data on x-axis based on the row order of your table&lt;/P&gt;</description>
      <pubDate>Tue, 21 Oct 2025 17:36:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-find-both-peaks-and-valleys-in-a-data-using-JSL/m-p/908923#M106747</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-10-21T17:36:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to find both peaks and valleys in a data using JSL</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-find-both-peaks-and-valleys-in-a-data-using-JSL/m-p/908934#M106748</link>
      <description>&lt;P&gt;Thank you, the solution was to ensure all data columns were labeled as numeric and continuous. Thank you all for your patience while helping me.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Oct 2025 17:46:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-find-both-peaks-and-valleys-in-a-data-using-JSL/m-p/908934#M106748</guid>
      <dc:creator>spacejmpuser</dc:creator>
      <dc:date>2025-10-21T17:46:26Z</dc:date>
    </item>
  </channel>
</rss>

