Difference: Bar (1 vs. 2)

Revision 22014-02-18 - KonstantinosPapastergiou

Line: 1 to 1
 
META TOPICPARENT name="MatlabNotes"

bar()

Revision 12012-10-31 - KonstantinosPapastergiou

Line: 1 to 1
Added:
>
>
META TOPICPARENT name="MatlabNotes"

bar()

Need to plot power consumption of a different circuits A-C grouped per year (three years 2010-2012)

Create a vector to hold years (horizontal grouping):

<!-- SyntaxHighlightingPlugin -->
X=[2010 2011 2012];                         % holds years (grouping variable)
<!-- end SyntaxHighlightingPlugin -->

Create three vectors, each will hold the consumption of each converter throughout time:

<!-- SyntaxHighlightingPlugin -->
Y(1,:) = [600 800 1800] ;                   % consumption of three circuits in 2010
Y(2,:) = [680 720 1500] ;                   % consumption of three circuits in 2011
Y(3,:) = [700 600 1400] ;                   % consumption of three circuits in 2012
bar(X,Y) will plot this
<!-- end SyntaxHighlightingPlugin -->

stacked bars

<!-- SyntaxHighlightingPlugin -->
type bar(X,Y,'stacked');
<!-- end SyntaxHighlightingPlugin -->

%COMMENTS%

 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback