<?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: How to get Legend Box information, like color and marker type in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-get-Legend-Box-information-like-color-and-marker-type/m-p/253180#M49704</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14063"&gt;@MJE&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Thanks for the additional feedback. It works! Thanks for the solution, I'll mark it as such. I did modify it just slightly to be more like what the user is asking for, but otherwise, it does the job. From what I can tell, the list of markers and colors are in the same order as the legend.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's the modified version of your code I used:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

dt = Open( "$Sample_Data/Big Class Families.jmp" );

gb = dt &amp;lt;&amp;lt; Graph Builder(
	Size( 528, 456 ),
	Show Control Panel( 0 ),
	Graph Spacing( 5 ),
	Variables( X( :weight ), Y( :height ), Overlay( :age ), Color( :age ) ),
	Elements( Points( X, Y, Legend( 33 ) ) ),
	MarkerSeg(:weight, :height)
);

segs = Report(gb)[Framebox(1)]&amp;lt;&amp;lt;Find Segs;

MarkerList = {};
ColorList = {};
For(i=1, i&amp;lt;=Nitems(segs),i++,
	seg = Report(gb)[Framebox(1)]&amp;lt;&amp;lt;Find Seg(MarkerSeg(i));
	m = seg&amp;lt;&amp;lt;get Marker;
	Insert Into (MarkerList,m);
	c = seg &amp;lt;&amp;lt; get colors;
	Insert Into(ColorList,EvalList({c[1]}));
);

Show(MarkerList, ColorList);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;And the output I get:&lt;/P&gt;&lt;P&gt;MarkerList = {"Circle", "Plus", "Diamond", "X", "Triangle", "Y"};&lt;BR /&gt;ColorList = {{66, 112, 221}, {212, 73, 88}, {61, 174, 70}, {162, 43, 221}, {204, 121, 41}, {40, 182, 143}};&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="DS_0-1584636378890.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/22386i4793155140F7F989/image-size/medium?v=v2&amp;amp;px=400" role="button" title="DS_0-1584636378890.png" alt="DS_0-1584636378890.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thanks!,&lt;/P&gt;&lt;P&gt;DS&lt;/P&gt;</description>
    <pubDate>Thu, 19 Mar 2020 16:47:45 GMT</pubDate>
    <dc:creator>SDF1</dc:creator>
    <dc:date>2020-03-19T16:47:45Z</dc:date>
    <item>
      <title>How to get Legend Box information, like color and marker type</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-Legend-Box-information-like-color-and-marker-type/m-p/252961#M49655</link>
      <description>&lt;P&gt;Dear JMP Community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; (W10 Enterprise 64-bit, JMP Pro 15.0)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; I have a user that is using graph builder to generate a rather complex graph containing multiple bits of information. The market data is split by region, customer, etc. As a result, the scatter plot is color coded as well as having multiple markers. As an example, below is something kind of like what the graph might look like (using Big Class Families.jmp).&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DS_0-1584543309277.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/22365iC64256DCE5582223/image-size/medium?v=v2&amp;amp;px=400" role="button" title="DS_0-1584543309277.png" alt="DS_0-1584543309277.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; What I'd like to do is take his original graph builder plots and extract from the legend the marker style and color and set those as dt properties. The purpose is so the user can run a bit of JSL code as a hot button in their toolbar that will fix the markers and colors for the data. Reason this is needed is that from within Graph Builder, whenever the user uses the Data Filter to change regions, the color coding and markers change for the set of customers because the number of customers changes within each region. They'd like to have this as a fixed property of the data column for example.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; I was trying a bit of JSL code like this in an attempt to get the information from the LegendBox(1) within the tree structure, but I get null as the result of the line: test = legend&amp;lt;&amp;lt;Get Property();&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to here(1);

dt = Open("$Sample_Data/Big Class Families.jmp");

gb=dt&amp;lt;&amp;lt;Graph Builder(
	Size( 528, 456 ),
	Show Control Panel( 0 ),
	Graph Spacing( 5 ),
	Variables( X( :weight ), Y( :height ), Overlay( :age ), Color( :sex ) ),
	Elements( Points( X, Y, Legend( 33 ) ) )
);

gb&amp;lt;&amp;lt;show tree structure; //just used for debugging, won't be in final code.

lgnd= (gb&amp;lt;&amp;lt;Report)[LegendBox(1)];&lt;BR /&gt;&lt;BR /&gt;test = legend&amp;lt;&amp;lt;Get Property();&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp; If the information of color is in RGB or whatever, that's fine, it doesn't need to be a name like "blue" or "red".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Any suggestions on how to proceed are much appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;DS&lt;/P&gt;</description>
      <pubDate>Wed, 18 Mar 2020 15:07:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-Legend-Box-information-like-color-and-marker-type/m-p/252961#M49655</guid>
      <dc:creator>SDF1</dc:creator>
      <dc:date>2020-03-18T15:07:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to get Legend Box information, like color and marker type</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-Legend-Box-information-like-color-and-marker-type/m-p/252979#M49659</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/12549"&gt;@SDF1&lt;/a&gt; ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if I understood your issue correctly, you might want to check into the row states.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;&amp;lt;&amp;lt; copy from row states&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;and&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;&amp;lt;&amp;lt; copy to row states&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;allows you to transfer row state information (such as color, marker, etc.) into a seperate column and back again into the row states (examples and syntax can be found in the scripting index).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;br&lt;/P&gt;&lt;P&gt;Malte&lt;/P&gt;</description>
      <pubDate>Wed, 18 Mar 2020 16:00:35 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-Legend-Box-information-like-color-and-marker-type/m-p/252979#M49659</guid>
      <dc:creator>MJE</dc:creator>
      <dc:date>2020-03-18T16:00:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to get Legend Box information, like color and marker type</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-Legend-Box-information-like-color-and-marker-type/m-p/253003#M49670</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14063"&gt;@MJE&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Thanks for the feedback. Unfortunately, it's not quite what I'm interested in doing. The user hasn't actually changed the row state or marker, they're letting Graph Builder do that automatically. But each time a change is made, the colors and markers change according to JMP's defaults. I want to extract the marker and color "settings" that Graph Builder does automatically and then apply that to the dt so it's fixed and doesn't get updated when a change is made to Graph Builder. I want to do this automatically for ease to the user.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; I think it's something closer to the MarkerSeg and &amp;lt;&amp;lt;GetColors or &amp;lt;&amp;lt;GetMarkers, but I'm not familiar with how to implement those.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; I'm doing some reading on it now and trying to modify the examples in the Scripting Index, using the modified code below.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

dt = Open( "$Sample_Data/Big Class Families.jmp" );

gb = dt &amp;lt;&amp;lt; Graph Builder(
	Size( 528, 456 ),
	Show Control Panel( 0 ),
	Graph Spacing( 5 ),
	Variables( X( :weight ), Y( :height ), Overlay( :age ), Color( :sex ) ),
	Elements( Points( X, Y, Legend( 33 ) ) ),
	MarkerSeg(:weight, :height, Row States(dt))
);

gb &amp;lt;&amp;lt; show tree structure;//only for debugging and building the script

lgnd = (gb &amp;lt;&amp;lt; Report)[FrameBox(1)];

markerseg = (lgnd&amp;lt;&amp;lt;Find Seg(MarkerSeg(1)));

markerseg &amp;lt;&amp;lt;Get Markers;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp; But, when I run it, I get the following output for markerseg:&amp;nbsp;{"Dot", "Dot", "Dot", "Dot", "Dot", "Dot", "Dot", "Dot"}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; From the graphic I included in the original post, each data point is NOT a "Dot".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!,&lt;/P&gt;&lt;P&gt;DS&lt;/P&gt;</description>
      <pubDate>Wed, 18 Mar 2020 17:27:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-Legend-Box-information-like-color-and-marker-type/m-p/253003#M49670</guid>
      <dc:creator>SDF1</dc:creator>
      <dc:date>2020-03-18T17:27:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to get Legend Box information, like color and marker type</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-Legend-Box-information-like-color-and-marker-type/m-p/253126#M49692</link>
      <description>&lt;P&gt;Maybe this part here might help you. At least, it provides you with some information which actual data point in the graph has which colour and marker. Unfortunately, I couldn't figure out a way to directly correlate the data points (resp. the marker seg) to the actual row numbers. Maybe someone else has an idea on how to do that...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The "get marker" message can be replaced by "get markers" to give you a list of used markers within this marker seg. But as they are all the same in this state, I cut it short for better readability.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

dt = Open( "$Sample_Data/Big Class Families.jmp" );

gb = dt &amp;lt;&amp;lt; Graph Builder(
	Size( 528, 456 ),
	Show Control Panel( 0 ),
	Graph Spacing( 5 ),
	Variables( X( :weight ), Y( :height ), Overlay( :age ), Color( :sex ) ),
	Elements( Points( X, Y, Legend( 33 ) ) ),
	MarkerSeg(:weight, :height)
);


//gb &amp;lt;&amp;lt; show tree structure;//only for debugging and building the script


segs =  Report( gb )[Framebox( 1 )] &amp;lt;&amp;lt; Find Segs;

For ( i = 1, i &amp;lt;= n items (segs), i++,

seg = Report( gb )[Framebox( 1 )] &amp;lt;&amp;lt; Find Seg( MarkerSeg(i) );

nx = seg &amp;lt;&amp;lt; get x values;
ny = seg &amp;lt;&amp;lt; get y values;
m = seg &amp;lt;&amp;lt; get marker;
c = seg &amp;lt;&amp;lt; get colors;


show (nx, ny, m, c);
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;br&lt;/P&gt;&lt;P&gt;Malte&lt;/P&gt;</description>
      <pubDate>Thu, 19 Mar 2020 10:01:38 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-Legend-Box-information-like-color-and-marker-type/m-p/253126#M49692</guid>
      <dc:creator>MJE</dc:creator>
      <dc:date>2020-03-19T10:01:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to get Legend Box information, like color and marker type</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-Legend-Box-information-like-color-and-marker-type/m-p/253180#M49704</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14063"&gt;@MJE&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Thanks for the additional feedback. It works! Thanks for the solution, I'll mark it as such. I did modify it just slightly to be more like what the user is asking for, but otherwise, it does the job. From what I can tell, the list of markers and colors are in the same order as the legend.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's the modified version of your code I used:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

dt = Open( "$Sample_Data/Big Class Families.jmp" );

gb = dt &amp;lt;&amp;lt; Graph Builder(
	Size( 528, 456 ),
	Show Control Panel( 0 ),
	Graph Spacing( 5 ),
	Variables( X( :weight ), Y( :height ), Overlay( :age ), Color( :age ) ),
	Elements( Points( X, Y, Legend( 33 ) ) ),
	MarkerSeg(:weight, :height)
);

segs = Report(gb)[Framebox(1)]&amp;lt;&amp;lt;Find Segs;

MarkerList = {};
ColorList = {};
For(i=1, i&amp;lt;=Nitems(segs),i++,
	seg = Report(gb)[Framebox(1)]&amp;lt;&amp;lt;Find Seg(MarkerSeg(i));
	m = seg&amp;lt;&amp;lt;get Marker;
	Insert Into (MarkerList,m);
	c = seg &amp;lt;&amp;lt; get colors;
	Insert Into(ColorList,EvalList({c[1]}));
);

Show(MarkerList, ColorList);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;And the output I get:&lt;/P&gt;&lt;P&gt;MarkerList = {"Circle", "Plus", "Diamond", "X", "Triangle", "Y"};&lt;BR /&gt;ColorList = {{66, 112, 221}, {212, 73, 88}, {61, 174, 70}, {162, 43, 221}, {204, 121, 41}, {40, 182, 143}};&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="DS_0-1584636378890.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/22386i4793155140F7F989/image-size/medium?v=v2&amp;amp;px=400" role="button" title="DS_0-1584636378890.png" alt="DS_0-1584636378890.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thanks!,&lt;/P&gt;&lt;P&gt;DS&lt;/P&gt;</description>
      <pubDate>Thu, 19 Mar 2020 16:47:45 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-Legend-Box-information-like-color-and-marker-type/m-p/253180#M49704</guid>
      <dc:creator>SDF1</dc:creator>
      <dc:date>2020-03-19T16:47:45Z</dc:date>
    </item>
  </channel>
</rss>

