Plotting a best fit curve over a histogram

I combine x,y data to plot on Histogram?In summary, the conversation is about how to plot a line of best fit over a histogram in MATLAB using the curve fit toolbox. The person is struggling to add the best fit line and is seeking help. They then ask about how to plot x,y data on a histogram in Mathematica.
  • #1
matt_crouch
161
1
Im analyzing some data from a previous student I am trying to plot a line of best fit over the histogram and hense find the value of the coefficiants

the files had to be loaded as -ascii so this is the code i have typed so far

x=load('filename.mat','-ascii'); mean(x); hist(x,300)

this then produces the graph how do i add a best fit line to this. I have the curve fit toolbox but don't seem to be able to use this to give me a plausable best fit. I am using Matlab 2010

any help would be appreciated
:)
 
Physics news on Phys.org
  • #2
How to plot for x,y data on Histogram in Mathematica

hey, How to plot for x,y data on Histogram in Mathematica?
I saw The Histogram function is just ploting y data,
 

1. What is a best fit curve and why is it useful?

A best fit curve is a line or curve that is drawn on a graph to represent the general trend of the data points. It is useful because it allows us to see the overall pattern of the data and make predictions about future values.

2. How do you determine the best fit curve for a histogram?

The best fit curve for a histogram is determined by finding the line or curve that comes closest to touching all of the data points. This can be done visually by drawing a line or curve that appears to fit the data well, or mathematically using methods such as linear regression or polynomial regression.

3. What types of data are best suited for a best fit curve over a histogram?

A best fit curve is most useful for continuous data, such as measurements of length or weight, that can be plotted on a histogram. It is less useful for discrete data, such as counts or categories, which are better represented with a bar graph.

4. Can a best fit curve be used to make predictions about the data?

Yes, a best fit curve can be used to make predictions about future values of the data. However, it is important to note that these predictions are only as accurate as the data and the method used to determine the best fit curve.

5. Are there any limitations to using a best fit curve over a histogram?

Yes, there are limitations to using a best fit curve over a histogram. One limitation is that it may not accurately represent the data if there are outliers or if the data is not normally distributed. Additionally, the choice of method used to determine the best fit curve can also affect the accuracy of the curve.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
9
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
12
Views
5K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
14
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
3K
  • Set Theory, Logic, Probability, Statistics
Replies
3
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
8K
Replies
16
Views
2K
Back
Top