Simple Histogram using Mathematica - please

  • Context: Mathematica 
  • Thread starter Thread starter AaronMartin
  • Start date Start date
  • Tags Tags
    Histogram Mathematica
Click For Summary
SUMMARY

The discussion centers on generating a simple histogram in Mathematica v7 using the provided dataset. The user successfully creates a histogram with the command Histogram[data] but seeks guidance on customizing the x-axis to display specific tick marks (0, 0.5, 1, 1.5, etc.) and centering the labels beneath the columns. The suggested solution involves using Histogram[data, HistogramCategories -> Range[Min[data], Max[data], 1/2]], but the user encounters issues with the Ticks -> IntervalCenters option, which is not compatible with version 7. The discussion highlights the limitations of Mathematica v7 regarding histogram customization.

PREREQUISITES
  • Familiarity with Mathematica v7 syntax and functions
  • Understanding of histogram data visualization concepts
  • Basic knowledge of data manipulation in Mathematica
  • Awareness of version-specific features and limitations in Mathematica
NEXT STEPS
  • Explore advanced histogram customization in Mathematica v8 and later versions
  • Learn about the Ticks option in Mathematica for axis labeling
  • Investigate data visualization techniques in Mathematica beyond histograms
  • Review Mathematica documentation for version-specific changes in plotting functions
USEFUL FOR

This discussion is beneficial for data analysts, statisticians, and Mathematica users looking to enhance their data visualization skills, particularly those working with version 7 and seeking to create customized histograms.

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

Similar threads

  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 18 ·
Replies
18
Views
5K
  • · Replies 1 ·
Replies
1
Views
7K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 2 ·
Replies
2
Views
5K
  • · Replies 19 ·
Replies
19
Views
3K