Matlab matrix bar graph with errors

In summary, the conversation is about a MATLAB graph with a bar chart containing two sets of data in matrix form. The problem is that when adding error bars, they appear in the middle of the two sets of data. The person is looking for a way to make the error bars appear over the actual bars. The code they have tried so far is also included.
  • #1
Toni103
12
0
As in the title I have a MATLAB graph. Its a bar chart with two sets of data done in matrix form. When I try and put in error bars the way I'm used to they both go on but in the middle of the two sets of data. Any way I can make them appear over the actual bars? Any help greatly appreciated!

The code I have so far is:

close all
clear;
clc

Under = [ 5.46, 2.02, 1.17];
Outside = [7.23, 3.99, 3.2];

E = [1.162, 1.162, 1.162];

data = [Under; Outside];

Matrix = (data');

%size (Matrix)

figure (1);
bar(Matrix); hold on
errorbar(Under ,E, 'ks');
errorbar(Outside, E, 'ks');

ylabel('SNR');
xlabel('Layers of tape');
title('Optimised Settings');
 
Physics news on Phys.org
  • #2
mistake post
 

1. What is a matrix bar graph in Matlab?

A matrix bar graph in Matlab is a visual representation of data using rectangular bars of varying lengths. Each bar represents a specific data point or category, and the height of the bar corresponds to the value of that data point. A matrix bar graph can also include error bars, which show the variability or uncertainty in the data.

2. How do I create a matrix bar graph in Matlab?

To create a matrix bar graph in Matlab, you can use the "bar" function. This function takes in two arguments: the data points to be plotted, and the optional error values. You can also customize the appearance of the graph by changing the color, width, and spacing of the bars.

3. How do I add error bars to a matrix bar graph in Matlab?

To add error bars to a matrix bar graph in Matlab, you can use the "errorbar" function. This function takes in three arguments: the data points, the error values, and the bar widths. You can also customize the appearance of the error bars by changing the color, width, and style.

4. Can I create a stacked matrix bar graph in Matlab?

Yes, you can create a stacked matrix bar graph in Matlab by using the "bar" function with two matrices as input. The first matrix will determine the height of the first bar, and the second matrix will determine the height of the second bar stacked on top of the first one. You can also add error bars to each bar in the stacked graph.

5. How do I interpret a matrix bar graph with errors in Matlab?

In a matrix bar graph with errors in Matlab, the height of the bar represents the mean or central tendency of the data, while the error bars show the variability or uncertainty around that mean. If the error bars for two bars do not overlap, it indicates that there is a significant difference between the two data points. If the error bars overlap, it suggests that the difference between the two data points is not significant.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
8K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
5K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
9
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
7K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
Back
Top