How to put a list of values on a single axis and add custom labels

I have a table in the following format: Apple 2 Pear 3 Banana 5 Orange 6.5 .... I would like to put the values on a single horizontal axis and add corresponding descriptive labels (apple, pear, banana etc.) next to the values. How can I do that in Mathematica? Many thanks!

• You may want to look up BarChart. – Jens Jul 2 '13 at 5:26
• What do you mean by put the values on a single horizontal axis? It sound like you want a dot on a line with a label. That's not the BarChart Jens suggested. Could you be a little bit more specific? – Sjoerd C. de Vries Jul 2 '13 at 5:48

From a list like ls = {{"Apple", 2} , {"Pear", 3}, {"Banana", 5}, {"Orange", 6.5}} you can get:

ListPlot[Labeled[{#[[2]], 0},Framed[Rotate[#[[1]], 90 Degree],
Background -> Yellow], Top] & /@ ls, Axes -> {True, False}]


Another possibility is to do it yourself:

ls = {{"Apple", 2}, {"Pear", 3}, {"Banana", 5}, {"Orange", 6.5}};
Graphics[{
{Text[Style[First@#, 18], {Last@#, 0.25}],
Red,
Disk[{Last@#, 0.1}, .05]} & /@ ls,
},
Axes -> { True, False}]


Using ListPlot with Callout:

ls = {{"Apple", 2} , {"Pear", 3}, {"Banana", 5}, {"Orange", 6.5}};

ListPlot[Callout[{#2, 0}, #, Above,
Background -> LightOrange, Frame -> True, FrameMargins -> 6,
"CalloutStyle" -> Red, LeaderSize -> 30,
LabelStyle -> {14, Bold, Red},
CalloutMarker -> Arrowheads[.05]] & @@@ ls, Axes -> {True, False},
PlotStyle -> PointSize[Large], AspectRatio -> (1/4)]


(Ab)using TimelinePlot:

TimelinePlot[Labeled[{2000, 1, 1, #2}, # ] & @@@ ls, DateTicksFormat -> {"HourShort"}]