Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #4906

Re: BarChart Labeling

From Bob Hanlon <hanlonr@cox.net>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: BarChart Labeling
Date 2011-09-13 11:22 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <j4neea$51g$1@smc.vnet.net> (permalink)

Show all headers | View raw


data = RandomReal[{0, 1.}, 10];

BarChart[
 Round[data, .01],
 LabelingFunction -> Above,
 ChartLabels -> Range[10],
 PlotRangePadding -> {None, 0.1}]

BarChart[
 data,
 LabelingFunction -> (Placed[Round[#, .01], Above] &),
 ChartLabels -> Range[10],
 PlotRangePadding -> {None, 0.1}]

BarChart[
 data,
 LabelingFunction -> (Placed[NumberForm[#, {3, 2}], Above] &),
 ChartLabels -> Range[10],
 PlotRangePadding -> {None, 0.1}]


Bob Hanlon

---- Don <donabc@comcast.net> wrote: 

=============
I have spent hours trying to do something that in 
principle is very simple but it's not simple 
in Mathematica unless you stumble across 
 the magic keystrokes.


Here is a bar chart that illustrates the problem. 

data = RandomReal[{0,1.},10]
BarChart[data, LabelingFunction->Above, ChartLabels-> Range[10],
PlotRangePadding->{None, 0.1}]

As you can see, the height numbers above the bars have too many decimal places
to look good on the chart.

Specifically, what is the secret  to getting  the numbers which are the heights of the bars
to be printed in format NumberForm[#, {3,2}] (only two decimal digits)  with 
Style[FontFamily->Arial, Bold, 12].

Thank you in advance.

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Re: BarChart Labeling Bob Hanlon <hanlonr@cox.net> - 2011-09-13 11:22 +0000

csiph-web