cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP will suspend normal business operations for our Winter Holiday beginning on Wednesday, Dec. 24, 2025, at 5:00 p.m. ET (2:00 p.m. ET for JMP Accounts Receivable).
    Regular business hours will resume at 9:00 a.m. EST on Friday, Jan. 2, 2026.
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.

Discussions

Solve problems, and share tips and tricks with other JMP users.
%3CLINGO-SUB%20id%3D%22lingo-sub-248954%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3EFarben%20in%20der%20Contour%20Plot-Plattform%20umkehren%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-248954%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EIch%20habe%20ein%20Skript%2C%20das%20mehrere%20Spalten%20durchl%C3%A4uft%20und%20Konturdiagramme%20generiert.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWenn%20die%20Spaltenwerte%20negativ%20sind%2C%20m%C3%B6chte%20ich%20die%20Konturfarben%20umkehren%2C%20also%20lege%20ich%20eine%20Variable%20wie%20diese%20fest%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3Eif(col%20mean(%20col1%20)%20%26lt%3B%200%2C%20revcols%20%3D%201%2C%20revcols%20%3D%200)%3B%0AContour%20Plot(%0A%20...%0A%20Reverse%20Colors(%20revcols%20)%2C%0A%20...%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3EDas%20Problem%2C%20das%20ich%20habe%2C%20ist%20jedoch%2C%20dass%20das%20Konturdiagramm%20jetzt%20immer%20umgekehrt%20ist%20%E2%80%93%20es%20scheint%20den%20Wert%20von%20revcols%20zu%20ignorieren.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWenn%20ich%20fest%20codiere%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3EReverse%20Colors(%200%20)%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3Edann%20werden%20die%20Farben%20nicht%20umgekehrt%2C%20aber%20wenn%20revcols%20%3D%200%2C%20dann%20ist%20es%20umgekehrt.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMuss%20ich%20etwas%20Schlaues%20tun%2C%20damit%20in%20diesem%20Fall%20eine%20Variable%20mit%20dem%20Wert%200%20als%20Null%20behandelt%20wird%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EDanke!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-249265%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3EBetreff%3A%20Farben%20in%20der%20Contour%20Plot-Plattform%20umkehren%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-249265%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EHier%20ist%20eine%20L%C3%B6sung%2C%20die%20auf%20meinem%20System%20funktioniert%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3EClear%20Globals()%3B%0Arev%20%3D%201%3B%0AEval(%0A%20Substitute(%0A%20%20%20Expr(%0A%20%20%20%20Contour%20Plot(%0A%20%20%20%20%20X(%20%3Aheight%2C%20%3Aweight%20)%2C%0A%20%20%20%20%20Y(%20%3Aage%20)%2C%0A%20%20%20%20%20Show%20Data%20Points(%200%20)%2C%0A%20%20%20%20%20Fill%20Areas(%201%20)%2C%0A%20%20%20%20%20Label%20Contours(%200%20)%2C%0A%20%20%20%20%20__reverse__%2C%20%0A%20%20%20%20%20Transform(%20%22Range%20Normalized%22%20)%2C%0A%20%20%20%20%20Specify%20Contours(%20Min(%2012.5%20)%2C%20Max(%2016.5%20)%2C%20N(%209%20)%20)%2C%0A%20%20%20%20%20SendToReport(%0A%20%20%20%20%20%20Dispatch(%0A%20%20%20%20%20%20%20%7B%7D%2C%0A%20%20%20%20%20%20%20%22Contour%20Plot%20for%20age%22%2C%0A%20%20%20%20%20%20%20OutlineBox%2C%0A%20%20%20%20%20%20%20%7BSet%20Title(%20%22Contour%20Plot%20for%20age%2C%20with%20rev%20%3D%20%22%20%7C%7C%20Char(%20rev)%20%7C%7C%20%22%20using%20substitute%22%20)%7D%0A%20%20%20%20%20%20)%0A%20%20%20%20%20)%0A%20%20%20%20)%0A%20%20%20)%2C%0A%20%20Expr(%20__reverse__%20)%2C%20If(rev%3D%3D1%2Cparse(%22Reverse%20Colors(%201%20)%22)%2Cparse(%22%22)))%0A%20%0A)%3B%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-249256%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3EBetreff%3A%20Farben%20in%20der%20Contour%20Plot-Plattform%20umkehren%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-249256%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EDanke%20f%C3%BCr%20den%20Vorschlag%2C%20aber%20immer%20noch%20kein%20Gl%C3%BCck.%20Ich%20habe%20Folgendes%20versucht%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3E%2F%2F%20Code%20as%20run%0AClear%20Globals()%3B%0Arev%20%3D%200%3B%0AEval(%0A%20Substitute(%0A%20%20%20Expr(%0A%20%20%20%20Contour%20Plot(%0A%20%20%20%20%20X(%20%3Aheight%2C%20%3Aweight%20)%2C%0A%20%20%20%20%20Y(%20%3Aage%20)%2C%0A%20%20%20%20%20Show%20Data%20Points(%200%20)%2C%0A%20%20%20%20%20Fill%20Areas(%201%20)%2C%0A%20%20%20%20%20Label%20Contours(%200%20)%2C%0A%20%20%20%20%20Reverse%20Colors(%20__reverse__%20)%2C%0A%20%20%20%20%20Transform(%20%22Range%20Normalized%22%20)%2C%0A%20%20%20%20%20Specify%20Contours(%20Min(%2012.5%20)%2C%20Max(%2016.5%20)%2C%20N(%209%20)%20)%2C%0A%20%20%20%20%20SendToReport(%0A%20%20%20%20%20%20Dispatch(%0A%20%20%20%20%20%20%20%7B%7D%2C%0A%20%20%20%20%20%20%20%22Contour%20Plot%20for%20age%22%2C%0A%20%20%20%20%20%20%20OutlineBox%2C%0A%20%20%20%20%20%20%20%7BSet%20Title(%20%22Contour%20Plot%20for%20age%2C%20with%20rev%20%3D%20%22%20%7C%7C%20Char(%20__reverse__%20)%20%7C%7C%20%22%20using%20substitute%22%20)%7D%0A%20%20%20%20%20%20)%0A%20%20%20%20%20)%0A%20%20%20%20)%0A%20%20%20)%2C%0A%20%20Expr(%20__reverse__%20)%2C%20rev%0A%20)%0A)%3B%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3EAllerdings%20wurde%20die%20Tabelle%20immer%20noch%20mit%20umgekehrten%20Farben%20ausgegeben.%20Wenn%20ich%20das%20Skript%20aus%20dem%20Diagramm%20speichere%2C%20erhalte%20ich%20Folgendes%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3E%2F%2F%20code%20from%20Save%20Script%0AContour%20Plot(%0A%20X(%20%3Aheight%2C%20%3Aweight%20)%2C%0A%20Y(%20%3Aage%20)%2C%0A%20Show%20Data%20Points(%200%20)%2C%0A%20Fill%20Areas(%201%20)%2C%0A%20Label%20Contours(%200%20)%2C%0A%20Reverse%20Colors(%201%20)%2C%0A%20Transform(%20%22Range%20Normalized%22%20)%2C%0A%20Specify%20Contours(%20Min(%2012.5%20)%2C%20Max(%2016.5%20)%2C%20N(%209%20)%20)%2C%0A%20SendToReport(%0A%20%20Dispatch(%0A%20%20%20%7B%7D%2C%0A%20%20%20%22Contour%20Plot%20for%20age%22%2C%0A%20%20%20OutlineBox%2C%0A%20%20%20%7BSet%20Title(%20%22Contour%20Plot%20for%20age%2C%20with%20rev%20%3D%200%20using%20substitute%22%20)%7D%0A%20%20)%0A%20)%0A)%3B%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3EWie%20Sie%20sehen%20k%C3%B6nnen%2C%20wurde%20der%20Wert%20von%20__reverse__%20korrekt%20in%20den%20Titeltext%20eingesetzt%2C%20aber%20aus%20irgendeinem%20Grund%20bekomme%20ich%20immer%20noch%20die%20Meldung%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3EReverse%20Colors(%201%20)%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3EIst%20das%20ein%20Fehler%20und%20gibt%20es%20einen%20Workaround%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EVielen%20Dank%20f%C3%BCr%20Ihre%20Hilfe!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-249046%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3EBetreff%3A%20Farben%20in%20der%20Contour%20Plot-Plattform%20umkehren%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-249046%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EVersuchen%20Sie%2C%20Ihren%20Code%20in%20eine%20Substitute-Struktur%20zu%20konvertieren%2C%20die%20JMP%20den%20Wert%20von%20rev%20so%20pr%C3%A4sentiert%2C%20als%20ob%20er%20fest%20codiert%20w%C3%A4re.%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3Erev%20%3D%201%3B%0AEval(%0A%20Substitute(%0A%20%20%20Expr(%0A%20%20%20%20Contour%20Plot(%0A%20%20%20%20%20X(%20%3Aheight%2C%20%3Aweight%20)%2C%0A%20%20%20%20%20Y(%20%3Aage%20)%2C%0A%20%20%20%20%20Show%20Data%20Points(%200%20)%2C%0A%20%20%20%20%20Fill%20Areas(%200%20)%2C%0A%20%20%20%20%20Label%20Contours(%200%20)%2C%0A%20%20%20%20%20Reverse%20Colors(%20__reverse__%20)%2C%0A%20%20%20%20%20Transform(%20%22Range%20Normalized%22%20)%2C%0A%20%20%20%20%20Specify%20Contours(%20Min(%2012.5%20)%2C%20Max(%2016.5%20)%2C%20N(%209%20)%20)%0A%20%20%20%20)%0A%20%20%20)%2C%0A%20%20Expr(%20__reverse__%20)%2C%20rev%0A%20)%0A)%3B%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-249012%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3EBetreff%3A%20Farben%20in%20der%20Contour%20Plot-Plattform%20umkehren%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-249012%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EDanke%20f%C3%BCr%20deine%20Antwort!%20Ich%20verwende%20JMP%2014.2.0%20unter%20MacOS%2010.14.6.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIch%20habe%20Ihr%20Skript%20ausprobiert%2C%20sehe%20aber%20immer%20noch%20das%20gleiche%20Problem.%20Ich%20habe%20dies%20zum%20Skript%20hinzugef%C3%BCgt%2C%20damit%20ich%20sicher%20war%2C%20dass%20ich%20die%20richtige%20Ausgabe%20erhalte%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3ESendToReport(%20%0A%20Dispatch(%20%7B%7D%2C%20%22Contour%20Plot%20for%20age%22%2C%20OutlineBox%2C%20%7BSet%20Title(%20%22Contour%20Plot%20for%20age%2C%20with%20rev%20%3D%20%22%20%7C%7C%20Char(%20rev%20)%20)%7D%20)%20%0A)%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3EUnd%20die%20Diagramme%20sehen%20so%20aus%20(ich%20habe%20auch%20die%20Konturen%20ausgef%C3%BCllt%2C%20um%20es%20deutlicher%20zu%20machen)%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22ContourPlotRev0.png%22%20style%3D%22width%3A%20528px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22ContourPlotRev0.png%22%20style%3D%22width%3A%20528px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22ContourPlotRev0.png%22%20style%3D%22width%3A%20528px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F21887i0A17B63457122E61%2Fimage-dimensions%2F528x376%3Fv%3Dv2%22%20width%3D%22528%22%20height%3D%22376%22%20role%3D%22button%22%20title%3D%22ContourPlotRev0.png%22%20alt%3D%22ContourPlotRev0.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22ContourPlotRev1.png%22%20style%3D%22width%3A%20528px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22ContourPlotRev1.png%22%20style%3D%22width%3A%20528px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22ContourPlotRev1.png%22%20style%3D%22width%3A%20528px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F21888iDED5AF26E1267892%2Fimage-dimensions%2F528x376%3Fv%3Dv2%22%20width%3D%22528%22%20height%3D%22376%22%20role%3D%22button%22%20title%3D%22ContourPlotRev1.png%22%20alt%3D%22ContourPlotRev1.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CDIV%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%3CP%3EWie%20zuvor%2C%20wenn%20ich%20fest%20codiere%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3EReverse%20Colors(%200%20)%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3EDann%20bekomme%20ich%20das%20(was%20richtig%20ist)%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22ContourPlotRev0fixed.png%22%20style%3D%22width%3A%20468px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22ContourPlotRev0fixed.png%22%20style%3D%22width%3A%20468px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22ContourPlotRev0fixed.png%22%20style%3D%22width%3A%20468px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F21889i7013FE05BF8688C2%2Fimage-dimensions%2F468x334%3Fv%3Dv2%22%20width%3D%22468%22%20height%3D%22334%22%20role%3D%22button%22%20title%3D%22ContourPlotRev0fixed.png%22%20alt%3D%22ContourPlotRev0fixed.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHoffe%20das%20hilft.%20Danke!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-249006%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3EBetreff%3A%20Farben%20in%20der%20Contour%20Plot-Plattform%20umkehren%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-249006%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EIch%20habe%20das%20folgende%20Skript%20in%20JMP%2012%20und%20JMP%2015%20ausgef%C3%BChrt%20und%20beide%20haben%20ohne%20Fehler%20funktioniert.Wenn%20Sie%20weitere%20Details%20angeben%20k%C3%B6nnen%2C%20kann%20ich%20das%20Problem%20m%C3%B6glicherweise%20l%C3%B6sen.%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3Erev%3D1%3B%0AContour%20Plot(%0A%20X(%20%3Aheight%2C%20%3Aweight%20)%2C%0A%20Y(%20%3Aage%20)%2C%0A%20Show%20Data%20Points(%200%20)%2C%0A%20Fill%20Areas(%200%20)%2C%0A%20Label%20Contours(%200%20)%2C%0A%20Reverse%20Colors(%20rev%20)%2C%0A%20Transform(%20%22Range%20Normalized%22%20)%2C%0A%20Specify%20Contours(%20Min(%2012.5%20)%2C%20Max(%2016.5%20)%2C%20N(%209%20)%20)%0A)%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3EF%C3%BCr%20meine%20Tests%20habe%20ich%20die%20Beispieldatentabelle%20%E2%80%9EBig%20Class%E2%80%9C%20verwendet.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Choose Language Hide Translation Bar
matth1
Level IV

Reverse colors in Contour Plot Platform

I have a script which iterates over several columns and generates contour plots.

 

If the column values are negative I want to reverse the contour colours, so I set a variable like this:

 

 

if(col mean( col1 ) < 0, revcols = 1, revcols = 0);
Contour Plot(
	...
	Reverse Colors( revcols ),
	...

However, the problem I have is that the contour plot is now always reversed - it seems to ignore the value of revcols.

 

If I hardcode 

 

Reverse Colors( 0 )

then it doesn't reverse the colours, but if revcols = 0 then it's reversed.

 

Do I need to do something clever to make it treat a variable with value 0 as zero in this case?

 

Thanks!

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: Reverse colors in Contour Plot Platform

Here is a work around that works on my system

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("")))
	
);
Jim

View solution in original post

5 REPLIES 5
txnelson
Super User

Re: Reverse colors in Contour Plot Platform

I ran the script below in JMP 12 and JMP 15 and both of them worked without error.  If you can supply more details, I might be able to get down to the issue.

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 ) )
)

I used the Big Class sample data table for my testing.

Jim
matth1
Level IV

Re: Reverse colors in Contour Plot Platform

Thanks for your reply! I am using JMP 14.2.0 on MacOS 10.14.6.

 

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:

 

SendToReport( 
	Dispatch( {}, "Contour Plot for age", OutlineBox, {Set Title( "Contour Plot for age, with rev = " || Char( rev ) )} ) 
)

And the charts look like this (I also filled the contours to make it more obvious):

ContourPlotRev0.pngContourPlotRev1.png

 

 
 

As before, if I hardcode in 

Reverse Colors( 0 )

Then I get this (which is correct):

ContourPlotRev0fixed.png

 

Hope this helps. Thanks!

txnelson
Super User

Re: Reverse colors in Contour Plot Platform

Try converting your code to a Substitute structure, which will present to JMP the value of rev as if it is hard coded.

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
	)
);
Jim
matth1
Level IV

Re: Reverse colors in Contour Plot Platform

Thanks for the suggestion, but still no luck. I tried this:

 

 

// 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
	)
);

However, the chart still came out with reversed colours. If I save the script from the chart, I get this:

 

 

// 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" )}
		)
	)
);

As you can see, the value of __reverse__ has been correctly substituted into the title text, but for some reason I still get

 

Reverse Colors( 1 )

Is this a bug and is there a workaround?

 

Thanks for your help!

 

 

txnelson
Super User

Re: Reverse colors in Contour Plot Platform

Here is a work around that works on my system

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("")))
	
);
Jim

Recommended Articles