From what you've described so far, a bar graph does not seem optimal. What about this approach instead?
in=load('closing_opening.mat')
t=in.closing_opening;
t=reshape(t,2,length(t)/2)'
h=plot(t',ones(size(t))');
set(h,'linewidth',4);
It basically outputs what you showed in your sketch. Change the y-tick to your label of choice. If you want to plot multiple arrays, just make a for loop with a variable y-coordinate.
3 Comments
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/413740-how-do-i-plot-input-output-data-so-as-to-have-a-continuous-bar-in-that-range-and-not-two-simple-po#comment_596973
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/413740-how-do-i-plot-input-output-data-so-as-to-have-a-continuous-bar-in-that-range-and-not-two-simple-po#comment_596973
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/413740-how-do-i-plot-input-output-data-so-as-to-have-a-continuous-bar-in-that-range-and-not-two-simple-po#comment_596981
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/413740-how-do-i-plot-input-output-data-so-as-to-have-a-continuous-bar-in-that-range-and-not-two-simple-po#comment_596981
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/413740-how-do-i-plot-input-output-data-so-as-to-have-a-continuous-bar-in-that-range-and-not-two-simple-po#comment_596994
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/413740-how-do-i-plot-input-output-data-so-as-to-have-a-continuous-bar-in-that-range-and-not-two-simple-po#comment_596994
Sign in to comment.