%% Specifying Categorical and Duration Coordinates
% Define X as a vector of categorical values, and define Y as a vector of duration values. The patch function uses a sorted list of categories, so the x-axis might display them in a different order than you expect. To specify the order, call the reordercats function. Then, create a red patch to visualize the data.

X = categorical({'Freezing','Cold','Warm','Hot','Boiling','Boiling','Freezing'});
X = reordercats(X,{'Freezing','Cold','Warm','Hot','Boiling'});
Y = minutes([0 15 20 47 50 0 0]);
patch(X,Y,'red')

% Copyright 2020 The MathWorks, Inc.