Changing interval in Histogram, Mathematica

In summary, the conversation is about changing the bin number and interval in a histogram created in Mathematica. The solution is to use the command "Histogram[{x1, x2, ...}, w]" to specify the bin width. This is documented in both Mathematica Help and Wolfram's website.
  • #1
SrEstroncio
62
0
Hello again. Sorry for all the posts.

I have a histogram of frequencies in Mathematica and the intervals on the x-axis are predefined and kind of unrepresentative. I changed the bin number (with 'Histogram[mydata, binnumber]') but I can't seem to find anything on the internet about changing the interval(example, my chart starts at 0 and ends at 2, it shows intervals of 0.5, when I want them to be about 0.1 or so). Help!
 
Physics news on Phys.org
  • #2
IF you have version 7 your MMA Help documents this OR Wolfram documents this:
http://reference.wolfram.com/mathematica/ref/Histogram.html

Histogram[{x1, x2, ...}, w]
plots a histogram with bin width specification w.

If you have an older version then the answer is somewhat different but you can still find this documented by searching your MMA Help documents or Wolfram's site.
 

Related to Changing interval in Histogram, Mathematica

1. How do I change the interval in a histogram in Mathematica?

To change the interval in a histogram in Mathematica, you can use the "DataRange" option in the Histogram function. This allows you to specify the range of values to be included in the histogram.

2. Can I change the interval to be logarithmic in a histogram?

Yes, you can use the "ScalingFunctions" option in the Histogram function and specify a logarithmic scaling function such as "Log" or "Log10". This will create a histogram with a logarithmic interval.

3. How do I adjust the number of bins in a histogram?

You can use the "BinCounts" option in the Histogram function to specify the number of bins you want in the histogram. Alternatively, you can use the "BinWidth" option to specify the width of each bin and let Mathematica automatically determine the number of bins.

4. Can I customize the appearance of the bins in the histogram?

Yes, you can use the "BinStyle" option to specify the style of each bin, such as color or shape. You can also use the "ChartStyle" option to customize the overall appearance of the histogram.

5. How do I add labels and axes to the histogram?

You can use the "AxesLabel" option to add labels to the x and y axes of the histogram. Additionally, you can use the "PlotLabel" option to add a title to the histogram. You can also use the "Frame" option to add a frame around the histogram.

Similar threads

  • High Energy, Nuclear, Particle Physics
Replies
9
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
9
Views
6K
  • Set Theory, Logic, Probability, Statistics
Replies
3
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
12
Views
3K
Replies
2
Views
5K
  • Set Theory, Logic, Probability, Statistics
Replies
18
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
3K
  • Programming and Computer Science
Replies
1
Views
5K
  • Advanced Physics Homework Help
Replies
3
Views
2K
Back
Top