Combining errorbar() and plot() in same figure?

  • Thread starter Thread starter pergradus
  • Start date Start date
  • Tags Tags
    Figure Plot
Click For Summary
SUMMARY

This discussion focuses on combining the errorbar() and plot() functions in MATLAB to display multiple data series in the same figure. Users can utilize the hold function to overlay plots, ensuring that previous plots are retained. For single data series, the default errorbar() function suffices. The conversation also highlights the importance of MATLAB's comprehensive documentation for users unfamiliar with its GUI and graphics handling.

PREREQUISITES
  • Familiarity with MATLAB programming environment
  • Understanding of basic plotting functions in MATLAB
  • Knowledge of the errorbar() function
  • Experience with the hold function in MATLAB
NEXT STEPS
  • Explore MATLAB's errorbar() function documentation for detailed examples
  • Learn how to effectively use the hold function in MATLAB
  • Research best practices for MATLAB GUI development
  • Investigate advanced plotting techniques in MATLAB for multiple data series
USEFUL FOR

Data analysts, engineers, and researchers who need to visualize data in MATLAB, particularly those combining error bars with plots for enhanced data representation.

pergradus
Messages
137
Reaction score
1
I'm having a little trouble figuring out the MatLab GUI stuff... I'm not used to the way MatLab does things.

At this point all I'd like to do is combine an errobar() and a plot() in the same figure, how would I do this?

Thanks!
 
Physics news on Phys.org
If you only have one series of points (x, y, error) then you can use the default errorbar function, as per the examples on the help page below:
http://www.mathworks.com/help/techdoc/ref/errorbar.html

If you have multiple series to plot, you'll probably have to use the hold function (remember to turn it off if you need to replace the plot):
http://www.mathworks.com/help/techdoc/ref/hold.html

As for your other question about getting started in MATLAB GUI, I replied a while ago to another poster facing a similar predicament in a different thread (and some of the advice there may be helpful for you, as well):
https://www.physicsforums.com/showthread.php?t=492673

Don't let it daunt you, and remember that the Mathworks has incredibly complete documentation and tutorials. When MATLABdude is a MATLABdud (which actually happens quite a bit), there's always the Mathworks documentation site (and other posters who didn't actually sign up with a username containing the name of a copyrighted program that they're not affiliated with).
 
MATLABdude said:
If you only have one series of points (x, y, error) then you can use the default errorbar function, as per the examples on the help page below:
http://www.mathworks.com/help/techdoc/ref/errorbar.html

If you have multiple series to plot, you'll probably have to use the hold function (remember to turn it off if you need to replace the plot):
http://www.mathworks.com/help/techdoc/ref/hold.html

As for your other question about getting started in MATLAB GUI, I replied a while ago to another poster facing a similar predicament in a different thread (and some of the advice there may be helpful for you, as well):
https://www.physicsforums.com/showthread.php?t=492673

Don't let it daunt you, and remember that the Mathworks has incredibly complete documentation and tutorials. When MATLABdude is a MATLABdud (which actually happens quite a bit), there's always the Mathworks documentation site (and other posters who didn't actually sign up with a username containing the name of a copyrighted program that they're not affiliated with).

Thanks! The hold function did just the trick. I still find the way MATLAB handles graphics weird... I'm used to the way java does things where everything is an object which you must declare.
 

Similar threads

  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 10 ·
Replies
10
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 10 ·
Replies
10
Views
3K