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 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!

share|improve this question
    
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
add comment

2 Answers

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}]

Result

share|improve this answer
add comment

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}]

single axis diagram

share|improve this answer
add comment

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.