<?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: Plot multiple Y axis from a list of column on JSL in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Plot-multiple-Y-axis-from-a-list-of-column-on-JSL/m-p/806403#M98485</link>
    <description>&lt;P&gt;Have you compared how the script would look if Graph Builder built it? There is a small mistake in your code&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Graph Builder(
	Variables(
		X(:SITE),
		Y(:NPN1),
		Y(:PNP1, Position(1)),
		Y(:PNP2, Position(1)),
		Y(:NPN2, Position(1))
	),
	Elements(Line(X, Y(1), Y(2), Y(3), Y(4), Legend(4)))
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Notice how Position is used (you have extra []. You also had missing "," which I fixed when I added JSL formatting to your code so I could use JSL reformat easier).&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Semiconductor Capability.jmp");

gb = dt&amp;lt;&amp;lt; Graph Builder(
    Show Control Panel(1),
    Variables(X(:Site)),
    Elements(Line(X,Y))
);   

columns_list = {"NPN1", "PNP1", "PNP2", "NPN2"};

For Each({y_col, idx}, columns_list,
	Eval(evalExpr(
		gb &amp;lt;&amp;lt; Add Variable({Expr(Name Expr(As Column(dt, y_col))), Position(1), Role("Y")})
	));
);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1729138840778.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/69214iE701F98BA1974D66/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1729138840778.png" alt="jthi_0-1729138840778.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 17 Oct 2024 04:22:08 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2024-10-17T04:22:08Z</dc:date>
    <item>
      <title>Plot multiple Y axis from a list of column on JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Plot-multiple-Y-axis-from-a-list-of-column-on-JSL/m-p/806390#M98483</link>
      <description>&lt;P&gt;Hi all,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have an issue with plotting some data from an FTIR experiment. I have a list containing the name of the columns I want to plot on the Y axis so that they are all overlaid on the same scale (not on top of each other). But somehow I can't figure out how to write the code.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;I tried like this but it seems like the "Position([1])"isn't really working.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can anyone help?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;gb = dt&amp;lt;&amp;lt; Graph Builder(
    Show Control Panel(1),
    Variables(X(:Wavenumber)),
    Elements( Line(X,Y))
);
   
gb &amp;lt;&amp;lt; inval;
 
For Each({y_col, idx}, columns_list,
	Eval(evalExpr(
		gb &amp;lt;&amp;lt; Add Variable({Expr(Name Expr(As Column(dt, y_col))),Position([1]), Role("Y")})
	));
);
gb &amp;lt;&amp;lt; Update window;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 17 Oct 2024 04:13:32 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Plot-multiple-Y-axis-from-a-list-of-column-on-JSL/m-p/806390#M98483</guid>
      <dc:creator>LGaspard_98</dc:creator>
      <dc:date>2024-10-17T04:13:32Z</dc:date>
    </item>
    <item>
      <title>Re: Plot multiple Y axis from a list of column on JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Plot-multiple-Y-axis-from-a-list-of-column-on-JSL/m-p/806403#M98485</link>
      <description>&lt;P&gt;Have you compared how the script would look if Graph Builder built it? There is a small mistake in your code&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Graph Builder(
	Variables(
		X(:SITE),
		Y(:NPN1),
		Y(:PNP1, Position(1)),
		Y(:PNP2, Position(1)),
		Y(:NPN2, Position(1))
	),
	Elements(Line(X, Y(1), Y(2), Y(3), Y(4), Legend(4)))
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Notice how Position is used (you have extra []. You also had missing "," which I fixed when I added JSL formatting to your code so I could use JSL reformat easier).&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Semiconductor Capability.jmp");

gb = dt&amp;lt;&amp;lt; Graph Builder(
    Show Control Panel(1),
    Variables(X(:Site)),
    Elements(Line(X,Y))
);   

columns_list = {"NPN1", "PNP1", "PNP2", "NPN2"};

For Each({y_col, idx}, columns_list,
	Eval(evalExpr(
		gb &amp;lt;&amp;lt; Add Variable({Expr(Name Expr(As Column(dt, y_col))), Position(1), Role("Y")})
	));
);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1729138840778.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/69214iE701F98BA1974D66/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1729138840778.png" alt="jthi_0-1729138840778.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Oct 2024 04:22:08 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Plot-multiple-Y-axis-from-a-list-of-column-on-JSL/m-p/806403#M98485</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-10-17T04:22:08Z</dc:date>
    </item>
    <item>
      <title>Re: Plot multiple Y axis from a list of column on JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Plot-multiple-Y-axis-from-a-list-of-column-on-JSL/m-p/806670#M98511</link>
      <description>&lt;P&gt;Hi jthi!&lt;BR /&gt;&lt;BR /&gt;Indeed the only issue was with the [ ]... Thank you for spotting this!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Louis&lt;/P&gt;</description>
      <pubDate>Fri, 18 Oct 2024 06:55:45 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Plot-multiple-Y-axis-from-a-list-of-column-on-JSL/m-p/806670#M98511</guid>
      <dc:creator>LGaspard_98</dc:creator>
      <dc:date>2024-10-18T06:55:45Z</dc:date>
    </item>
  </channel>
</rss>

