<?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 Control bin width in bar chart with in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Control-bin-width-in-bar-chart-with/m-p/247844#M48654</link>
    <description>&lt;P&gt;If you drop the sepal length column from the iris data set on both the x and y axes, then choose a bar chart with count as the summary statistic and stacked as the bar style you are presented with a stacked histogram.&amp;nbsp; Is it possible to change the bin width on the x axis for this chart?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Desired chart:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Binned.png" style="width: 680px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/21775i94D93183D0C41655/image-size/large?v=v2&amp;amp;px=999" role="button" title="Binned.png" alt="Binned.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The bar chart using a continuous variable:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Automatic.png" style="width: 680px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/21776i2F6FFFEB2E664A63/image-size/large?v=v2&amp;amp;px=999" role="button" title="Automatic.png" alt="Automatic.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Adding a bar style chart to the histogram would be a more intuitive method but there is no bar style option there.&amp;nbsp; I did submit a wish list item to add that &lt;A href="https://community.jmp.com/t5/JMP-Wish-List/Add-bar-style-to-histogram-within-graph-builder/idi-p/247843" target="_self"&gt;here&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Script to make charts:&lt;/P&gt;&lt;LI-SPOILER&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names default to here(1);

dt = Open( "$Sample_Data/iris.jmp" );

dt &amp;lt;&amp;lt; New Column("Sepal length Binned", Numeric, "Continuous", Format("Fixed Dec", 12, 1), Formula(Floor(:Sepal length / 0.2) * 0.2));
dt &amp;lt;&amp;lt; New Column("Is Target", Character, "Nominal", Set Property("Value Colors", {"Is Target" = 59, "The Rest" = 32}), Formula(If(:Species == "setosa", "Is Target", "The Rest")));

//Desired Chart - requires extra column
dt &amp;lt;&amp;lt; Graph Builder(
	Size( 500, 300 ),
	Show Control Panel( 0 ),
	Variables(
		X( :Sepal length ),
		Y( :Sepal length ),
		Overlay( :Is Target ),
		Color( :Is Target )
	),
	Elements(
		Bar( X, Y, Legend( 11 ), Bar Style( "Stacked" ), Summary Statistic( "N" ) )
	),
	SendToReport(
		Dispatch(
			{},
			"Sepal length",
			ScaleBox,
			{Min( 4.1659880239521 ), Max( 8.0340119760479 ), Inc( 0.2 ),
			Minor Ticks( 0 )}
		)
	)
);

//Automatic Bin Width - easier
dt &amp;lt;&amp;lt; Graph Builder(
	Size( 500, 300 ),
	Show Control Panel( 0 ),
	Variables(
		X( :Sepal length Binned ),
		Y( :Sepal length Binned ),
		Overlay( :Is Target ),
		Color( :Is Target )
	),
	Elements(
		Bar( X, Y, Legend( 11 ), Bar Style( "Stacked" ), Summary Statistic( "N" ) )
	),
	SendToReport(
		Dispatch(
			{},
			"Sepal length",
			ScaleBox,
			{Min( 4.1659880239521 ), Max( 8.0340119760479 ), Inc( 0.2 ),
			Minor Ticks( 0 )}
		)
	)
);

//Histogram option - no way to stack bars, leads to confusion when 'Is Target' 
//and 'The rest' have similar counts
dt &amp;lt;&amp;lt; Graph Builder(
	Size( 500, 300 ),
	Show Control Panel( 0 ),
	Variables(
		X( :Sepal length ),
		Y( :Sepal length ),
		Overlay( :Is Target ),
		Color( :Is Target )
	),
	Elements( Histogram( X, Y, Legend( 12 ) ) ),
	SendToReport(
		Dispatch(
			{},
			"Sepal length",
			ScaleBox,
			{Min( 4.1659880239521 ), Max( 8.0340119760479 ), Inc( 0.2 ),
			Minor Ticks( 0 )}
		)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;/LI-SPOILER&gt;</description>
    <pubDate>Mon, 17 Feb 2020 14:47:45 GMT</pubDate>
    <dc:creator>ih</dc:creator>
    <dc:date>2020-02-17T14:47:45Z</dc:date>
    <item>
      <title>Control bin width in bar chart with</title>
      <link>https://community.jmp.com/t5/Discussions/Control-bin-width-in-bar-chart-with/m-p/247844#M48654</link>
      <description>&lt;P&gt;If you drop the sepal length column from the iris data set on both the x and y axes, then choose a bar chart with count as the summary statistic and stacked as the bar style you are presented with a stacked histogram.&amp;nbsp; Is it possible to change the bin width on the x axis for this chart?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Desired chart:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Binned.png" style="width: 680px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/21775i94D93183D0C41655/image-size/large?v=v2&amp;amp;px=999" role="button" title="Binned.png" alt="Binned.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The bar chart using a continuous variable:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Automatic.png" style="width: 680px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/21776i2F6FFFEB2E664A63/image-size/large?v=v2&amp;amp;px=999" role="button" title="Automatic.png" alt="Automatic.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Adding a bar style chart to the histogram would be a more intuitive method but there is no bar style option there.&amp;nbsp; I did submit a wish list item to add that &lt;A href="https://community.jmp.com/t5/JMP-Wish-List/Add-bar-style-to-histogram-within-graph-builder/idi-p/247843" target="_self"&gt;here&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Script to make charts:&lt;/P&gt;&lt;LI-SPOILER&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names default to here(1);

dt = Open( "$Sample_Data/iris.jmp" );

dt &amp;lt;&amp;lt; New Column("Sepal length Binned", Numeric, "Continuous", Format("Fixed Dec", 12, 1), Formula(Floor(:Sepal length / 0.2) * 0.2));
dt &amp;lt;&amp;lt; New Column("Is Target", Character, "Nominal", Set Property("Value Colors", {"Is Target" = 59, "The Rest" = 32}), Formula(If(:Species == "setosa", "Is Target", "The Rest")));

//Desired Chart - requires extra column
dt &amp;lt;&amp;lt; Graph Builder(
	Size( 500, 300 ),
	Show Control Panel( 0 ),
	Variables(
		X( :Sepal length ),
		Y( :Sepal length ),
		Overlay( :Is Target ),
		Color( :Is Target )
	),
	Elements(
		Bar( X, Y, Legend( 11 ), Bar Style( "Stacked" ), Summary Statistic( "N" ) )
	),
	SendToReport(
		Dispatch(
			{},
			"Sepal length",
			ScaleBox,
			{Min( 4.1659880239521 ), Max( 8.0340119760479 ), Inc( 0.2 ),
			Minor Ticks( 0 )}
		)
	)
);

//Automatic Bin Width - easier
dt &amp;lt;&amp;lt; Graph Builder(
	Size( 500, 300 ),
	Show Control Panel( 0 ),
	Variables(
		X( :Sepal length Binned ),
		Y( :Sepal length Binned ),
		Overlay( :Is Target ),
		Color( :Is Target )
	),
	Elements(
		Bar( X, Y, Legend( 11 ), Bar Style( "Stacked" ), Summary Statistic( "N" ) )
	),
	SendToReport(
		Dispatch(
			{},
			"Sepal length",
			ScaleBox,
			{Min( 4.1659880239521 ), Max( 8.0340119760479 ), Inc( 0.2 ),
			Minor Ticks( 0 )}
		)
	)
);

//Histogram option - no way to stack bars, leads to confusion when 'Is Target' 
//and 'The rest' have similar counts
dt &amp;lt;&amp;lt; Graph Builder(
	Size( 500, 300 ),
	Show Control Panel( 0 ),
	Variables(
		X( :Sepal length ),
		Y( :Sepal length ),
		Overlay( :Is Target ),
		Color( :Is Target )
	),
	Elements( Histogram( X, Y, Legend( 12 ) ) ),
	SendToReport(
		Dispatch(
			{},
			"Sepal length",
			ScaleBox,
			{Min( 4.1659880239521 ), Max( 8.0340119760479 ), Inc( 0.2 ),
			Minor Ticks( 0 )}
		)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;/LI-SPOILER&gt;</description>
      <pubDate>Mon, 17 Feb 2020 14:47:45 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Control-bin-width-in-bar-chart-with/m-p/247844#M48654</guid>
      <dc:creator>ih</dc:creator>
      <dc:date>2020-02-17T14:47:45Z</dc:date>
    </item>
    <item>
      <title>Re: Control bin width in bar chart with</title>
      <link>https://community.jmp.com/t5/Discussions/Control-bin-width-in-bar-chart-with/m-p/248940#M48869</link>
      <description>&lt;P&gt;In this case, using Sepal Length as the X-axis variable, for a bar chart.&lt;/P&gt;
&lt;P&gt;Sepal Length is. an continuous numeric variable; however, a bar chart only work with nominal (categorical) variables.&lt;/P&gt;
&lt;P&gt;Since sepal length is rounded to the nearest 10th, it is plotted as the number of times each sepal length (in increments of tenths) occurs in the data set.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example, write this formula in a column&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;:Sepal length + Random Normal()&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Use that column in a graph builder plot, and choose bar chart. The result is a haze of lines, or very thin bars.&lt;/P&gt;
&lt;P&gt;If you want fewer bins, in this case, rounding the data appropriately could help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So the short answer is, no you can't change it in the graph. The answer is also, don't make bar charts using a continuous variable for categories. Check out the add-in, &lt;A href="https://community.jmp.com/t5/JMP-Add-Ins/Interactive-Binning-V2/ta-p/22495" target="_self"&gt;Interactive Binning v2&lt;/A&gt;. &amp;nbsp;This tool lets you break data down into bins either manually of with a couple of other statistical intervals.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Feb 2020 15:19:52 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Control-bin-width-in-bar-chart-with/m-p/248940#M48869</guid>
      <dc:creator>Byron_JMP</dc:creator>
      <dc:date>2020-02-24T15:19:52Z</dc:date>
    </item>
  </channel>
</rss>

