%% Add Row to Data Tips
% Load sample accident data and create a scatter plot. Then add a third row to the default data tips. For the label, use State. For the value source, use the statelabel workspace variable. After you create the new row, add it to the DataTipTemplate property for the Scatter object.

load('accidents.mat','hwydata','statelabel')
s = scatter(hwydata(:,5),hwydata(:,4));
row = dataTipTextRow('State',statelabel);
s.DataTipTemplate.DataTipRows(end+1) = row;

% Create a data tip interactively or by using the datatip function.

dt = datatip(s,11246.7,1493);

% Copyright 2019 The MathWorks, Inc.