#### 7.4 bar-chart - histogram (14.1.02)

##### 7.4.1 jrc

I can’t ﬁnd an example or topic in ’Help’ for Maple 7 (student version) which will directly produce a common bar-chart. I conclude reluctantly that Maple does not have this functionality. Is this correct?

##### 7.4.2 Robert Israel (15.1.02)

You might want to try BarChart from my Maple Advisor Database, http://www.math.ubc.ca/~israel/advisor

##### 7.4.3 Dr. TANAKA, Kazuo (16.1.02)

In the following book, a procedure to produce a bar chart is described.

T.Oguni, Maple V and its actual usages (Science,Tokyo, 1997) p.137 (in Japanese)

 >with(plots):
>with(plottools):



A procedure to make bar chart

 > barchart:=proc(data::list(integer))
> local n,p,i;
> n:=nops(data);
> p:=i->[[i-1,0],[i-1,data[i]],[i,data[i]],[i,0]];
> PLOT(seq(POLYGONS(evalf(p(i))),i=1..n));
> end;



An example

 > data:=[10,40,20,30];
> barchart(data);



##### 7.4.4 Thomas Richard (16.1.02)

No, they’re just called histograms. :-) When Help / Full Text Search is fed with "bar chart", it ﬁnds statplots,histogram (in the middle of the hit list). Look up that help page.

##### 7.4.5 Michael Faia (24.1.02)

Here’s a minimalist procedure that works, although it’s a little labor-intensive:

 > R := n -> (((3^n - 2^(n+1)) + 1) / 2) + 1;
> with(stats[statplots]):
> data2 := [Weight(2.5..3.5, R(3)), Weight(3.5..4.5, R(4)),
Weight(4.5..5.5, R(5))]:
> histogram(data2, xtickmarks=3);