Error Bars Graphs Matlab
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers http://stackoverflow.com/questions/7879449/how-to-plot-an-error-bar-plot-with-standard-deviation-values-in-matlab or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x http://vip.cs.utsa.edu/classes/cs1173/cs1173s2011/lessons/Lesson12ErrorBars/Lesson12ErrorBars.html Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up How to plot an error bar plot with standard deviation values in MATLAB? up vote 5 down vote favorite I am very new to MATLAB and expect a step-by-step solution. I have data, series(y), error bars which I have to plot against (x). Also I have the standard deviation values for each data point of (y). Now I have to plot these series highlighting the error bars. How can I do that? The data is in a text file sorted in columns as: X = -50, -49, -48, -47....0....1, 2, 3, 4, 5....till 50 Y = 1.2, 1.0, 1.1, 1.9, 1.3..... Standard deviation = 0.6, 0.5, 0.3, 0.6, 0.6..... Also, how do I control the ticks matlab plot error and appearance property for these kinds of graphs? matlab plot share|improve this question edited Dec 14 '12 at 18:42 Peter Mortensen 10.2k1369107 asked Oct 24 '11 at 17:32 user1011350 26113 3 As a side note: For saving/exporting figures, check out the excellent export_fig from FileExchange. It saves nice looking figures by default, without having to tweak a bunch of the figure properties yourself. –John Colby Oct 24 '11 at 17:58 add a comment| 1 Answer 1 active oldest votes up vote 9 down vote x = 1:0.1:10; y = sin(x); e = 0.1 * randn(length(x), 1); errorbar(x,y,e) set(gca, 'Xlim', [4 10]) set(gca, 'XTick', 4:2:10) See also get(gca) and get(gcf) for other properties to change. For help on any of these functions, do, for example, help errorbar. share|improve this answer answered Oct 24 '11 at 17:47 John Colby 13.7k23556 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Facebook Sign up using Email and Password Post as a guest Name Email Post as a guest Name Email discard By posting your answer, you agree to the privacy policy and terms of service. Not the answer you're looking for? Browse other questions tagged matlab plot or ask your own question. asked 4 years ago viewed 40473 times active 1 year ago Linked 0 add error bar to a plot matlab 1 How to plot a sc
measurements. Display error bars on different types of charts. ContentsDATA FOR THIS LESSONSETUP FOR LESSON 12EXAMPLE 1: Load the Fisher iris data (comes with MATLAB)EXAMPLE 2: Compute the mean and standard deviation of the sepal lengths for 3 speciesEXAMPLE 3: Plot mean sepal length using standard deviation (SD) error barsEXAMPLE 4: Plot the SD error bars on a bar chartEXAMPLE 5: Compute the standard error of the mean (SEM) for sepal lengthsEXAMPLE 6: Plot mean sepal length using (SEM) error barsEXAMPLE 7: Plot SD and SEM error bars on the same graphEXAMPLE 8: Compute the median and inter quartile range (IQR) for sepal lengthsEXAMPLE 9: Plot median sepal length using the inter quartile range (IQR) for error barsEXAMPLE 10: Calculate the means and standard deviations of all characteristicsEXAMPLE 11: Draw a grouped bar chart of mean iris characteristicsEXAMPLE 12: Plot the means of all characteristics using SD error barsEXAMPLE 13: Plot the means of all characteristics using connected SD error barsSUMMARY OF SYNTAX DATA FOR THIS LESSON File Description fisheriris This data set contains the famous Fisher iris data set. The data set consists of measurements of 150 flower samples from each of three species of flowers: Iris setosa, Iris virginica, and Iris versicolor. The measurements are in mm. Four features were measured for each sample: The length of the flower sepal The width of the flower sepal The length of the flower petal The width of the flower petal All 150 samples from the Fisher iris data are stored in a single table called meas: The four columns correspond to the four types of measurements: sepal length, sepal width, petal length and petal width, respectively. The first 50 rows contain data for Iris setosa The second 50 rows contain data for Iris virginica The third 50 rows contain data for Iris versicolor. The species information is kept in a separate vector called species. The data is sometimes referred to as Anderson's Iris data in honor of Edgar Anderson, the biologist who collected the data. See http://en.wikipedia.org/wiki/Iris_flower_data_set for additional information. Note: This dataset comes with the MATLAB distribution so you don't have to download it separately. SETUP FOR LESSON 12Set the Current Directory to Z:\working\MATLAB\Lesson12. (You will need to make a new directory for Lesson12.)Create a new script called Lesson12Script.