cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Browse apps to extend the software in the new JMP Marketplace
%3CLINGO-SUB%20id%3D%22lingo-sub-712318%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%E5%A6%82%E4%BD%95%E5%9C%A8%EF%BC%88%E7%86%B1%E5%9C%96%EF%BC%89%E6%AF%94%E4%BE%8B%E5%80%BC%E4%B8%AD%E4%BD%BF%E7%94%A8%E8%AE%8A%E6%95%B8%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-712318%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3E%E5%A4%A7%E5%AE%B6%E5%A5%BD%EF%BC%8C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%E5%9C%A8%E4%BB%A5%E4%B8%8B%E7%AF%84%E4%BE%8B%E4%B8%AD%EF%BC%8C%E4%BD%BF%E7%94%A8%20Big%20Class.jmp%20%E4%BD%9C%E7%82%BA%E7%AF%84%E4%BE%8B%E5%BB%BA%E7%AB%8B%E4%BA%86%E7%86%B1%E5%9C%96%EF%BC%9A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3Egb%3DGraph%20Builder(%0A%20Size(%20686%2C%20525%20)%2C%0A%20Show%20Control%20Panel(%200%20)%2C%0A%20Variables(%20X(%20%3Aweight%20)%2C%20Y(%20%3Aheight%20)%2C%20Color(%20%3Aage%20)%20)%2C%0A%20Elements(%20Heatmap(%20X%2C%20Y%2C%20Legend(%207%20)%20)%20)%2C%0A%20SendToReport(%0A%20%20Dispatch(%0A%20%20%20%7B%7D%2C%0A%20%20%20%22400%22%2C%0A%20%20%20ScaleBox%2C%0A%20%20%20%7BLegend%20Model(%0A%20%20%20%207%2C%0A%20%20%20%20Properties(%0A%20%20%20%20%200%2C%0A%20%20%20%20%20%7Bgradient(%20%7BScale%20Values(%20%5B11%2018%5D%20)%7D%20)%7D%2C%0A%20%20%20%20%20Item%20ID(%20%22age%22%2C%201%20)%0A%20%20%20%20)%0A%20%20%20)%7D%0A%20%20)%0A%20)%0A)%3B%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%E6%9C%89%E6%B2%92%E6%9C%89%E8%BE%A6%E6%B3%95%E4%BD%BF%E7%94%A8%E8%AE%8A%E6%95%B8%E4%BE%86%E5%AE%9A%E7%BE%A9%E6%A2%AF%E5%BA%A6%E6%AF%94%E4%BE%8B%E9%99%90%E5%88%B6%EF%BC%9F%20%E9%80%99%E6%98%AF%E6%88%91%E6%83%B3%E8%A6%81%E5%AF%A6%E7%8F%BE%E7%9A%84%E7%9B%AE%E6%A8%99%EF%BC%9A%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%3Egradient_low%3D10%3B%0Agradient_high%3D19%3B%0A%0Agb%3DGraph%20Builder(%0A%20Size(%20686%2C%20525%20)%2C%0A%20Show%20Control%20Panel(%200%20)%2C%0A%20Variables(%20X(%20%3Aweight%20)%2C%20Y(%20%3Aheight%20)%2C%20Color(%20%3Aage%20)%20)%2C%0A%20Elements(%20Heatmap(%20X%2C%20Y%2C%20Legend(%207%20)%20)%20)%2C%0A%20SendToReport(%0A%20%20Dispatch(%0A%20%20%20%7B%7D%2C%0A%20%20%20%22400%22%2C%0A%20%20%20ScaleBox%2C%0A%20%20%20%7BLegend%20Model(%0A%20%20%20%207%2C%0A%20%20%20%20Properties(%0A%20%20%20%20%200%2C%0A%20%20%20%20%20%7Bgradient(%20%7BScale%20Values(%20matrix(%7B%3CFONT%20face%3D%22arial%20black%2Cavant%20garde%22%20color%3D%22%23FF0000%22%3Egradient_low%3C%2FFONT%3E%2C%20%3CFONT%20face%3D%22arial%20black%2Cavant%20garde%22%20color%3D%22%23FF0000%22%3Egradient_high%3C%2FFONT%3E%7D)%20)%7D%20)%7D%2C%0A%20%20%20%20%20Item%20ID(%20%22age%22%2C%201%20)%0A%20%20%20%20)%0A%20%20%20)%7D%0A%20%20)%0A%20)%0A)%3B%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%E6%88%91%E6%83%B3%E4%BD%BF%E7%94%A8%E2%80%9Cgrandient_low%E2%80%9D%E5%92%8C%E2%80%9Cgradient_high%E2%80%9D%E4%BE%86%E5%AE%9A%E7%BE%A9%E7%86%B1%E5%9C%96%E6%A2%AF%E5%BA%A6%E9%99%90%E5%88%B6%E3%80%82%3C%2FP%3E%3CP%3E%E6%88%91%E5%98%97%E8%A9%A6%E9%81%8E%E4%BD%BF%E7%94%A8%20eval()%20%E3%80%81%20eval%20expr()%20%E7%AD%89%EF%BC%8C%E4%BD%86%E9%82%84%E6%B2%92%E6%88%90%E5%8A%9F%E3%80%82%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%E8%AC%9D%E8%AC%9D%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-712318%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CLINGO-LABEL%3E%E8%87%AA%E5%8B%95%E5%8C%96%E5%92%8C%E8%85%B3%E6%9C%AC%E7%B7%A8%E5%AF%AB%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-712340%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%E5%9B%9E%E8%A6%86%EF%BC%9A%E5%A6%82%E4%BD%95%E5%9C%A8%EF%BC%88%E7%86%B1%E5%9C%96%EF%BC%89%E6%AF%94%E4%BE%8B%E5%80%BC%E4%B8%AD%E4%BD%BF%E7%94%A8%E8%AE%8A%E9%87%8F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-712340%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3E%E4%BD%A0%E5%8F%AF%E4%BB%A5%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3ENames%20Default%20To%20Here(1)%3B%20%0A%0Adt%20%3D%20Open(%22%24SAMPLE_DATA%2FBig%20Class.jmp%22)%3B%0A%0Agradient_low%20%3D%2010%3B%0Agradient_high%20%3D%2019%3B%0A%0Agb%20%3D%20Eval(EvalExpr(dt%20%26lt%3B%26lt%3B%20Graph%20Builder(%0A%20Size(686%2C%20525)%2C%0A%20Show%20Control%20Panel(0)%2C%0A%20Variables(X(%3Aweight)%2C%20Y(%3Aheight)%2C%20Color(%3Aheight))%2C%0A%20Elements(Heatmap(X%2C%20Y%2C%20Legend(7)))%2C%0A%20SendToReport(%0A%20%20Dispatch(%0A%20%20%20%7B%7D%2C%0A%20%20%20%22400%22%2C%0A%20%20%20ScaleBox%2C%0A%20%20%20%7BLegend%20Model(%0A%20%20%20%207%2C%0A%20%20%20%20Properties(%0A%20%20%20%20%200%2C%0A%20%20%20%20%20%7Bgradient(%7BScale%20Values(Expr(Matrix(%7Bgradient_low%2C%20gradient_high%7D)%60))%7D)%7D%2C%0A%20%20%20%20%20Item%20ID(%22height%22%2C%201)%0A%20%20%20%20)%0A%20%20%20)%7D%0A%20%20)%0A%20)%0A)))%3B%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%E4%BD%86%E6%88%91%E5%BE%88%E5%8F%AF%E8%83%BD%E6%9C%83%E9%80%8F%E9%81%8E%20Legend%20Server%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3ENames%20Default%20To%20Here(1)%3B%20%0A%0Adt%20%3D%20Open(%22%24SAMPLE_DATA%2FBig%20Class.jmp%22)%3B%0A%0Agradient_low%20%3D%2010%3B%0Agradient_high%20%3D%2019%3B%0A%0Agb%20%3D%20dt%20%26lt%3B%26lt%3B%20Graph%20Builder(%0A%20Size(686%2C%20525)%2C%0A%20Show%20Control%20Panel(0)%2C%0A%20Variables(X(%3Aweight)%2C%20Y(%3Aheight)%2C%20Color(%3Aheight))%2C%0A%20Elements(Heatmap(X%2C%20Y%2C%20Legend(7)))%2C%0A)%3B%0A%0Am_gradient%20%3D%20Matrix(%7Bgradient_low%2C%20gradient_high%7D)%60%3B%0A%0Aserver%20%3D%20gb%20%26lt%3B%26lt%3B%20Get%20Legend%20Server%3B%0Aitems%20%3D%20server%20%26lt%3B%26lt%3B%20Get%20Legend%20Items%3B%0Aitems%5B1%5D%5B1%5D%20%26lt%3B%26lt%3B%20Set%20Properties(%7Bgradient(%7BScale%20Values(m_gradient)%7D)%7D)%3B%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-712343%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%E5%9B%9E%E8%A6%86%EF%BC%9A%E5%A6%82%E4%BD%95%E5%9C%A8%EF%BC%88%E7%86%B1%E5%9C%96%EF%BC%89%E6%AF%94%E4%BE%8B%E5%80%BC%E4%B8%AD%E4%BD%BF%E7%94%A8%E8%AE%8A%E9%87%8F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-712343%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F54010%22%20target%3D%22_blank%22%3E%40LatentDataTiger%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%E8%B3%88%E8%8E%AB%E6%89%80%E8%AA%AA%E7%9A%84%E6%98%AF%E6%AD%A3%E7%A2%BA%E7%9A%84%E3%80%82%E4%BD%86%E6%98%AF%EF%BC%8C%E4%BB%96%E5%B0%8D%E6%82%A8%E7%9A%84%E7%A4%BA%E4%BE%8B%E9%80%B2%E8%A1%8C%E4%BA%86%E5%8F%AF%E8%83%BD%E4%B8%8D%E6%9C%83%E8%A2%AB%E6%B3%A8%E6%84%8F%E5%88%B0%E7%9A%84%E6%9B%B4%E6%94%B9%E3%80%82%E6%82%A8%E7%9A%84%E7%AF%84%E4%BE%8B%E4%BD%BF%E7%94%A8%E8%AE%8A%E6%95%B8%20Age%20%E4%BD%9C%E7%82%BA%20Color%20%E5%88%97%EF%BC%8CJarmo%20%E5%B7%B2%E5%B0%87%E5%85%B6%E8%AE%8A%E6%9B%B4%E7%82%BA%20Height%E3%80%82%E4%B8%8D%E5%90%8C%E4%B9%8B%E8%99%95%E5%9C%A8%E6%96%BC%EF%BC%8C%E5%B9%B4%E9%BD%A1%E7%9A%84%E5%BB%BA%E6%A8%A1%E9%A1%9E%E5%9E%8B%E7%82%BA%E5%BA%8F%E6%95%B8%EF%BC%8C%E8%BA%AB%E9%AB%98%E7%9A%84%E5%BB%BA%E6%A8%A1%E9%A1%9E%E5%9E%8B%E7%82%BA%E9%80%A3%E7%BA%8C%E3%80%82%E5%BA%8F%E6%95%B8%E5%88%97%E4%B8%8D%E6%94%AF%E6%8F%B4%E6%BC%B8%E5%B1%A4%E5%80%BC%E3%80%82%E8%8B%A5%E8%A6%81%E9%87%9D%E5%B0%8D%E5%B9%B4%E9%BD%A1%E5%9F%B7%E8%A1%8C%E6%AD%A4%E6%93%8D%E4%BD%9C%EF%BC%8C%E6%82%A8%E9%9C%80%E8%A6%81%E8%AE%8A%E6%9B%B4%E5%88%97%E7%9A%84%E5%BB%BA%E6%A8%A1%E9%A1%9E%E5%9E%8B%E3%80%82%E9%80%99%E6%98%AF%E4%B8%80%E5%80%8B%E7%82%BA%E5%8E%9F%E5%A7%8B%E7%AF%84%E4%BE%8B%E8%A8%AD%E5%AE%9A%E6%8C%87%E5%AE%9A%E9%A1%8F%E8%89%B2%E6%BC%B8%E8%AE%8A%E7%9A%84%E8%85%B3%E6%9C%AC%E3%80%82%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3ENames%20Default%20To%20Here(%201%20)%3B%0Adt%20%3D%20%0A%2F%2F%20Open%20Data%20Table%3A%20Big%20Class.jmp%0A%2F%2F%20%E2%86%92%20Data%20Table(%20%22Big%20Class%22%20)%0AOpen(%20%22%24SAMPLE_DATA%2FBig%20Class.jmp%22%20)%3B%0A%0Adt%3Aage%20%26lt%3B%26lt%3B%20modeling%20type(%20continuous%20)%3B%0A%0Agradient_low%20%3D%2010%3B%0Agradient_high%20%3D%2019%3B%0A%0AEval(%0A%20Eval%20Expr(%0A%20%20gb%20%3D%20Graph%20Builder(%0A%20%20%20Size(%20686%2C%20525%20)%2C%0A%20%20%20Show%20Control%20Panel(%200%20)%2C%0A%20%20%20Variables(%20X(%20%3Aweight%20)%2C%20Y(%20%3Aheight%20)%2C%20Color(%20%3Aage%20)%20)%2C%0A%20%20%20Elements(%20Heatmap(%20X%2C%20Y%2C%20Legend(%207%20)%20)%20)%2C%0A%20%20%20SendToReport(%0A%20%20%20%20Dispatch(%0A%20%20%20%20%20%7B%7D%2C%0A%20%20%20%20%20%22400%22%2C%0A%20%20%20%20%20ScaleBox%2C%0A%20%20%20%20%20%7BLegend%20Model(%0A%20%20%20%20%20%207%2C%0A%20%20%20%20%20%20Properties(%0A%20%20%20%20%20%20%200%2C%0A%20%20%20%20%20%20%20%7Bgradient(%0A%20%20%20%20%20%20%20%20%7BScale%20Values(%20Matrix(%20%7BExpr(%20gradient_low%20)%2C%20Expr(%20gradient_high%20)%7D%20)%20)%7D%0A%20%20%20%20%20%20%20)%7D%2C%0A%20%20%20%20%20%20%20Item%20ID(%20%22age%22%2C%201%20)%0A%20%20%20%20%20%20)%0A%20%20%20%20%20)%7D%0A%20%20%20%20)%0A%20%20%20)%0A%20%20)%0A%20)%0A)%0A%3B%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-712347%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%E5%9B%9E%E8%A6%86%EF%BC%9A%E5%A6%82%E4%BD%95%E5%9C%A8%EF%BC%88%E7%86%B1%E5%9C%96%EF%BC%89%E6%AF%94%E4%BE%8B%E5%80%BC%E4%B8%AD%E4%BD%BF%E7%94%A8%E8%AE%8A%E9%87%8F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-712347%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3E%E5%97%A8%EF%BC%8C%E8%B3%88%E8%8E%AB%E5%92%8C%E5%90%89%E5%A7%86%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%E6%88%91%E5%B0%8D%E5%AD%B8%E7%BF%92%E5%9C%96%E4%BE%8B%E4%BC%BA%E6%9C%8D%E5%99%A8%E6%8A%80%E8%A1%93%E9%9D%9E%E5%B8%B8%E6%84%9F%E8%88%88%E8%B6%A3%EF%BC%8C%E4%BD%86%E6%98%AF%E8%85%B3%E6%9C%AC%E7%9A%84%E6%9C%80%E5%BE%8C%E4%B8%80%E8%A1%8C%E4%B8%8D%E8%B5%B7%E4%BD%9C%E7%94%A8%E3%80%82%20%E9%80%99%E6%98%AF%E6%88%91%E5%BE%97%E5%88%B0%E7%9A%84%E9%8C%AF%E8%AA%A4%EF%BC%9A%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3Eobject%20not%20subscriptable%20in%20access%20or%20evaluation%20of%20'items%5B1%5D%5B1%5D'%20%2C%20items%5B1%5D%5B%2F*%23%23%23*%2F1%5D%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%E4%BD%A0%E8%83%BD%E5%B9%AB%E5%BF%99%E6%AA%A2%E6%9F%A5%E6%9C%80%E5%BE%8C%E4%B8%80%E8%A1%8C%E5%97%8E%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3ENames%20Default%20To%20Here(1)%3B%20%0A%0Adt%20%3D%20Open(%22%24SAMPLE_DATA%2FBig%20Class.jmp%22)%3B%0A%0Agradient_low%20%3D%2010%3B%0Agradient_high%20%3D%2019%3B%0A%0Agb%20%3D%20dt%20%26lt%3B%26lt%3B%20Graph%20Builder(%0A%20Size(686%2C%20525)%2C%0A%20Show%20Control%20Panel(0)%2C%0A%20Variables(X(%3Aweight)%2C%20Y(%3Aheight)%2C%20Color(%3Aheight))%2C%0A%20Elements(Heatmap(X%2C%20Y%2C%20Legend(7)))%2C%0A)%3B%0A%0Am_gradient%20%3D%20Matrix(%7Bgradient_low%2C%20gradient_high%7D)%3B%0A%0Aserver%20%3D%20gb%20%26lt%3B%26lt%3B%20Get%20Legend%20Server%3B%0Aitems%20%3D%20server%20%26lt%3B%26lt%3B%20Get%20Legend%20Items%3B%0Aitems%5B1%5D%5B1%5D%20%26lt%3B%26lt%3B%20Set%20Properties(%7Bgradient(%7BScale%20Values(m_gradient)%7D)%7D)%3B%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%E8%AC%9D%E8%AC%9D%EF%BC%8C%3C%2FP%3E%3CP%3E%E9%9C%B8%E7%8E%8B%E9%BE%8D%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-712350%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%E5%9B%9E%E8%A6%86%EF%BC%9A%E5%A6%82%E4%BD%95%E5%9C%A8%EF%BC%88%E7%86%B1%E5%9C%96%EF%BC%89%E6%AF%94%E4%BE%8B%E5%80%BC%E4%B8%AD%E4%BD%BF%E7%94%A8%E8%AE%8A%E9%87%8F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-712350%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3E%E5%8F%AF%E8%83%BD%E8%88%87%E7%89%88%E6%9C%AC%E6%9C%89%E9%97%9C%E3%80%82%20%E6%82%A8%E4%BD%BF%E7%94%A8%E7%9A%84%E6%98%AF%E5%93%AA%E5%80%8B%20JMP%20%E7%89%88%E6%9C%AC%EF%BC%9F%20%E6%88%91%E6%AD%A3%E5%9C%A8%E4%BD%BF%E7%94%A8%20JMP%2017.2%E3%80%82%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-712352%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%E5%9B%9E%E8%A6%86%EF%BC%9A%E5%A6%82%E4%BD%95%E5%9C%A8%EF%BC%88%E7%86%B1%E5%9C%96%EF%BC%89%E6%AF%94%E4%BE%8B%E5%80%BC%E4%B8%AD%E4%BD%BF%E7%94%A8%E8%AE%8A%E9%87%8F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-712352%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3E%E6%88%91%E7%9B%AE%E5%89%8D%E6%AD%A3%E5%9C%A8%E4%BD%BF%E7%94%A8%20JMP%2015%20%E5%92%8C%2016%E3%80%82%20%E6%88%91%E7%A2%BA%E5%AF%A6%E6%9C%89%20JMP%2017%EF%BC%8C%E4%BD%86%E6%88%91%E7%9A%84%E5%90%8C%E4%BA%8B%E9%96%8B%E7%99%BC%E7%9A%84%E4%B8%80%E4%BA%9B%E5%B7%A5%E5%85%B7%E7%AE%B1%E7%84%A1%E6%B3%95%E5%9C%A8%20JMP17%20%E4%B8%AD%E5%B7%A5%E4%BD%9C%EF%BC%8C%E5%9B%A0%E6%AD%A4%E6%88%91%E6%B1%BA%E5%AE%9A%E4%BF%9D%E7%95%99%2015%20%E5%92%8C%2016%E3%80%82%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Choose Language Hide Translation Bar

How to use variables in scale values (of a heat map)

Hi All, 

 

In the following example, a heat map was created using Big Class.jmp as an example:

 

gb=Graph Builder(
	Size( 686, 525 ),
	Show Control Panel( 0 ),
	Variables( X( :weight ), Y( :height ), Color( :age ) ),
	Elements( Heatmap( X, Y, Legend( 7 ) ) ),
	SendToReport(
		Dispatch(
			{},
			"400",
			ScaleBox,
			{Legend Model(
				7,
				Properties(
					0,
					{gradient( {Scale Values( [11 18] )} )},
					Item ID( "age", 1 )
				)
			)}
		)
	)
);

 Is there a way to use variables to define the gradient scale limits? Here's what I'd like to achieve:

 

 

gradient_low=10;
gradient_high=19;

gb=Graph Builder(
	Size( 686, 525 ),
	Show Control Panel( 0 ),
	Variables( X( :weight ), Y( :height ), Color( :age ) ),
	Elements( Heatmap( X, Y, Legend( 7 ) ) ),
	SendToReport(
		Dispatch(
			{},
			"400",
			ScaleBox,
			{Legend Model(
				7,
				Properties(
					0,
					{gradient( {Scale Values( matrix({gradient_low, gradient_high}) )} )},
					Item ID( "age", 1 )
				)
			)}
		)
	)
);

 

 

I would like to use "grandient_low" and "gradient_high" to define the heatmap gradient limits.

I've tried to use eval() , eval expr(), etc. but haven't got it to work yet. 

 

Thanks

 

5 REPLIES 5
jthi
Super User

Re: How to use variables in scale values (of a heat map)

You can

Names Default To Here(1); 

dt = Open("$SAMPLE_DATA/Big Class.jmp");

gradient_low = 10;
gradient_high = 19;

gb = Eval(EvalExpr(dt << Graph Builder(
	Size(686, 525),
	Show Control Panel(0),
	Variables(X(:weight), Y(:height), Color(:height)),
	Elements(Heatmap(X, Y, Legend(7))),
	SendToReport(
		Dispatch(
			{},
			"400",
			ScaleBox,
			{Legend Model(
				7,
				Properties(
					0,
					{gradient({Scale Values(Expr(Matrix({gradient_low, gradient_high})`))})},
					Item ID("height", 1)
				)
			)}
		)
	)
)));

but I would most likely go through Legend Server

Names Default To Here(1); 

dt = Open("$SAMPLE_DATA/Big Class.jmp");

gradient_low = 10;
gradient_high = 19;

gb = dt << Graph Builder(
	Size(686, 525),
	Show Control Panel(0),
	Variables(X(:weight), Y(:height), Color(:height)),
	Elements(Heatmap(X, Y, Legend(7))),
);

m_gradient = Matrix({gradient_low, gradient_high})`;

server = gb << Get Legend Server;
items = server << Get Legend Items;
items[1][1] << Set Properties({gradient({Scale Values(m_gradient)})});
-Jarmo
txnelson
Super User

Re: How to use variables in scale values (of a heat map)

@LatentDataTiger 

What Jarmo states is correct.  However, he has made a change to your example that may not be noticed.  Your example uses the variable Age as the Color column, where Jarmo has changed it to Height.  The difference is, that Age has a Modeling Type of Ordinal, and Height has a  Modeling Type of Continuous.  An ordinal column will not honor the Gradient values.  To do this for age, you need to change the Modeling Type of the column.  Here is a script that  sets the specified color gradient for your original example.

Names Default To Here( 1 );
dt = 
// Open Data Table: Big Class.jmp
// → Data Table( "Big Class" )
Open( "$SAMPLE_DATA/Big Class.jmp" );

dt:age << modeling type( continuous );

gradient_low = 10;
gradient_high = 19;

Eval(
	Eval Expr(
		gb = Graph Builder(
			Size( 686, 525 ),
			Show Control Panel( 0 ),
			Variables( X( :weight ), Y( :height ), Color( :age ) ),
			Elements( Heatmap( X, Y, Legend( 7 ) ) ),
			SendToReport(
				Dispatch(
					{},
					"400",
					ScaleBox,
					{Legend Model(
						7,
						Properties(
							0,
							{gradient(
								{Scale Values( Matrix( {Expr( gradient_low ), Expr( gradient_high )} ) )}
							)},
							Item ID( "age", 1 )
						)
					)}
				)
			)
		)
	)
)
;
Jim

Re: How to use variables in scale values (of a heat map)

Hi Jarmo and Jim

 

 

I'm very interesting in learning the legend server technique, but the last line of your script didn't work. Here's the error I get:

object not subscriptable in access or evaluation of 'items[1][1]' , items[1][/*###*/1]

Can you please help check the last line in

Names Default To Here(1); 

dt = Open("$SAMPLE_DATA/Big Class.jmp");

gradient_low = 10;
gradient_high = 19;

gb = dt << Graph Builder(
	Size(686, 525),
	Show Control Panel(0),
	Variables(X(:weight), Y(:height), Color(:height)),
	Elements(Heatmap(X, Y, Legend(7))),
);

m_gradient = Matrix({gradient_low, gradient_high});

server = gb << Get Legend Server;
items = server << Get Legend Items;
items[1][1] << Set Properties({gradient({Scale Values(m_gradient)})});

 

Thanks, 

rex

jthi
Super User

Re: How to use variables in scale values (of a heat map)

Could maybe be version related. Which JMP version are you using? I'm using JMP 17.2.

-Jarmo

Re: How to use variables in scale values (of a heat map)

I'm currently using JMP 15 and 16. I do have JMP 17, but some of my tool box that my colleagues developed wouldn't work in JMP17, so I decided to stay with 15 and 16.