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

  • Thread starter Thread starter pergradus
  • Start date Start date
  • Tags Tags
    Figure Plot
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
2 replies · 12K views
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.