<?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 getting lefthand offset between beginning of picture box and framebox from graphbuilder plot in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/getting-lefthand-offset-between-beginning-of-picture-box-and/m-p/731327#M91398</link>
    <description>&lt;P&gt;JMP Pro 17.2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a plot where I want to use both overlay (to separate lines) and color (to color related lines the same way). This works great, but I lose all colors when extracting the framebox. I can keep the colors by grabbing the picturebox, but I don't know how to calculate the left offset in the plot before where the x-axis begins. It seems like I should use the y-axis width plus the y-axis label (text edit box) however the text edit box returns a width of -1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a good way to calculate the left-hand margin or (better) a way to keep all the coloring in the framebox?&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// illustrate technique and problem
dt = New Table( "frame_box_ex",
	Add Rows( 48 ),
	New Column( "X",
		Numeric,
		"Continuous",
		Format( "Best", 12 ),
		Set Selected,
		Set Values(
			[1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8,
			1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8]
		)
	),
	New Column( "Y",
		Numeric,
		"Continuous",
		Format( "Best", 12 ),
		Set Values(
			[1.45808886692691, 2.39035819973415, 2.99796363989942, 4.0175538469545,
			4.97635791617404, 5.26099494066037, 6.35297458603344, 7.08128130389934,
			1.28206570793684, 2.65813273844257, 3.90780332034481, 5.56931861718803,
			6.5102957541246, 7.85452087528389, 8.38346720371831, 9.83684443692199,
			1.07112111561808, 1.80813159968191, 3.60012537918958, 4.59349059340839,
			6.0331086735015, 7.38976749487193, 8.09249962943829, 8.6144549883821,
			0.793139090953735, 1.29469742405061, 1.76519280701643, 2.08182485552223,
			2.78446654871733, 3.65492098470701, 4.60137160145799, 5.4641050584207,
			-0.0498633817348688, 0.867775467257285, 2.19640092615135,
			3.8415359972872, 5.73235903219136, 6.60516876928658, 7.45020127543143,
			8.66546760100397, 0.781073560404989, 1.96654139416073, 2.08763174310172,
			2.25180062442375, 3.88484451908061, 4.67635031701802, 5.77656366166124,
			6.97420411204293]
		)
	),
	New Column( "Unit",
		Numeric,
		"Continuous",
		Format( "Best", 12 ),
		Set Values(
			[1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3,
			4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6]
		)
	),
	New Column( "Group",
		Numeric,
		"Nominal",
		Format( "Best", 12 ),
		Set Values(
			[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
			2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2]
		)
	)
);
gb = dt &amp;lt;&amp;lt; Graph Builder(
	Size( 600, 600 ),
	Variables( X( :X ), Y( :Y ), Overlay( :Unit ), Color( :Group ) ),
	Elements( Line( X, Y, Legend( 14 ) ) ),
	SendToReport(
		Dispatch(
			{},
			"X",
			ScaleBox,
			{Min( 0 ), Max( 8 ), Inc( 1 ), Minor Ticks( 0 )}
		)
	)
);

nw = New Window( "for testing",
	Outline Box( "complicated plot",
		Spacer Box( Size( 2, 10 ) ),
		lu1 = Lineup Box( N Col( 3 ), Spacing( 0 ) )
	)
);

lu1 &amp;lt;&amp;lt; Append( Report( gb )[AxisBox( 2 )] );
lu1 &amp;lt;&amp;lt; Append( Report( gb )[FrameBox( 1 )] );
lu1 &amp;lt;&amp;lt; Append( Report( gb )[LegendBox( 1 )] );
//end of row
lu1 &amp;lt;&amp;lt; Append( Spacer Box() );
lu1 &amp;lt;&amp;lt; Append( Report( gb )[AxisBox( 1 )] );
lu1 &amp;lt;&amp;lt; Append( Spacer Box() );
//end of row
lu1 &amp;lt;&amp;lt; Append( Spacer Box() );
lu1 &amp;lt;&amp;lt; Append( insrt_icons = H List Box() );
lu1 &amp;lt;&amp;lt; Append( Spacer Box() );

numXAxisWidth = (gb &amp;lt;&amp;lt; report)[AxisBox( 1 )] &amp;lt;&amp;lt; get width;
numSteps = N Items( Associative Array( Column( dt, "X" ) ) &amp;lt;&amp;lt; get keys );
numOneIncr = (numXAxisWidth) / (numSteps);

For( _i = 1, _i &amp;lt;= numSteps, _i++, 
	
	insrt_icons &amp;lt;&amp;lt; Append( Spacer Box( Size( numOneIncr, numOneIncr ), Color( _i ) ) )
);

&lt;/CODE&gt;&lt;/PRE&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;</description>
    <pubDate>Sat, 09 Mar 2024 01:30:36 GMT</pubDate>
    <dc:creator>Mittman</dc:creator>
    <dc:date>2024-03-09T01:30:36Z</dc:date>
    <item>
      <title>getting lefthand offset between beginning of picture box and framebox from graphbuilder plot</title>
      <link>https://community.jmp.com/t5/Discussions/getting-lefthand-offset-between-beginning-of-picture-box-and/m-p/731327#M91398</link>
      <description>&lt;P&gt;JMP Pro 17.2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a plot where I want to use both overlay (to separate lines) and color (to color related lines the same way). This works great, but I lose all colors when extracting the framebox. I can keep the colors by grabbing the picturebox, but I don't know how to calculate the left offset in the plot before where the x-axis begins. It seems like I should use the y-axis width plus the y-axis label (text edit box) however the text edit box returns a width of -1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a good way to calculate the left-hand margin or (better) a way to keep all the coloring in the framebox?&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// illustrate technique and problem
dt = New Table( "frame_box_ex",
	Add Rows( 48 ),
	New Column( "X",
		Numeric,
		"Continuous",
		Format( "Best", 12 ),
		Set Selected,
		Set Values(
			[1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8,
			1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8]
		)
	),
	New Column( "Y",
		Numeric,
		"Continuous",
		Format( "Best", 12 ),
		Set Values(
			[1.45808886692691, 2.39035819973415, 2.99796363989942, 4.0175538469545,
			4.97635791617404, 5.26099494066037, 6.35297458603344, 7.08128130389934,
			1.28206570793684, 2.65813273844257, 3.90780332034481, 5.56931861718803,
			6.5102957541246, 7.85452087528389, 8.38346720371831, 9.83684443692199,
			1.07112111561808, 1.80813159968191, 3.60012537918958, 4.59349059340839,
			6.0331086735015, 7.38976749487193, 8.09249962943829, 8.6144549883821,
			0.793139090953735, 1.29469742405061, 1.76519280701643, 2.08182485552223,
			2.78446654871733, 3.65492098470701, 4.60137160145799, 5.4641050584207,
			-0.0498633817348688, 0.867775467257285, 2.19640092615135,
			3.8415359972872, 5.73235903219136, 6.60516876928658, 7.45020127543143,
			8.66546760100397, 0.781073560404989, 1.96654139416073, 2.08763174310172,
			2.25180062442375, 3.88484451908061, 4.67635031701802, 5.77656366166124,
			6.97420411204293]
		)
	),
	New Column( "Unit",
		Numeric,
		"Continuous",
		Format( "Best", 12 ),
		Set Values(
			[1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3,
			4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6]
		)
	),
	New Column( "Group",
		Numeric,
		"Nominal",
		Format( "Best", 12 ),
		Set Values(
			[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
			2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2]
		)
	)
);
gb = dt &amp;lt;&amp;lt; Graph Builder(
	Size( 600, 600 ),
	Variables( X( :X ), Y( :Y ), Overlay( :Unit ), Color( :Group ) ),
	Elements( Line( X, Y, Legend( 14 ) ) ),
	SendToReport(
		Dispatch(
			{},
			"X",
			ScaleBox,
			{Min( 0 ), Max( 8 ), Inc( 1 ), Minor Ticks( 0 )}
		)
	)
);

nw = New Window( "for testing",
	Outline Box( "complicated plot",
		Spacer Box( Size( 2, 10 ) ),
		lu1 = Lineup Box( N Col( 3 ), Spacing( 0 ) )
	)
);

lu1 &amp;lt;&amp;lt; Append( Report( gb )[AxisBox( 2 )] );
lu1 &amp;lt;&amp;lt; Append( Report( gb )[FrameBox( 1 )] );
lu1 &amp;lt;&amp;lt; Append( Report( gb )[LegendBox( 1 )] );
//end of row
lu1 &amp;lt;&amp;lt; Append( Spacer Box() );
lu1 &amp;lt;&amp;lt; Append( Report( gb )[AxisBox( 1 )] );
lu1 &amp;lt;&amp;lt; Append( Spacer Box() );
//end of row
lu1 &amp;lt;&amp;lt; Append( Spacer Box() );
lu1 &amp;lt;&amp;lt; Append( insrt_icons = H List Box() );
lu1 &amp;lt;&amp;lt; Append( Spacer Box() );

numXAxisWidth = (gb &amp;lt;&amp;lt; report)[AxisBox( 1 )] &amp;lt;&amp;lt; get width;
numSteps = N Items( Associative Array( Column( dt, "X" ) ) &amp;lt;&amp;lt; get keys );
numOneIncr = (numXAxisWidth) / (numSteps);

For( _i = 1, _i &amp;lt;= numSteps, _i++, 
	
	insrt_icons &amp;lt;&amp;lt; Append( Spacer Box( Size( numOneIncr, numOneIncr ), Color( _i ) ) )
);

&lt;/CODE&gt;&lt;/PRE&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Sat, 09 Mar 2024 01:30:36 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/getting-lefthand-offset-between-beginning-of-picture-box-and/m-p/731327#M91398</guid>
      <dc:creator>Mittman</dc:creator>
      <dc:date>2024-03-09T01:30:36Z</dc:date>
    </item>
    <item>
      <title>Re: getting lefthand offset between beginning of picture box and framebox from graphbuilder plot</title>
      <link>https://community.jmp.com/t5/Discussions/getting-lefthand-offset-between-beginning-of-picture-box-and/m-p/731455#M91399</link>
      <description>&lt;P&gt;Interesting approach! If you can keep everything inside the frame box, it will be easier...just use with the graph's coordinate system. I suspect you are going to be fighting with the integer coordinate system for the displayboxes as well as trying to find the proper origins; you also will disconnect the graph from the axes (dragging the scales, etc won't work.)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = New Table( "frame_box_ex",
	Add Rows( 48 ),
	New Column( "X",
		Numeric,
		"Continuous",
		Format( "Best", 12 ),
		Set Selected,
		Set Values(
			[1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6,
			7, 8]
		)
	),
	New Column( "Y",
		Numeric,
		"Continuous",
		Format( "Best", 12 ),
		Set Values(
			[1.45808886692691, 2.39035819973415, 2.99796363989942, 4.0175538469545, 4.97635791617404, 5.26099494066037, 6.35297458603344,
			7.08128130389934, 1.28206570793684, 2.65813273844257, 3.90780332034481, 5.56931861718803, 6.5102957541246, 7.85452087528389,
			8.38346720371831, 9.83684443692199, 1.07112111561808, 1.80813159968191, 3.60012537918958, 4.59349059340839, 6.0331086735015,
			7.38976749487193, 8.09249962943829, 8.6144549883821, 0.793139090953735, 1.29469742405061, 1.76519280701643, 2.08182485552223,
			2.78446654871733, 3.65492098470701, 4.60137160145799, 5.4641050584207, -0.0498633817348688, 0.867775467257285, 2.19640092615135,
			3.8415359972872, 5.73235903219136, 6.60516876928658, 7.45020127543143, 8.66546760100397, 0.781073560404989, 1.96654139416073,
			2.08763174310172, 2.25180062442375, 3.88484451908061, 4.67635031701802, 5.77656366166124, 6.97420411204293]
		)
	),
	New Column( "Unit",
		Numeric,
		"Continuous",
		Format( "Best", 12 ),
		Set Values(
			[1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6,
			6, 6]
		)
	),
	New Column( "Group",
		Numeric,
		"Nominal",
		Format( "Best", 12 ),
		Set Values(
			[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
			2, 2]
		)
	)
);
gb = dt &amp;lt;&amp;lt; Graph Builder(
	Size( 600, 600 ),
	Show Control Panel( 0 ),
	Variables( X( :X ), Y( :Y ), Overlay( :Unit ), Color( :Group ) ),
	Elements( Line( X, Y, Legend( 14 ) ) ),
	SendToReport(
		Dispatch( {}, "X", ScaleBox, {Min( 0 ), Max( 9 ), Inc( 1 ), Minor Ticks( 0 )} ),
		Dispatch( {}, "Y", ScaleBox, {Min( -1 ), Max( 10.1 ), Inc( 2 ), Minor Ticks( 0 )} )
	)
);

Report( gb )[framebox( 1 )] &amp;lt;&amp;lt; addgraphicsscript(
	Text( {1, 8}, JMP Version() );
	For( here:x = 1, here:x &amp;lt; 8, here:x += 1,
		Fill Color( HLS Color( here:x / 9, .5, 1 ) );
		Rect( here:x, -.2, here:x + 1, -.8, 1 );
		Fill Color( "white" );
		Circle( {x + .5, -.5}, .25, "FILL" );
		Text Color( "black" );
		Text Size( 12 );
		Text( center justified, {x + .5, -.65 /*vertical centering depends on text size*/}, Substr( "ABCDEFG", x, 1 ) );
	);
);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Add a graphics script to the framebox to make custom displays." style="width: 670px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/62019i4E80D4A71B1A6033/image-size/large?v=v2&amp;amp;px=999" role="button" title="graphicsScript17.png" alt="Add a graphics script to the framebox to make custom displays." /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Add a graphics script to the framebox to make custom displays.&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 09 Mar 2024 09:21:17 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/getting-lefthand-offset-between-beginning-of-picture-box-and/m-p/731455#M91399</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2024-03-09T09:21:17Z</dc:date>
    </item>
  </channel>
</rss>

