<?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: Draw line or polygon with respect to second Y axis in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Draw-line-or-polygon-with-respect-to-second-Y-axis/m-p/77880#M36285</link>
    <description>Oh, so you mean something like&lt;BR /&gt;Y value second axis --&amp;gt; Get pixel position in plot window / on screen --&amp;gt; Calculate Y value on first axis with same pixel position?&lt;BR /&gt;Do you have an example for me?</description>
    <pubDate>Thu, 04 Oct 2018 11:55:30 GMT</pubDate>
    <dc:creator>Rob</dc:creator>
    <dc:date>2018-10-04T11:55:30Z</dc:date>
    <item>
      <title>Draw line or polygon with respect to second Y axis</title>
      <link>https://community.jmp.com/t5/Discussions/Draw-line-or-polygon-with-respect-to-second-Y-axis/m-p/77396#M36178</link>
      <description>&lt;P&gt;Hi everybody,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;my plot has two y axis. What I would like to do in a script is to draw lines and polygones.&lt;/P&gt;&lt;P&gt;I can draw with respect to the first y axis e.g. by&lt;/P&gt;&lt;P&gt;Polygon( [0,1,2], [1, 1, 3] );&lt;/P&gt;&lt;P&gt;How do I tell JMP that I mean [1, 1, 3] with respect to the second y axis? Can I switch between axis somehow just like the color or line style?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 02 Oct 2018 14:50:59 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Draw-line-or-polygon-with-respect-to-second-Y-axis/m-p/77396#M36178</guid>
      <dc:creator>Rob</dc:creator>
      <dc:date>2018-10-02T14:50:59Z</dc:date>
    </item>
    <item>
      <title>Re: Draw line or polygon with respect to second Y axis</title>
      <link>https://community.jmp.com/t5/Discussions/Draw-line-or-polygon-with-respect-to-second-Y-axis/m-p/77408#M36180</link>
      <description>&lt;P&gt;I don't see an axis switch, however, you can always get the min and max for the different axis boxes and then interprolate between the 2 scales&lt;/P&gt;</description>
      <pubDate>Tue, 02 Oct 2018 15:21:32 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Draw-line-or-polygon-with-respect-to-second-Y-axis/m-p/77408#M36180</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2018-10-02T15:21:32Z</dc:date>
    </item>
    <item>
      <title>Re: Draw line or polygon with respect to second Y axis</title>
      <link>https://community.jmp.com/t5/Discussions/Draw-line-or-polygon-with-respect-to-second-Y-axis/m-p/77878#M36283</link>
      <description>&lt;P&gt;Of course you can always do it manually by transforming coordinates. But things get more complicated when you have at least one nonlinear y axis. I was hoping there is a faster option.&lt;/P&gt;&lt;P&gt;Thanks anyway for confirming there is none. ;)&lt;/img&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Oct 2018 08:45:27 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Draw-line-or-polygon-with-respect-to-second-Y-axis/m-p/77878#M36283</guid>
      <dc:creator>Rob</dc:creator>
      <dc:date>2018-10-04T08:45:27Z</dc:date>
    </item>
    <item>
      <title>Re: Draw line or polygon with respect to second Y axis</title>
      <link>https://community.jmp.com/t5/Discussions/Draw-line-or-polygon-with-respect-to-second-Y-axis/m-p/77879#M36284</link>
      <description>&lt;P&gt;I was not implying to do it manually.&amp;nbsp; I was implying that one does have programatic access to both axes, which would allow one to calculate the Y axis position.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Oct 2018 09:34:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Draw-line-or-polygon-with-respect-to-second-Y-axis/m-p/77879#M36284</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2018-10-04T09:34:20Z</dc:date>
    </item>
    <item>
      <title>Re: Draw line or polygon with respect to second Y axis</title>
      <link>https://community.jmp.com/t5/Discussions/Draw-line-or-polygon-with-respect-to-second-Y-axis/m-p/77880#M36285</link>
      <description>Oh, so you mean something like&lt;BR /&gt;Y value second axis --&amp;gt; Get pixel position in plot window / on screen --&amp;gt; Calculate Y value on first axis with same pixel position?&lt;BR /&gt;Do you have an example for me?</description>
      <pubDate>Thu, 04 Oct 2018 11:55:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Draw-line-or-polygon-with-respect-to-second-Y-axis/m-p/77880#M36285</guid>
      <dc:creator>Rob</dc:creator>
      <dc:date>2018-10-04T11:55:30Z</dc:date>
    </item>
    <item>
      <title>Re: Draw line or polygon with respect to second Y axis</title>
      <link>https://community.jmp.com/t5/Discussions/Draw-line-or-polygon-with-respect-to-second-Y-axis/m-p/77886#M36290</link>
      <description>&lt;P&gt;Here is a simple example&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 = Graph Builder(
	Variables( X( :PNP2 ), Y( :NPN1 ), Y( :PNP1, Position( 1 ), Side( "Right" ) ) ),
	Elements( Points( X, Y( 1 ), Legend( 5 ) ), Points( X, Y( 2 ), Legend( 7 ) ) ),
	SendToReport(
		Dispatch(
			{},
			"PNP1",
			ScaleBox,
			{Format( "Best", 10 ), Min( 100 ), Max( 540.816326530612 ), Inc( 50 ), Minor Ticks( 1 )}
		)
	)
);

NPN1y1 = 110;
NPN1y2 = 122;
PNP1y1 = 300; // Right side reference

x1 = 150;
x2 = 250;
x3 = 600;

Report( gb )[framebox( 1 )] &amp;lt;&amp;lt; Add Graphics script(
	leftMin = Report( gb )[AxisBox( 2 )] &amp;lt;&amp;lt; get min;
	leftMax = Report( gb )[AxisBox( 2 )] &amp;lt;&amp;lt; get max;
	
	rightMin = Report( gb )[AxisBox( 3 )] &amp;lt;&amp;lt; get min;
	rightMax = Report( gb )[AxisBox( 3 )] &amp;lt;&amp;lt; get max;
	
	xMat = Matrix( x1 ) || Matrix( x2 ) || Matrix( x3 );
	
	// Calculate a left axis reference based upon right axix value
	newMatY = leftMin + (leftMax - leftMin) * (PNP1y1 - rightMin) / (rightMax - rightMin);
	
	yMat = Matrix( NPN1y1 ) || Matrix( NPN1y2 ) || Matrix( NewMatY );
	
	Transparency( 0.5 );
	Fill Color( {1.0, 0.5, 0.0} );
	Polygon( xmat, yMat );
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 04 Oct 2018 13:05:47 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Draw-line-or-polygon-with-respect-to-second-Y-axis/m-p/77886#M36290</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2018-10-04T13:05:47Z</dc:date>
    </item>
  </channel>
</rss>

