<?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: Reverse colors in Contour Plot Platform in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Reverse-colors-in-Contour-Plot-Platform/m-p/249006#M48894</link>
    <description>&lt;P&gt;I ran the script below in JMP 12 and JMP 15 and both of them worked without error.&amp;nbsp; If you can supply more details, I might be able to get down to the issue.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;rev=1;
Contour Plot(
	X( :height, :weight ),
	Y( :age ),
	Show Data Points( 0 ),
	Fill Areas( 0 ),
	Label Contours( 0 ),
	Reverse Colors( rev ),
	Transform( "Range Normalized" ),
	Specify Contours( Min( 12.5 ), Max( 16.5 ), N( 9 ) )
)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I used the Big Class sample data table for my testing.&lt;/P&gt;</description>
    <pubDate>Tue, 25 Feb 2020 06:14:36 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2020-02-25T06:14:36Z</dc:date>
    <item>
      <title>Reverse colors in Contour Plot Platform</title>
      <link>https://community.jmp.com/t5/Discussions/Reverse-colors-in-Contour-Plot-Platform/m-p/248954#M48876</link>
      <description>&lt;P&gt;I have a script which iterates over several columns and generates contour plots.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the column values are negative I want to reverse the contour colours, so I set a variable like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;if(col mean( col1 ) &amp;lt; 0, revcols = 1, revcols = 0);
Contour Plot(
	...
	Reverse Colors( revcols ),
	...&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;However, the problem I have is that the contour plot is now always reversed - it seems to ignore the value of revcols.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I hardcode&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Reverse Colors( 0 )&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;then it doesn't reverse the colours, but if revcols = 0 then it's reversed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do I need to do something clever to make it treat a variable with value 0 as zero in this case?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Feb 2020 16:23:13 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Reverse-colors-in-Contour-Plot-Platform/m-p/248954#M48876</guid>
      <dc:creator>matth1</dc:creator>
      <dc:date>2020-02-24T16:23:13Z</dc:date>
    </item>
    <item>
      <title>Re: Reverse colors in Contour Plot Platform</title>
      <link>https://community.jmp.com/t5/Discussions/Reverse-colors-in-Contour-Plot-Platform/m-p/249006#M48894</link>
      <description>&lt;P&gt;I ran the script below in JMP 12 and JMP 15 and both of them worked without error.&amp;nbsp; If you can supply more details, I might be able to get down to the issue.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;rev=1;
Contour Plot(
	X( :height, :weight ),
	Y( :age ),
	Show Data Points( 0 ),
	Fill Areas( 0 ),
	Label Contours( 0 ),
	Reverse Colors( rev ),
	Transform( "Range Normalized" ),
	Specify Contours( Min( 12.5 ), Max( 16.5 ), N( 9 ) )
)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I used the Big Class sample data table for my testing.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Feb 2020 06:14:36 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Reverse-colors-in-Contour-Plot-Platform/m-p/249006#M48894</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-02-25T06:14:36Z</dc:date>
    </item>
    <item>
      <title>Re: Reverse colors in Contour Plot Platform</title>
      <link>https://community.jmp.com/t5/Discussions/Reverse-colors-in-Contour-Plot-Platform/m-p/249012#M48897</link>
      <description>&lt;P&gt;Thanks for your reply! I am using JMP 14.2.0 on MacOS 10.14.6.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried your script but I am still seeing the same problem. I added this to the script so I was sure I was getting the correct output:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;SendToReport( 
	Dispatch( {}, "Contour Plot for age", OutlineBox, {Set Title( "Contour Plot for age, with rev = " || Char( rev ) )} ) 
)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;And the charts look like this (I also filled the contours to make it more obvious):&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ContourPlotRev0.png" style="width: 528px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/21887i0A17B63457122E61/image-dimensions/528x376?v=v2" width="528" height="376" role="button" title="ContourPlotRev0.png" alt="ContourPlotRev0.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ContourPlotRev1.png" style="width: 528px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/21888iDED5AF26E1267892/image-dimensions/528x376?v=v2" width="528" height="376" role="button" title="ContourPlotRev1.png" alt="ContourPlotRev1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;As before, if I hardcode in&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Reverse Colors( 0 )&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Then I get this (which is correct):&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ContourPlotRev0fixed.png" style="width: 468px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/21889i7013FE05BF8688C2/image-dimensions/468x334?v=v2" width="468" height="334" role="button" title="ContourPlotRev0fixed.png" alt="ContourPlotRev0fixed.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps. Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 25 Feb 2020 09:26:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Reverse-colors-in-Contour-Plot-Platform/m-p/249012#M48897</guid>
      <dc:creator>matth1</dc:creator>
      <dc:date>2020-02-25T09:26:56Z</dc:date>
    </item>
    <item>
      <title>Re: Reverse colors in Contour Plot Platform</title>
      <link>https://community.jmp.com/t5/Discussions/Reverse-colors-in-Contour-Plot-Platform/m-p/249046#M48903</link>
      <description>&lt;P&gt;Try converting your code to a Substitute structure, which will present to JMP the value of rev as if it is hard coded.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;rev = 1;
Eval(
	Substitute(
			Expr(
				Contour Plot(
					X( :height, :weight ),
					Y( :age ),
					Show Data Points( 0 ),
					Fill Areas( 0 ),
					Label Contours( 0 ),
					Reverse Colors( __reverse__ ),
					Transform( "Range Normalized" ),
					Specify Contours( Min( 12.5 ), Max( 16.5 ), N( 9 ) )
				)
			),
		Expr( __reverse__ ), rev
	)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 25 Feb 2020 13:58:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Reverse-colors-in-Contour-Plot-Platform/m-p/249046#M48903</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-02-25T13:58:26Z</dc:date>
    </item>
    <item>
      <title>Re: Reverse colors in Contour Plot Platform</title>
      <link>https://community.jmp.com/t5/Discussions/Reverse-colors-in-Contour-Plot-Platform/m-p/249256#M48930</link>
      <description>&lt;P&gt;Thanks for the suggestion, but still no luck. I tried this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// Code as run
Clear Globals();
rev = 0;
Eval(
	Substitute(
			Expr(
				Contour Plot(
					X( :height, :weight ),
					Y( :age ),
					Show Data Points( 0 ),
					Fill Areas( 1 ),
					Label Contours( 0 ),
					Reverse Colors( __reverse__ ),
					Transform( "Range Normalized" ),
					Specify Contours( Min( 12.5 ), Max( 16.5 ), N( 9 ) ),
					SendToReport(
						Dispatch(
							{},
							"Contour Plot for age",
							OutlineBox,
							{Set Title( "Contour Plot for age, with rev = " || Char( __reverse__ ) || " using substitute" )}
						)
					)
				)
			),
		Expr( __reverse__ ), rev
	)
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;However, the chart still came out with reversed colours. If I save the script from the chart, I get this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// code from Save Script
Contour Plot(
	X( :height, :weight ),
	Y( :age ),
	Show Data Points( 0 ),
	Fill Areas( 1 ),
	Label Contours( 0 ),
	Reverse Colors( 1 ),
	Transform( "Range Normalized" ),
	Specify Contours( Min( 12.5 ), Max( 16.5 ), N( 9 ) ),
	SendToReport(
		Dispatch(
			{},
			"Contour Plot for age",
			OutlineBox,
			{Set Title( "Contour Plot for age, with rev = 0 using substitute" )}
		)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;As you can see, the value of __reverse__ has been correctly substituted into the title text, but for some reason I still get&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Reverse Colors( 1 )&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Is this a bug and is there a workaround?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Feb 2020 15:00:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Reverse-colors-in-Contour-Plot-Platform/m-p/249256#M48930</guid>
      <dc:creator>matth1</dc:creator>
      <dc:date>2020-02-26T15:00:49Z</dc:date>
    </item>
    <item>
      <title>Re: Reverse colors in Contour Plot Platform</title>
      <link>https://community.jmp.com/t5/Discussions/Reverse-colors-in-Contour-Plot-Platform/m-p/249265#M48934</link>
      <description>&lt;P&gt;Here is a work around that works on my system&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Clear Globals();
rev = 1;
Eval(
	Substitute(
			Expr(
				Contour Plot(
					X( :height, :weight ),
					Y( :age ),
					Show Data Points( 0 ),
					Fill Areas( 1 ),
					Label Contours( 0 ),
					__reverse__, 
					Transform( "Range Normalized" ),
					Specify Contours( Min( 12.5 ), Max( 16.5 ), N( 9 ) ),
					SendToReport(
						Dispatch(
							{},
							"Contour Plot for age",
							OutlineBox,
							{Set Title( "Contour Plot for age, with rev = " || Char( rev) || " using substitute" )}
						)
					)
				)
			),
		Expr( __reverse__ ), If(rev==1,parse("Reverse Colors( 1 )"),parse("")))
	
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 26 Feb 2020 15:50:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Reverse-colors-in-Contour-Plot-Platform/m-p/249265#M48934</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-02-26T15:50:58Z</dc:date>
    </item>
  </channel>
</rss>

