"Brad Stiritz" <
sorry.no...@info.net> wrote in message
news:l3q8h2$lb1$1...@newscl01ah.mathworks.com...
> Steve,
>
> I'm wondering if you possibly might have misunderstood what the original
> poster was asking about?
Entirely possible. That's why I asked if they meant SCATTER. If you asked
someone non-technical (like my mother) to describe a scatter plot, she would
probably call it a dot plot or something similar; I didn't think that it was
a "technical term."
> Please Google or look up Wikipedia "dot plot". Dot plots are not typical
> scatter plots, but rather histogram-like displays with stacked dots (or
> circles) rather than vertical bars.
So that's the Wilkinson dot plot?
> It looks like MATLAB may not support dot plots out-of-the-box..?
I'm not sure. I'm not as familiar with the plot types Statistics Toolbox
provides as I am with the ones MATLAB provides. I think SCATTER is still the
right plotting tool to use; generating the Y coordinate data for each of the
"dots" is the tricky part. I whipped up something quick; I'm sure there's
room for improvement and enhancement (accepting S and C inputs that are
passed through to the SCATTER call, for instance.)
function h = dotplot(y)
% Generate a Wilkinson dot plot as per the description:
%
%
http://en.wikipedia.org/wiki/Dot_plot_%28statistics%29
%
% Example:
% y = randi([5 15], 1, 100);
% h = dotplot(y);
if isempty(y)
error('CSSM:dotplot:EmptyY', 'Y cannot be empty.');
end
uy = unique(y);
r = zeros(size(y));
upperLimit = 0;
for k = 1:length(uy)
x = y == uy(k);
r(x) = 1:nnz(x);
upperLimit = max(upperLimit, nnz(x));
end
h = scatter(y, r);
% Give the dot plot some room so the dots aren't displayed on the axes box
axis([min(uy)-1, max(uy)+1, 0, upperLimit+1]);
--
Steve Lord
sl...@mathworks.com