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%9C%96%E5%BD%A2%E7%94%9F%E6%88%90%E5%99%A8%E4%B8%8A%E8%A8%AD%E7%BD%AE%E5%9C%96%E4%BE%8B%E9%A1%8F%E8%89%B2%E6%89%98%E7%9B%A4%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%E5%80%8B%E8%85%B3%E6%9C%AC%EF%BC%8C%E5%AE%83%E4%BD%BF%E7%94%A8%E4%B8%80%E5%80%8B%E6%95%B8%E6%93%9A%E9%9B%86%E5%89%B5%E5%BB%BA%E4%B8%80%E5%80%8B%E5%9C%96%E5%BD%A2%E7%94%9F%E6%88%90%E5%99%A8%E8%BC%B8%E5%87%BA%EF%BC%8C%E8%A9%B2%E6%95%B8%E6%93%9A%E9%9B%86%E5%9C%A8%E5%9C%96%E4%BE%8B%E4%B8%AD%E5%85%B7%E6%9C%89%E5%8F%AF%E8%AE%8A%E6%95%B8%E9%87%8F%E7%9A%84%E9%A0%85%E7%9B%AE%E5%92%8C%E5%8F%AF%E8%AE%8A%E6%95%B8%E9%87%8F%E7%9A%84%E5%B9%80%E3%80%82%E6%88%91%E8%83%BD%E5%A4%A0%E7%8D%B2%E5%BE%97%E6%A1%86%E6%9E%B6%E6%A8%B9%E7%B5%90%E6%A7%8B%E7%84%B6%E5%BE%8C%E6%A0%BC%E5%BC%8F%E5%8C%96%E5%AE%83%E5%80%91%E4%BD%86%E7%84%A1%E6%B3%95%E6%A0%BC%E5%BC%8F%E5%8C%96%E5%9C%96%E4%BE%8B%E3%80%82%E6%88%91%E6%83%B3%E6%88%91%E5%B7%B2%E7%B6%93%E6%8E%A5%E8%BF%91%E4%BA%86%EF%BC%8C%E4%BD%86%E5%9C%A8%E6%9C%80%E5%BE%8C%E4%B8%80%E8%A1%8C%E4%B8%AD%E6%9C%89%E4%BA%9B%E6%9D%B1%E8%A5%BF%E4%B8%8D%E8%B5%B7%E4%BD%9C%E7%94%A8%E3%80%82%3C%2FP%3E%3CP%3E%E9%80%99%E6%98%AF%E4%B8%80%E5%80%8B%E7%A4%BA%E4%BE%8B%E8%85%B3%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-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%9C%96%E5%BD%A2%E7%94%9F%E6%88%90%E5%99%A8%E4%B8%8A%E8%A8%AD%E7%BD%AE%E5%9C%96%E4%BE%8B%E9%A1%8F%E8%89%B2%E6%89%98%E7%9B%A4%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-261086%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%E8%AC%9D%E8%AC%9D%EF%BC%81%20%E7%9C%8B%E8%B5%B7%E4%BE%86%E6%88%91%E7%9A%84%E4%B8%BB%E8%A6%81%E5%95%8F%E9%A1%8C%E6%98%AF%E6%88%91%E8%A9%A6%E5%9C%96%E9%80%9A%E9%81%8E%E5%9C%96%E4%BE%8B%E6%A1%86%E5%90%8D%E7%A8%B1%E8%80%8C%E4%B8%8D%E6%98%AF%E5%9C%96%E5%BD%A2%E5%B0%8D%E8%B1%A1%E4%BE%86%E8%99%95%E7%90%86%E5%AE%83%E3%80%82%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%9C%96%E5%BD%A2%E7%94%9F%E6%88%90%E5%99%A8%E4%B8%8A%E8%A8%AD%E7%BD%AE%E5%9C%96%E4%BE%8B%E9%A1%8F%E8%89%B2%E6%89%98%E7%9B%A4%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%98%97%E8%A9%A6%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%E9%97%9C%E7%A4%BA%E4%BE%8B%EF%BC%8C%E8%AB%8B%E5%8F%83%E9%96%B1%E8%85%B3%E6%9C%AC%E7%B4%A2%E5%BC%95%3C%2FP%3E%0A%3CP%3E%E5%B9%AB%E5%8A%A9%3D%3D%26gt%3B%E5%9C%A8%E7%B2%89%E5%BD%A9%E4%B8%8A%E6%90%9C%E7%B4%A2%E8%85%B3%E6%9C%AC%E7%B4%A2%E5%BC%95%3C%2FP%3E%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