%% Visualize Categorical and Numeric Data
% Use a scatter plot with marginal histograms to visualize categorical and numeric medical data.
% Load the patients data set, and convert the Smoker data to a categorical array. Then, create a scatter histogram chart that compares patients' Age values to their smoker status. The resulting scatter plot contains overlapping data points. However, the y-axis marginal histogram indicates that there are far more nonsmokers than smokers in the data set.

load patients
Smoker = categorical(Smoker);
s = scatterhistogram(Age,Smoker);
xlabel('Age')
ylabel('Smoker')

% Copyright 2018 The MathWorks, Inc.