<?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: Bar and Errorbar Colors for Forest Plot? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Bar-and-Errorbar-Colors-for-Forest-Plot/m-p/52313#M29614</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have you taken a look at Richard Zink's add-in on forest plots?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.jmp.com/t5/JMP-Add-Ins/Forest-Plot-Add-In/ta-p/23977" target="_self"&gt;https://community.jmp.com/t5/JMP-Add-Ins/Forest-Plot-Add-In/ta-p/23977&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since the Add-in is esentially a zip file, you can rename the file extension to .zip and unzip it. There you can see his JSL and maybe use some of that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Chris&lt;/P&gt;</description>
    <pubDate>Wed, 28 Feb 2018 15:07:09 GMT</pubDate>
    <dc:creator>Chris_Kirchberg</dc:creator>
    <dc:date>2018-02-28T15:07:09Z</dc:date>
    <item>
      <title>Bar and Errorbar Colors for Forest Plot?</title>
      <link>https://community.jmp.com/t5/Discussions/Bar-and-Errorbar-Colors-for-Forest-Plot/m-p/52311#M29612</link>
      <description>&lt;P&gt;I'm creating forest plots and have come up with two styles:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ForestPlots.png" style="width: 843px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/9632iE10F6945C279A0BA/image-size/large?v=v2&amp;amp;px=999" role="button" title="ForestPlots.png" alt="ForestPlots.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I'm trying to control the color of the bars, points and error bars through row colors:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ForestData.png" style="width: 574px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/9633i01555E0697DD2F02/image-size/large?v=v2&amp;amp;px=999" role="button" title="ForestData.png" alt="ForestData.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;My question is why aren't the solid bars and the error bars in the desired color?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = New Table( "Forest Plot", Add Rows( 5 ), 
	New Column( "EVENT_NAME", Character( 20 ), "Nominal",
		Set Values( {"AAAAAAA", "BBBBBBB", "CCCCCCC", "DDDDDDD", "EEEEEEE"} ) ),
	New Column( "DISPROP025", Numeric, "Continuous", Format( "Fixed Dec", 16, 2 ),
		Set Values(
			[5.3766744840813, 1.28687381477736, 5.96303490967794, 1.55531597890029, 2.34164191312678] ) ),
	New Column( "DISPROP", Numeric, "Continuous", Format( "Fixed Dec", 16, 2 ),
		Set Values(
			[5.76756983251198, 1.49287821887835, 7.02941951612351, 3.83591362397761, 2.62194430908125] ) ),
	New Column( "DISPROP975", Numeric, "Continuous", Format( "Fixed Dec", 16, 2 ),
		Set Values(
			[6.06935482201811, 1.66251397924122, 7.91895228410917, 6.92389142535734, 2.84619058478479] ) ),
	New Column( "Alert", Character, "Nominal",
		Formula( If( :DISPROP025 &amp;gt; 1 &amp;amp; :DISPROP &amp;gt; 2, "Y", "N" ) ) ),
	Set Row States( [13568, 13056, 13568, 13568, 13568] )
);

// Bars + central point
dt &amp;lt;&amp;lt; Graph Builder(
	Show Control Panel( 0 ),
	Variables(
		X( :DISPROP025 ),
		X( :DISPROP, Position( 1 ) ),
		X( :DISPROP975, Position( 1 ) ),
		Y( :EVENT_NAME )
	),
	Elements(
		Bar( X( 1 ), X( 3 ), Y, Legend( 9 ), Bar Style( "Range" ) ),
		Points( X( 2 ), Y, Legend( 10 ), Jitter( 0 ) )
	),
	SendToReport(
		Dispatch( {}, "DISPROP025", ScaleBox,
			{Min( 0 ), Add Ref Line( 1, "Dotted", "Dark Red", "", 2 ),
			Label Row( Show Major Grid( 1 ) )}
		),
		Dispatch( {}, "EVENT_NAME", ScaleBox, {Label Row( Show Major Grid( 1 ) )} ),
		Dispatch( {}, "X title", TextEditBox, {Set Text( "Disproportionality" )} ),
		Dispatch( {}, "Y title", TextEditBox, {Set Text( "PT" )} )
	)
);

// Error bars
dt &amp;lt;&amp;lt; Graph Builder(
	Show Control Panel( 0 ),
	Variables(
		X( :DISPROP025 ),
		X( :DISPROP, Position( 1 ) ),
		X( :DISPROP975, Position( 1 ) ),
		Y( :EVENT_NAME )
	),
	Elements(
		Bar( X( 1 ), X( 3 ), Y, Legend( 9 ), Bar Style( "Interval" ) ),
		Points( X( 2 ), Y, Legend( 10 ), Jitter( 0 ) )
	),
	SendToReport(
		Dispatch( {}, "DISPROP025", ScaleBox,
			{Min( 0 ), Add Ref Line( 1, "Dotted", "Dark Red", "", 2 ),
			Label Row( Show Major Grid( 1 ) )}
		),
		Dispatch( {}, "EVENT_NAME", ScaleBox, {Label Row( Show Major Grid( 1 ) )} ),
		Dispatch( {}, "X title", TextEditBox, {Set Text( "Disproportionality" )} ),
		Dispatch( {}, "Y title", TextEditBox, {Set Text( "PT" )} )
	)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 28 Feb 2018 15:01:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Bar-and-Errorbar-Colors-for-Forest-Plot/m-p/52311#M29612</guid>
      <dc:creator>pmroz</dc:creator>
      <dc:date>2018-02-28T15:01:22Z</dc:date>
    </item>
    <item>
      <title>Re: Bar and Errorbar Colors for Forest Plot?</title>
      <link>https://community.jmp.com/t5/Discussions/Bar-and-Errorbar-Colors-for-Forest-Plot/m-p/52313#M29614</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have you taken a look at Richard Zink's add-in on forest plots?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.jmp.com/t5/JMP-Add-Ins/Forest-Plot-Add-In/ta-p/23977" target="_self"&gt;https://community.jmp.com/t5/JMP-Add-Ins/Forest-Plot-Add-In/ta-p/23977&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since the Add-in is esentially a zip file, you can rename the file extension to .zip and unzip it. There you can see his JSL and maybe use some of that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Wed, 28 Feb 2018 15:07:09 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Bar-and-Errorbar-Colors-for-Forest-Plot/m-p/52313#M29614</guid>
      <dc:creator>Chris_Kirchberg</dc:creator>
      <dc:date>2018-02-28T15:07:09Z</dc:date>
    </item>
    <item>
      <title>Re: Bar and Errorbar Colors for Forest Plot?</title>
      <link>https://community.jmp.com/t5/Discussions/Bar-and-Errorbar-Colors-for-Forest-Plot/m-p/52317#M29617</link>
      <description>You might have to use the Alert variable to color. This works on the bar graph but not the error bar graph.The Error Bar color is controlled by the legend color.  Not sure how to script different colors for different error bars.</description>
      <pubDate>Wed, 28 Feb 2018 15:21:11 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Bar-and-Errorbar-Colors-for-Forest-Plot/m-p/52317#M29617</guid>
      <dc:creator>Chris_Kirchberg</dc:creator>
      <dc:date>2018-02-28T15:21:11Z</dc:date>
    </item>
    <item>
      <title>Re: Bar and Errorbar Colors for Forest Plot?</title>
      <link>https://community.jmp.com/t5/Discussions/Bar-and-Errorbar-Colors-for-Forest-Plot/m-p/52321#M29620</link>
      <description>&lt;P&gt;Wait, I found a way. If you open the control panel and go to the section the says bar at the bottom, there will be a varialbe section. Open it and check all variables. a point will appear where you want it. Remove the points element from teh graph. Then use Alert variable for overlay.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So the script would look something like this&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;
Graph Builder(
	Size( 606, 564 ),
	Variables(
		X( :DISPROP025 ),
		X( :DISPROP, Position( 1 ) ),
		X( :DISPROP975, Position( 1 ) ),
		Y( :EVENT_NAME ),
		Overlay( :Alert )
	),
	Elements(
		Bar( X( 1 ), X( 3 ), X( 2 ), Y, Legend( 9 ), Bar Style( "Interval" ) )
	),
	SendToReport(
		Dispatch(
			{},
			"DISPROP025",
			ScaleBox,
			{Add Ref Line( 1, "Dotted", "Dark Red", "", 2 ),
			Label Row( Show Major Grid( 1 ) )}
		),
		Dispatch( {}, "EVENT_NAME", ScaleBox, {Label Row( Show Major Grid( 1 ) )} ),
		Dispatch(
			{},
			"400",
			ScaleBox,
			{Legend Model(
				9,
				Properties( 0, {Line Color( 6 )} ),
				Properties( 1, {Marker( "Dot" )} ),
				Properties( 2, {Line Color( -5682409 )} ),
				Properties( 3, {Marker( "Dot" )} )
			)}
		),
		Dispatch( {}, "X title", TextEditBox, {Set Text( "Disproportionality" )} ),
		Dispatch( {}, "Y title", TextEditBox, {Set Text( "PT" )} )
	)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 28 Feb 2018 15:25:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Bar-and-Errorbar-Colors-for-Forest-Plot/m-p/52321#M29620</guid>
      <dc:creator>Chris_Kirchberg</dc:creator>
      <dc:date>2018-02-28T15:25:30Z</dc:date>
    </item>
    <item>
      <title>Re: Bar and Errorbar Colors for Forest Plot?</title>
      <link>https://community.jmp.com/t5/Discussions/Bar-and-Errorbar-Colors-for-Forest-Plot/m-p/52324#M29622</link>
      <description>&lt;P&gt;Thanks Chris.&amp;nbsp; I did a search for Forest Plots and Richard's very nice addin didn't show up.&amp;nbsp; I like your coding solution as well.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Feb 2018 15:34:36 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Bar-and-Errorbar-Colors-for-Forest-Plot/m-p/52324#M29622</guid>
      <dc:creator>pmroz</dc:creator>
      <dc:date>2018-02-28T15:34:36Z</dc:date>
    </item>
    <item>
      <title>Re: Bar and Errorbar Colors for Forest Plot?</title>
      <link>https://community.jmp.com/t5/Discussions/Bar-and-Errorbar-Colors-for-Forest-Plot/m-p/52327#M29623</link>
      <description>&lt;P&gt;One more puzzler - when I drag my Alert column into the Overlay role I can control the colors nicely.&amp;nbsp; However the points are on the horizontal lines but the error bars aren't.&amp;nbsp; Any way to correct this?&amp;nbsp; If I drag Alert onto the Color role there is no "jitter", but then I can't set the color of the error bars.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ForestPlot2.png" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/9638i055DCD2BC06013AA/image-size/large?v=v2&amp;amp;px=999" role="button" title="ForestPlot2.png" alt="ForestPlot2.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Feb 2018 15:47:57 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Bar-and-Errorbar-Colors-for-Forest-Plot/m-p/52327#M29623</guid>
      <dc:creator>pmroz</dc:creator>
      <dc:date>2018-02-28T15:47:57Z</dc:date>
    </item>
    <item>
      <title>Re: Bar and Errorbar Colors for Forest Plot?</title>
      <link>https://community.jmp.com/t5/Discussions/Bar-and-Errorbar-Colors-for-Forest-Plot/m-p/52330#M29624</link>
      <description>&lt;P&gt;The Key to using overlay is to not have the Points graph element added. Click on the Points Icont at the top to turn it off. Then Bar options/discolsure box at the bottom left, put a check next to the variable DISPROP. Points will not be added inline with the error bar.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Feb 2018 16:04:42 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Bar-and-Errorbar-Colors-for-Forest-Plot/m-p/52330#M29624</guid>
      <dc:creator>Chris_Kirchberg</dc:creator>
      <dc:date>2018-02-28T16:04:42Z</dc:date>
    </item>
    <item>
      <title>Re: Bar and Errorbar Colors for Forest Plot?</title>
      <link>https://community.jmp.com/t5/Discussions/Bar-and-Errorbar-Colors-for-Forest-Plot/m-p/52361#M29643</link>
      <description>&lt;P&gt;Still no joy.&amp;nbsp; It appears that when there is a mix of Y and N alerts, the error bars are offset from the gridlines.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Forest Plot.png" style="width: 755px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/9645i193308DB519435D6/image-size/large?v=v2&amp;amp;px=999" role="button" title="Forest Plot.png" alt="Forest Plot.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Here's the code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;
Graph Builder(
	Size( 726, 451 ),
	Show Control Panel( 0 ),
	Show Legend( 0 ),
	Variables(
		X( :DISPROP025 ),
		X( :DISPROP975, Position( 1 ) ),
		X( :DISPROP, Position( 1 ) ),
		Y( :EVENT_NAME ),
		Overlay( :Alert )
	),
	Elements(
		Bar( X( 1 ), X( 2 ), X( 3 ), Y, Legend( 8 ), Bar Style( "Interval" ) )
	),
	SendToReport(
		Dispatch( {}, "DISPROP025", ScaleBox,
			{Min( 0 ), Add Ref Line( 1, "Dotted", "Dark Red", "", 1 ),
			Label Row( Show Major Grid( 1 ) )}
		),
		Dispatch( {}, "EVENT_NAME", ScaleBox, {Label Row( Show Major Grid( 1 ) )} ),
		Dispatch( {}, "400", ScaleBox,
			{Legend Model(
				8,
				Properties( 0, {Line Color( 51 ), Line Width( 2 )} ),
				Properties( 1, {Line Color( 51 ), Marker( "FilledCircle" )} ),
				Properties( 2, {Line Color( 53 ), Line Width( 2 )} ),
				Properties( 3, {Line Color( 53 ), Marker( "FilledCircle" )} )
			)}
		)
	)
);
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 28 Feb 2018 19:14:57 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Bar-and-Errorbar-Colors-for-Forest-Plot/m-p/52361#M29643</guid>
      <dc:creator>pmroz</dc:creator>
      <dc:date>2018-02-28T19:14:57Z</dc:date>
    </item>
    <item>
      <title>Re: Bar and Errorbar Colors for Forest Plot?</title>
      <link>https://community.jmp.com/t5/Discussions/Bar-and-Errorbar-Colors-for-Forest-Plot/m-p/52389#M29657</link>
      <description>&lt;P&gt;Well, darn it.&amp;nbsp; Another way is to stack the DISPROP columns into one and make the value column (called data in the below script) continuous. Then use this script&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;
Graph Builder(
	Size( 992, 630 ),
	Show Control Panel( 0 ),
	Variables( X( :Data ), Y( :EVENT_NAME ), Overlay( :Alert ) ),
	Elements(
		Points(
			X,
			Y,
			Legend( 5 ),
			Jitter( 0 ),
			Summary Statistic( "Median" ),
			Error Bars( "Range" )
		)
	),
	SendToReport(
		Dispatch( {}, "Data", ScaleBox, {Label Row( Show Major Grid( 1 ) )} ),
		Dispatch( {}, "EVENT_NAME", ScaleBox, {Label Row( Show Major Grid( 1 ) )} )
	)
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="image.png" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/9658i3187F0110ED974A0/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Its close, but there is still somthing a little off about the grid line and the data points using overlay&lt;/P&gt;</description>
      <pubDate>Wed, 28 Feb 2018 20:49:36 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Bar-and-Errorbar-Colors-for-Forest-Plot/m-p/52389#M29657</guid>
      <dc:creator>Chris_Kirchberg</dc:creator>
      <dc:date>2018-02-28T20:49:36Z</dc:date>
    </item>
    <item>
      <title>Re: Bar and Errorbar Colors for Forest Plot?</title>
      <link>https://community.jmp.com/t5/Discussions/Bar-and-Errorbar-Colors-for-Forest-Plot/m-p/52390#M29658</link>
      <description>&lt;P&gt;That is a clever solution that is "close enough for government work".&amp;nbsp; I thickened the lines to a width of 2 and the slight offset is not noticeable.&amp;nbsp; Thanks Chris!&lt;/P&gt;</description>
      <pubDate>Wed, 28 Feb 2018 21:03:37 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Bar-and-Errorbar-Colors-for-Forest-Plot/m-p/52390#M29658</guid>
      <dc:creator>pmroz</dc:creator>
      <dc:date>2018-02-28T21:03:37Z</dc:date>
    </item>
  </channel>
</rss>

