Simple Histogram using Mathematica - please

AI Thread Summary
To create a simple histogram in Mathematica v7 using the provided data, the command Histogram[data] can be used. However, to customize the histogram with specific column values like 0, 0.5, 1, and so on, and to center the labels beneath each column, users should explore the HistogramCategories option. The original poster noted that options like Ticks -> IntervalCenters are not compatible with version 7, indicating a need for updated commands for this version. Assistance is requested for finding the correct options to achieve the desired histogram customization in Mathematica v7. Understanding these adjustments is essential for effective data visualization in this software.
AaronMartin
Messages
8
Reaction score
0
Hi. I am new to using Mathematica v7 and would like to know how to generate a very simple histogram.

The data is:

data = {1.5, 2, 0, 0.5, 1, 2, 1.5, 3, 0, 0.5, 1, 2, 2, 3, 3.5, 0, 1, 4, 2, 0.5, 1, 0, 2, 1.5, 0, 1.5}

I can generate the histogram using Histogram[data] but how do I set the histogram to generate columns that represent 0, 0.5, 1, 1.5, ... etc with the columns labeled with those values centred underneath each column? Is it possible also to have the x-axis label centred underneath the chart?

Thank you to anyone who can help me out.
 
Mathematics news on Phys.org
You can try something like
Code:
Histogram[data, HistogramCategories -> Range[Min[data], Max[data], 1/2]]
There doesn't seem to be an option to adapt the scale though (I found somewhere the option Ticks -> IntervalCenters, although it gives me errors).
 
Thank you. HistogramCategories and IntervalCenters appears to be in a previous version of Mathematica and not in version 7. If anyone knows what they have been changed to in version 7, I'd appreciate your help!
 
Seemingly by some mathematical coincidence, a hexagon of sides 2,2,7,7, 11, and 11 can be inscribed in a circle of radius 7. The other day I saw a math problem on line, which they said came from a Polish Olympiad, where you compute the length x of the 3rd side which is the same as the radius, so that the sides of length 2,x, and 11 are inscribed on the arc of a semi-circle. The law of cosines applied twice gives the answer for x of exactly 7, but the arithmetic is so complex that the...

Similar threads

Replies
2
Views
2K
Replies
9
Views
3K
Replies
1
Views
2K
Replies
3
Views
2K
Replies
3
Views
3K
Replies
33
Views
2K
Back
Top