Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I can´t put the labels 0,....,31 in this simple chart

on the usual place, or better just over the Top of each bar

How should I do?

f1[x_] := 12 x^5 - 975 x^4 + 28000 x^3 - 345000 x^2 + 1800000 x
a = Table[i, {i, 0, 31}]
fa = f1[a]

amix = Table[{i, f1[i]}, {i, 0, 31}]

atext = Table[ToString[i], {i, 0, 31}]
atext
BarChart[amix, ChartStyle -> "DarkRainbow", 
 ChartLabels -> {atext, Top}]
share|improve this question

1 Answer 1

up vote 2 down vote accepted

You just need:

f1[x_] := 12 x^5 - 975 x^4 + 28000 x^3 - 345000 x^2 + 1800000 x
BarChart[f1 /@ #, ChartLabels -> Placed[Style[#, 16] & /@ #, Above]] &@Range@31

Mathematica graphics

share|improve this answer
    
ok and anly for personal likes.... Do you know how to put labels OVER and just OUTSIDE the bar? –  Mika Ike Mar 16 at 19:57
    
In this way... I can´t replace BarChart with ListPlot. How do you would do with ListPlot? –  Mika Ike Mar 16 at 19:59
1  
@MikaIke For the legends, use Above instead of Top. –  belisarius Mar 16 at 20:01
1  
@MikaIke ListPlot[] and BarChart[] are very different beasts. You can't usually switch'em (perhaps only if you're using very basic non-specific options) –  belisarius Mar 16 at 20:05
1  
@MikaIke See edit –  belisarius Mar 16 at 22:53

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.