function plot_vboxplot(x,w,c)

% plot_vboxplot(x,w,c)
%
% x - data vector
% w - [min max], defines the width and also the position on the x-axis
% c - color vector
%
% Description: The script plots a vertical boxplot.
%
% ---------
%
%    Copyright (C) 2012
%    This program is free software: you can redistribute it and/or modify
%    it under the terms of the GNU General Public License as published by
%    the Free Software Foundation, either version 3 of the License, or
%    (at your option) any later version.
%
%    This program is distributed in the hope that it will be useful,
%    but WITHOUT ANY WARRANTY; without even the implied warranty of
%    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
%    GNU General Public License for more details.
%
%    You should have received a copy of the GNU General Public License
%    along with this program.  If not, see <http://www.gnu.org/licenses/>.
%
% -----------------------------------------------------------------------
% B. Herrmann, Email: herrmann.b@gmail.com, 2012-07-28

if nargin < 2, fprintf('Error: Wrong number of inputs!\n'), return; end
if ~isvector(x), fprintf('Error: x needs to be a vector!\n'), return; end
d = prctile(x,[0 25 50 75 100]);

lw = 2;
line([w(1)+(w(2)-w(1))/2 w(1)+(w(2)-w(1))/2],[d(1) d(5)],'LineStyle','--','Color',c,'LineWidth',lw)
line([w(1) w(2)],[d(1) d(1)],'LineStyle','-','Color',c,'LineWidth',lw)
line([w(1) w(2)],[d(5) d(5)],'LineStyle','-','Color',c,'LineWidth',lw)
rectangle('Position',[w(1) d(2) w(2)-w(1) d(4)-d(2)],'FaceColor',[1 1 1],'EdgeColor',c,'LineWidth',lw)
line([w(1) w(2)],[d(3) d(3)],'LineStyle','-','Color',c,'LineWidth',lw)

