Message Boards Message Boards

1
|
3149 Views
|
1 Reply
|
4 Total Likes
View groups...
Share
Share this post:

Histogram of non-numerical data

s = {{"H", 1058}, {"L", 10}, {"M", 1}, {"N", 30}, {"P", 41}, {"Q",
141}, {"R", 107}, {"S", 86}, {"T", 155}, {"V", 588}, {"W",
489}, {"(Y)", 177}, {"Y", 66}, {"Z", 70}};
I have a bunch of data as shown above and I want to create a Histogram showing how common a given element is. Basically, the 2nd element in each sublist defines the height of the "histogram bin" this element belongs in.

Is there a way, other than constructing my own rectangles, to do this? Using Histogram is preferred. Historgram obviously doesn't work.
POSTED BY: Jeffrey Bryant
Could you use BarChart?
BarChart[s[[All, 2]], ChartLabels -> s[[All, 1]]]

POSTED BY: Szabolcs Horvát
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract