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-261070%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%E5%9C%A8%E5%9B%BE%E5%BD%A2%E7%94%9F%E6%88%90%E5%99%A8%E4%B8%8A%E8%AE%BE%E7%BD%AE%E5%9B%BE%E4%BE%8B%E9%A2%9C%E8%89%B2%E6%89%98%E7%9B%98%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-261070%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3E%E6%88%91%E6%9C%89%E4%B8%80%E4%B8%AA%E8%84%9A%E6%9C%AC%EF%BC%8C%E5%8F%AF%E4%BD%BF%E7%94%A8%E5%9B%BE%E4%BE%8B%E4%B8%AD%E5%8F%AF%E5%8F%98%E6%95%B0%E9%87%8F%E7%9A%84%E9%A1%B9%E7%9B%AE%E5%92%8C%E5%8F%AF%E5%8F%98%E5%B8%A7%E6%95%B0%E7%9A%84%E6%95%B0%E6%8D%AE%E9%9B%86%E6%9D%A5%E5%88%9B%E5%BB%BA%E5%9B%BE%E5%BD%A2%E6%9E%84%E5%BB%BA%E5%99%A8%E8%BE%93%E5%87%BA%E3%80%82%26nbsp%3B%20%E6%88%91%E8%83%BD%E5%A4%9F%E8%8E%B7%E5%8F%96%E5%B8%A7%E6%A0%91%E7%BB%93%E6%9E%84%EF%BC%8C%E7%84%B6%E5%90%8E%E5%AF%B9%E5%85%B6%E8%BF%9B%E8%A1%8C%E6%A0%BC%E5%BC%8F%E5%8C%96%EF%BC%8C%E4%BD%86%E6%97%A0%E6%B3%95%E6%A0%BC%E5%BC%8F%E5%8C%96%E5%9B%BE%E4%BE%8B%E3%80%82%26nbsp%3B%20%E6%88%91%E6%83%B3%E6%88%91%E5%B7%B2%E7%BB%8F%E6%8E%A5%E8%BF%91%E4%BA%86%EF%BC%8C%E4%BD%86%E6%98%AF%E6%9C%80%E5%90%8E%E4%B8%80%E8%A1%8C%E6%B2%A1%E6%9C%89%E4%BB%BB%E4%BD%95%E5%8A%9F%E8%83%BD%E3%80%82%3C%2FP%3E%3CP%3E%E8%BF%99%E6%98%AF%E4%B8%80%E4%B8%AA%E7%A4%BA%E4%BE%8B%E8%84%9A%E6%9C%AC%E3%80%82%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3ENames%20Default%20To%20Here(%201%20)%3B%0Adt%20%3D%20Open(%22%24SAMPLE_DATA%2FSolubility.jmp%22)%3B%0Adtstack%20%3D%20dt%20%26lt%3B%26lt%3B%20Stack(%0A%20columns(%3AName(%20%221-Octanol%22%20)%2C%3AEther%2C%3AChloroform%2C%3ABenzene%2C%3ACarbon%20Tetrachloride%2C%20%3AHexane%20)%2C%0A%20Source%20Label%20Column(%20%22Gas%22%20)%2C%0A%20Stacked%20Data%20Column(%20%22Solubility%22%20)%0A)%3B%0A%0Agbname%20%3D%20dtstack%20%26lt%3B%26lt%3B%20Graph%20Builder(%20Size(%20668%2C%20643%20)%2C%20Show%20Control%20Panel(%200%20)%2C%0A%20Variables(%20Y(%20%3ASolubility%20)%2C%20Wrap(%20%3AGas%20)%2C%20Overlay(%20%3ALabels%20)%20)%2C%0A%20Elements(%20Points(%20Y%2C%20Legend(%2012%20)%20)%20)%0A)%3B%0A%0Aframes%20%3D%20gbname%20%26lt%3B%26lt%3B%20xpath(%22%2F%2FFrameBox%22)%3B%20%20%2F%2Fgets%20frames%2C%20works%0Aframes%20%26lt%3B%26lt%3B%20set%20background%20color(%20-16512221%20)%3B%20%20%2F%2Fformats%20frames%2C%20works%0ALegendPallet%20%3D%20gbname%20%26lt%3B%26lt%3B%20xpath(%22%2F%2FLegendBox%22)%3B%20%2F%2Fgets%20legend%2C%20i%20think%20this%20works%0ALegendPallet%20%26lt%3B%26lt%3B%20Color%20Theme(%20%22Pastel%22%20)%3B%20%2F%2Fformats%20color%20theme%20--doesn't%20work.%26nbsp%3B%26nbsp%3BI%26nbsp%3Bsuspect%26nbsp%3Ban%26nbsp%3Bissue%26nbsp%3Bwith%26nbsp%3Bmy%26nbsp%3Bobj.%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-261081%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9A%E5%9C%A8%E5%9B%BE%E5%BD%A2%E7%94%9F%E6%88%90%E5%99%A8%E4%B8%8A%E8%AE%BE%E7%BD%AE%E5%9B%BE%E4%BE%8B%E9%A2%9C%E8%89%B2%E6%89%98%E7%9B%98%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-261081%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3E%E5%B0%9D%E8%AF%95%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3E%26lt%3B%26lt%3B%20Categorical%20Color%20Theme(%20%22Pastel%22%20)%3B%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%E6%9C%89%E5%85%B3%E7%A4%BA%E4%BE%8B%EF%BC%8C%E8%AF%B7%E5%8F%82%E8%A7%81%E8%84%9A%E6%9C%AC%E7%BC%96%E5%88%B6%E7%B4%A2%E5%BC%95%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%20Help%20%3D%3D%26gt%3B%E6%9F%94%E5%92%8C%E7%9A%84%E8%84%9A%E6%9C%AC%E7%B4%A2%E5%BC%95%E6%90%9C%E7%B4%A2%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-261086%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9A%E5%9C%A8%E5%9B%BE%E5%BD%A2%E7%94%9F%E6%88%90%E5%99%A8%E4%B8%8A%E8%AE%BE%E7%BD%AE%E5%9B%BE%E4%BE%8B%E9%A2%9C%E8%89%B2%E6%89%98%E7%9B%98%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-261086%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%E8%B0%A2%E8%B0%A2%EF%BC%81%E4%BC%BC%E4%B9%8E%E6%88%91%E7%9A%84%E4%B8%BB%E8%A6%81%E9%97%AE%E9%A2%98%E6%98%AF%E6%88%91%E8%AF%95%E5%9B%BE%E9%80%9A%E8%BF%87%E5%9B%BE%E4%BE%8B%E6%A1%86%E5%90%8D%E7%A7%B0%E8%80%8C%E4%B8%8D%E6%98%AF%E5%9B%BE%E5%BD%A2%E5%AF%B9%E8%B1%A1%E6%9D%A5%E4%BD%BF%E7%94%A8%E5%AE%83%E3%80%82%3C%2FLINGO-BODY%3E
Choose Language Hide Translation Bar
SamKing
Level III

Setting legend color pallet on graph builder

I have a script that creates a graph builder output with a dataset that has a variable number of items in the legend and variable number of frames.  I'm able to get the frame tree structure then format them but unable to format the legend.  I think I'm close but something is not functional in the very last line.

Here's an example script.

Names Default To Here( 1 );
dt = Open("$SAMPLE_DATA/Solubility.jmp");
dtstack = dt << Stack(
	columns(:Name( "1-Octanol" ),:Ether,:Chloroform,:Benzene,:Carbon Tetrachloride,	:Hexane	),
	Source Label Column( "Gas" ),
	Stacked Data Column( "Solubility" )
);

gbname = dtstack << Graph Builder(	Size( 668, 643 ),	Show Control Panel( 0 ),
	Variables( Y( :Solubility ), Wrap( :Gas ), Overlay( :Labels ) ),
	Elements( Points( Y, Legend( 12 ) ) )
);

frames = gbname << xpath("//FrameBox");  //gets frames, works
frames << set background color( -16512221 );  //formats frames, works
LegendPallet = gbname << xpath("//LegendBox"); //gets legend, i think this works
LegendPallet << Color Theme( "Pastel" ); //formats color theme --doesn't work.  I suspect an issue with my obj.
1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: Setting legend color pallet on graph builder

Try

<< Categorical Color Theme( "Pastel" );

See the Scripting Index for an example

     Help==>Scripting Index         search on pastel

Jim

View solution in original post

2 REPLIES 2
txnelson
Super User

Re: Setting legend color pallet on graph builder

Try

<< Categorical Color Theme( "Pastel" );

See the Scripting Index for an example

     Help==>Scripting Index         search on pastel

Jim
SamKing
Level III

Re: Setting legend color pallet on graph builder

Thanks! Looks like my primary issue was that i was trying to work it through the legendbox name instead of the graph object.

Recommended Articles