<?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 custom graph legend in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/custom-graph-legend/m-p/879306#M104259</link>
    <description>&lt;P&gt;I'm trying to add a nice pretty graph legend to a Bivariate Fit:&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="seanschubert_3-1749609654606.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/76773i80DED1D3479C8931/image-size/medium?v=v2&amp;amp;px=400" role="button" title="seanschubert_3-1749609654606.png" alt="seanschubert_3-1749609654606.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The orange fit line is a customized line added using this script:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; Pen Color( "orange" );&lt;BR /&gt;&amp;nbsp; &amp;nbsp; Pen Size( 2 );&lt;BR /&gt;&amp;nbsp; &amp;nbsp; Y Function( 21.07 * x, x );&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I used this custom script in the graph to get that text in there:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; Text( {20, 32}, "TOT Other = 21.1 * 3XL" );&lt;BR /&gt;&amp;nbsp; &amp;nbsp; Text( {20, 25}, "TOT Other = 46.8 + 9.1*3XL" );&lt;BR /&gt;&amp;nbsp; &amp;nbsp; Text( {20, 19}, "Log(TOT Other) = 3.0 + 0.75*Log(3XL)" );&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'd like to put those equations into a nice legend box and color each text by its color in the graph and maybe make the text bold.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any ideas on how to do it in the script or adding the orange fit as another model to the fits below?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- Sean&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 11 Jun 2025 02:49:43 GMT</pubDate>
    <dc:creator>seanschubert</dc:creator>
    <dc:date>2025-06-11T02:49:43Z</dc:date>
    <item>
      <title>custom graph legend</title>
      <link>https://community.jmp.com/t5/Discussions/custom-graph-legend/m-p/879306#M104259</link>
      <description>&lt;P&gt;I'm trying to add a nice pretty graph legend to a Bivariate Fit:&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="seanschubert_3-1749609654606.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/76773i80DED1D3479C8931/image-size/medium?v=v2&amp;amp;px=400" role="button" title="seanschubert_3-1749609654606.png" alt="seanschubert_3-1749609654606.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The orange fit line is a customized line added using this script:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; Pen Color( "orange" );&lt;BR /&gt;&amp;nbsp; &amp;nbsp; Pen Size( 2 );&lt;BR /&gt;&amp;nbsp; &amp;nbsp; Y Function( 21.07 * x, x );&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I used this custom script in the graph to get that text in there:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; Text( {20, 32}, "TOT Other = 21.1 * 3XL" );&lt;BR /&gt;&amp;nbsp; &amp;nbsp; Text( {20, 25}, "TOT Other = 46.8 + 9.1*3XL" );&lt;BR /&gt;&amp;nbsp; &amp;nbsp; Text( {20, 19}, "Log(TOT Other) = 3.0 + 0.75*Log(3XL)" );&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'd like to put those equations into a nice legend box and color each text by its color in the graph and maybe make the text bold.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any ideas on how to do it in the script or adding the orange fit as another model to the fits below?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- Sean&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jun 2025 02:49:43 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/custom-graph-legend/m-p/879306#M104259</guid>
      <dc:creator>seanschubert</dc:creator>
      <dc:date>2025-06-11T02:49:43Z</dc:date>
    </item>
    <item>
      <title>Re: custom graph legend</title>
      <link>https://community.jmp.com/t5/Discussions/custom-graph-legend/m-p/879324#M104261</link>
      <description>&lt;P&gt;You can use change the text color by using Text Color() before text, for the border one option is to use Rect&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
New Window("Example",
	Graph Box(
		Text Color("green");
		Text(Center Justified, {50, 15}, "centered");
		Text Color("blue");
		Text(Center Justified, {50, 20}, "centered");
		Text Color("red");
		Text(Center Justified, {50, 25}, "centered");
		Pen Color("Black");
		Rect(40, 30, 60, 14);
	)
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1749615113563.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/76778iAEDBECD545869D37/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1749615113563.png" alt="jthi_0-1749615113563.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I'm not sure if Fit Y by X lets you add custom fits but you could&amp;nbsp;take a look at properties to see how those have been built&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_1-1749615299817.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/76779iBF73D260B4D0A376/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_1-1749615299817.png" alt="jthi_1-1749615299817.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;and try to imitate that&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.jmp");
obj = dt &amp;lt;&amp;lt; Bivariate(Y(:Weight), X(:Height));
obj &amp;lt;&amp;lt; Fit Line;

Report(obj)[ListBox(4)] &amp;lt;&amp;lt; Append(
	H List Box(align("center"),
		Popup Box({"",1 }),
		//Spacer Box(Size(15, 0)), // to leave empty instead of red triangle
		Spacer Box(Size(22, 2), Color("Orange")),
		Text Box(" myfit")
	)
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_2-1749615580137.png" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/76780iD1274D1A8652D687/image-size/large?v=v2&amp;amp;px=999" role="button" title="jthi_2-1749615580137.png" alt="jthi_2-1749615580137.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jun 2025 04:20:00 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/custom-graph-legend/m-p/879324#M104261</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-06-11T04:20:00Z</dc:date>
    </item>
    <item>
      <title>Re: custom graph legend</title>
      <link>https://community.jmp.com/t5/Discussions/custom-graph-legend/m-p/879376#M104268</link>
      <description>&lt;P&gt;For the greatest flexibility and customization, I believe Graph Builder is better suited than Fit Y by X.&lt;/P&gt;
&lt;P&gt;Once you have the information you need from the Bivariate platform, could you save the fit equations as columns (red triangle -&amp;gt; save predicteds)? If you name each of these new fit columns with the expression for that equation, then that text will show up by default in legends.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To replicate your plot in Graph Builder, add the data plus all the fits in the Y-role, and "3XL" in the X-role. For the plot types, use Points for the data, and Function for the fits. Legend text can be made bold from the Legend Settings. An outline box can be added by right clicking in the legend (not on the text), and selecting Show Properties, then set Border=1 for all four sides. Click and drag the legend to place it anywhere in the window. These customizations can all be saved to the table, to a workflow, or to a script window.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm not aware of a way to set the legend text color to match the plot color automatically, unfortunately.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jun 2025 08:51:47 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/custom-graph-legend/m-p/879376#M104268</guid>
      <dc:creator>christian-z</dc:creator>
      <dc:date>2025-06-11T08:51:47Z</dc:date>
    </item>
  </channel>
</rss>

