<?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: Force Legend with marker and color of row state in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Force-Legend-with-marker-and-color-of-row-state/m-p/37137#M21806</link>
    <description>&lt;P&gt;Thanks for the quick answer,&lt;/P&gt;&lt;P&gt;1/ It&amp;nbsp;can work provided I have a full set of marker names (I found in the documentation the standards JMP colors). Do you know where I can find something equivalent for marker names?&lt;/P&gt;&lt;P&gt;2/ In that case if colors and markers are written in a dedicated table I am able to modify each line of the legend &amp;nbsp;through an (eval(substitute(expr(graphbuilder(color1,marker1),expr(color1),mycolor, expr(marker1),mymarker))). It works, nice step forward, but I need to know&amp;nbsp;the number of item in the legend in order to make the substitution.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To make it more clear for "big class" file, if the overlay is made with :AGE, and if I don't know the AGE(s) in the file, how can I do?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I could maybe do it&amp;nbsp;in a loop (after the graph builder), if I was able to send a message to the legendbox. But I cannot find in the documentation&amp;nbsp;&amp;nbsp;messages that modify the item...And finally the tree node is "empty" in the legendbox node.&lt;/P&gt;</description>
    <pubDate>Tue, 14 Mar 2017 12:31:46 GMT</pubDate>
    <dc:creator>ptijerome</dc:creator>
    <dc:date>2017-03-14T12:31:46Z</dc:date>
    <item>
      <title>Force Legend with marker and color of row state</title>
      <link>https://community.jmp.com/t5/Discussions/Force-Legend-with-marker-and-color-of-row-state/m-p/37081#M21772</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to make&amp;nbsp;a legend with markers and colors, but I'd like to choose them. I thought it will be easy thanks to row state (color state, marker state,combine states). But once color and marker are assigned&amp;nbsp;to each&amp;nbsp;row,&amp;nbsp;I am not able to find a way to force them in the legend.&lt;/P&gt;&lt;P&gt;I would like to do it by script (I was thinking to add a box with the legend), but I am not able to find a way to handle the "markers" I have created.&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;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2017 10:34:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Force-Legend-with-marker-and-color-of-row-state/m-p/37081#M21772</guid>
      <dc:creator>ptijerome</dc:creator>
      <dc:date>2017-03-13T10:34:25Z</dc:date>
    </item>
    <item>
      <title>Re: Force Legend with marker and color of row state</title>
      <link>https://community.jmp.com/t5/Discussions/Force-Legend-with-marker-and-color-of-row-state/m-p/37105#M21785</link>
      <description>&lt;P&gt;The easiest way that I found for JMP to handle this, is to modify the legend, and therefore the graph using JSL, to match your Row States. &amp;nbsp;Here is a script that shows how to modify the legend in Graph Builder.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA\big class.jmp" );
Graph Builder(
	Show Control Panel( 0 ),
	Variables( X( :height ), Y( :weight ), Overlay( :sex ) ),
	Elements( Points( X, Y, Legend( 1 ) ), Smoother( X, Y, Legend( 1 ) ) ),
	SendToReport(
		Dispatch(
			{},
			"400",
			ScaleBox,
			{Legend Model(
				1,
				Properties( 0, {Marker( "FilledTall" )} ),
				Properties( 1, {Line Color( 1 ), Line Style( "Dashed" ), Marker( "Filled Diamond" )} )
			), Legend Model(
				1,
				Properties( 0, {Marker( "FilledTall" )} ),
				Properties( 1, {Line Color( 1 ), Line Style( "Dashed" ), Marker( "Filled Diamond" )} )
			)}
		),
		Dispatch( {}, "400", LegendBox, {Legend Position( {1, [2, 3], 1, [0, 1]} ), Position( {2, 3, 0, 1} )} )
	)
);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;It produces the following&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Graph Builder Legend Manipulation.jpg" style="width: 643px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/5561i3436CFDED630E3FF/image-size/large?v=v2&amp;amp;px=999" role="button" title="Graph Builder Legend Manipulation.jpg" alt="Graph Builder Legend Manipulation.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2017 17:53:13 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Force-Legend-with-marker-and-color-of-row-state/m-p/37105#M21785</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2017-03-13T17:53:13Z</dc:date>
    </item>
    <item>
      <title>Re: Force Legend with marker and color of row state</title>
      <link>https://community.jmp.com/t5/Discussions/Force-Legend-with-marker-and-color-of-row-state/m-p/37137#M21806</link>
      <description>&lt;P&gt;Thanks for the quick answer,&lt;/P&gt;&lt;P&gt;1/ It&amp;nbsp;can work provided I have a full set of marker names (I found in the documentation the standards JMP colors). Do you know where I can find something equivalent for marker names?&lt;/P&gt;&lt;P&gt;2/ In that case if colors and markers are written in a dedicated table I am able to modify each line of the legend &amp;nbsp;through an (eval(substitute(expr(graphbuilder(color1,marker1),expr(color1),mycolor, expr(marker1),mymarker))). It works, nice step forward, but I need to know&amp;nbsp;the number of item in the legend in order to make the substitution.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To make it more clear for "big class" file, if the overlay is made with :AGE, and if I don't know the AGE(s) in the file, how can I do?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I could maybe do it&amp;nbsp;in a loop (after the graph builder), if I was able to send a message to the legendbox. But I cannot find in the documentation&amp;nbsp;&amp;nbsp;messages that modify the item...And finally the tree node is "empty" in the legendbox node.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Mar 2017 12:31:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Force-Legend-with-marker-and-color-of-row-state/m-p/37137#M21806</guid>
      <dc:creator>ptijerome</dc:creator>
      <dc:date>2017-03-14T12:31:46Z</dc:date>
    </item>
    <item>
      <title>Re: Force Legend with marker and color of row state</title>
      <link>https://community.jmp.com/t5/Discussions/Force-Legend-with-marker-and-color-of-row-state/m-p/37141#M21808</link>
      <description>&lt;P&gt;1. The markers are numbered as can be seen in the chart below. &amp;nbsp;This was generated by a script, as demonstrated int the scripting guide&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Help==&amp;gt;Books==&amp;gt;Scripting Guide&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Markers.jpg" style="width: 365px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/5571i21A69557495D8C34/image-size/large?v=v2&amp;amp;px=999" role="button" title="Markers.jpg" alt="Markers.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Some of the markers have names assigned to them, which you have seen in the Graph Builder script. &amp;nbsp;I don't know of any listing of those name, but you can always interactively run a Graph Builder and assign the marker you want, and then view the script it produced and see if it gives you a name and not just a number.&lt;/P&gt;
&lt;P&gt;2. &amp;nbsp;The legend is going to be listed out in alphabetical or numeric order, unless Value ordering or Row Order Level is turned on. &amp;nbsp;Programatically, you can determine that, and then adjust your code. &amp;nbsp;As far as finding out the ages in the data table, the Summarize() function is what I use most of the time&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;summarize(dt,bygroup = By(:Age));&lt;/P&gt;
&lt;P&gt;The variable "bygroup" will have a list of all of the different ages found.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;N Items(bygroup);&lt;/P&gt;
&lt;P&gt;Gives you the number of different ages found&lt;/P&gt;</description>
      <pubDate>Tue, 14 Mar 2017 13:05:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Force-Legend-with-marker-and-color-of-row-state/m-p/37141#M21808</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2017-03-14T13:05:05Z</dc:date>
    </item>
    <item>
      <title>Re: Force Legend with marker and color of row state</title>
      <link>https://community.jmp.com/t5/Discussions/Force-Legend-with-marker-and-color-of-row-state/m-p/37144#M21810</link>
      <description>&lt;P&gt;Thanks Jim&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. I agree it is not a real issue... I can get&amp;nbsp;the list with some work!&lt;/P&gt;&lt;P&gt;2. Maybe I wasn't clear enough. I can easily, as you mention, get the number (N) of item in need to modify in the legend. It means I will need to &amp;nbsp;create N lines in the script&amp;nbsp;making the graphbuilder (I need to&amp;nbsp;dispatch N lines with "legend box(properties(0...N)"). But if I build a graph with N+1 lines in the legend box it will work partly (the N+1th line will not be modified). Thus I need to make a loop either within the script making the graphbuilder (is it feasible?) or after the script making the graphbuilder (it makes more sense, but I am not able to find&amp;nbsp;message(s) I can send to legendbox).&lt;/P&gt;</description>
      <pubDate>Tue, 14 Mar 2017 14:06:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Force-Legend-with-marker-and-color-of-row-state/m-p/37144#M21810</guid>
      <dc:creator>ptijerome</dc:creator>
      <dc:date>2017-03-14T14:06:20Z</dc:date>
    </item>
    <item>
      <title>Re: Force Legend with marker and color of row state</title>
      <link>https://community.jmp.com/t5/Discussions/Force-Legend-with-marker-and-color-of-row-state/m-p/37147#M21811</link>
      <description>&lt;P&gt;If you look at&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Help==&amp;gt;Scripting Index&lt;/P&gt;
&lt;P&gt;and look at both the Graph Builder and the Legend Box() elements, manipulating the legend after the Graph Builder has run, is limited. &amp;nbsp;However, you can use a technique that works for anything, but is a bit cumbersom. &amp;nbsp;If you generate a literal string, that contains the code you need to get the Graph Builder to do what you want, you can then run that literal string. &amp;nbsp;Here is a very primitive example, but I think you will see what kinds of things you can do with it&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA\big class.jmp" );
Summarize( dt, groups = by( dt:sex ) );
numofgroups = N Items( groups );

TheCode =
"Graph Builder(
	Show Control Panel( 0 ),
	Variables( X( :height ), Y( :weight ), Overlay( :sex ) ),
	Elements( Points( X, Y, Legend( 1 ) ), Smoother( X, Y, Legend( 1 ) ) ),
	SendToReport(
		Dispatch(
			{},
			\!"400\!",
			ScaleBox,
			{Legend Model(
				1,";
For( i = 0, i &amp;lt;= numofgroups - 1, i++,
	Show( i );
	TheCode = TheCode || "Properties(" || Char( i ) || ", {Line Color (" || Char( i + 3 ) || "),Marker( " || Char( 16 - i ) || ")}),";
);
TheCode = TheCode || "Dispatch( {}, \!"400\!", LegendBox, {Legend Position( {1, [2, 3], 1, [0, 1]} ), Position( {2, 3, 0, 1} )} ))';";
Eval( Parse( TheCode ) );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 14 Mar 2017 14:51:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Force-Legend-with-marker-and-color-of-row-state/m-p/37147#M21811</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2017-03-14T14:51:10Z</dc:date>
    </item>
    <item>
      <title>Re: Force Legend with marker and color of row state</title>
      <link>https://community.jmp.com/t5/Discussions/Force-Legend-with-marker-and-color-of-row-state/m-p/37188#M21826</link>
      <description>&lt;P&gt;It seems to be a good solution. I need now to adapt it to my case. Thanks a lot!&lt;/P&gt;&lt;P&gt;Just disappointed by row state!&lt;/P&gt;</description>
      <pubDate>Wed, 15 Mar 2017 15:10:06 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Force-Legend-with-marker-and-color-of-row-state/m-p/37188#M21826</guid>
      <dc:creator>ptijerome</dc:creator>
      <dc:date>2017-03-15T15:10:06Z</dc:date>
    </item>
    <item>
      <title>Re: Force Legend with marker and color of row state</title>
      <link>https://community.jmp.com/t5/Discussions/Force-Legend-with-marker-and-color-of-row-state/m-p/37223#M21830</link>
      <description>&lt;P&gt;As an alternative, you might consider using 'MarkerSeg'. In the code below 'dt' is a table of all the distinct levels of the column you wish to colour and mark by. You could use 'Tables &amp;gt; Summary' and make this invisible.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;NamesDefaultToHere(1);

// Example data table (markers and colors assigned by 'Lot ID')
dt = New Table( "Rows With Colors and Markers",
					Add Rows( 12 ),
					New Column( "Lot ID",
						Character,
						"Nominal",
						Set Values(
							{"lot1", "lot10", "lot11", "lot12", "lot13", "lot2", "lot3", "lot4",
							"lot5", "lot6", "lot7", "lot8"}
						),
						Lock( 1 )
					),
					Set Row States(
						[896.813481688499, 1104.17848521471, 34064.2516910434, 1584.79095828533,
						1856.1745531559, 34848.5869575739, 35120.7292968035, 2704.17450988293,
						2976.75480300188, 3200.51829791069, 3408.21706777811, 36368.77437675]
					)
				);

// Make legend window with MarkerSeg
n = NRow(dt);
xx = J(n, 1, 1);
yy = Transpose(1::n);
legendList = Column(dt, "Lot ID") &amp;lt;&amp;lt; getValues;
			gb = Graph Box(
					FrameSize( 150, 300*(n/16) ),
					Y Scale( 0, n+1 ),
					X Scale( 0, 6 ),
					Y Name(" "),
					X Name(" "),
					Y Axis(ShowLabels(0), ShowMajorTicks(0), ShowMinorTicks(0)),
					X Axis(ShowLabels(0), ShowMajorTicks(0), ShowMinorTicks(0)),
					Marker Seg( xx, yy, Row States( dt ) ),
					For( i = 1, i&amp;lt;=n, i++, Text( {1.5, i-0.1}, legendList[i] ) )
				);
db = PanelBox("Row State Colours and Markers for 'Lot ID'", gb);
New Window( "My Legend", db);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Mar 2017 16:19:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Force-Legend-with-marker-and-color-of-row-state/m-p/37223#M21830</guid>
      <dc:creator>ian_jmp</dc:creator>
      <dc:date>2017-03-15T16:19:33Z</dc:date>
    </item>
    <item>
      <title>Re: Force Legend with marker and color of row state</title>
      <link>https://community.jmp.com/t5/Discussions/Force-Legend-with-marker-and-color-of-row-state/m-p/37259#M21843</link>
      <description>&lt;P&gt;I haven't figured out how to do it with a script but if you go to Rows&amp;gt;Color or Mark By Column&lt;BR /&gt;you get the following&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="3-14-2017 4-26-44 PM.png" style="width: 518px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/5636i5837F713EE8C264D/image-size/large?v=v2&amp;amp;px=999" role="button" title="3-14-2017 4-26-44 PM.png" alt="3-14-2017 4-26-44 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now you can right click on the legend and change it to whatever you want, and if you have "Make Window with Legend" selected it will create a legend for you. &amp;nbsp;This has the added benefit of selecting in the table anything you've selected in the legend. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can do the same inside scripting with:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to here(1);
dt = Open("$SAMPLE_DATA\Big CLass.jmp");
legend = dt &amp;lt;&amp;lt; Marker By Column(:age);
new window("Not Really", 
	Hlistbox(
		bivariate(Y(:height), X(:weight)), 
		legend
	)
)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But you lose (at least I haven't found a way to do it) the customizabilty that you're after&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Mar 2017 19:40:16 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Force-Legend-with-marker-and-color-of-row-state/m-p/37259#M21843</guid>
      <dc:creator>vince_faller</dc:creator>
      <dc:date>2017-03-15T19:40:16Z</dc:date>
    </item>
    <item>
      <title>Re: Force Legend with marker and color of row state</title>
      <link>https://community.jmp.com/t5/Discussions/Force-Legend-with-marker-and-color-of-row-state/m-p/37266#M21850</link>
      <description>&lt;P&gt;Thanks Ian,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it is closer to my initial idea and it is easy to integrate in my script.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I&amp;nbsp;slightly prefer this solution, even though the other one works well.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Mar 2017 07:20:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Force-Legend-with-marker-and-color-of-row-state/m-p/37266#M21850</guid>
      <dc:creator>ptijerome</dc:creator>
      <dc:date>2017-03-16T07:20:07Z</dc:date>
    </item>
  </channel>
</rss>

