Skip to content

Commit 91183f1

Browse files
committed
Fixed
Corrected handling of scatterplot (line 808). Corrected bug in case of equal dataset without variation (line 1174).
1 parent 8608b8d commit 91183f1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

cat_plot_boxplot.m

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -805,9 +805,11 @@
805805
y = (ii-offset)*ones(length(data{ii}),1)+jitter_kde; x = data{ii}(:);
806806
end
807807
if opt.usescatter
808-
sc = scatter(x,y,opt.datasymbol,'MarkerEdgeColor',scl*0.3*opt.groupcolor(ii,:),...
808+
sc = scatter(x,y,opt.datasymbol, ...
809+
'MarkerEdgeColor',scl*0.3*opt.groupcolor(ii,:),...
809810
'MarkerFaceColor',scl*0.3*opt.groupcolor(ii,:),...
810-
'MarkerEdgeAlpha',0.1 + 0.9/numel(x).^.3,'MarkerFaceAlpha',0.1 + 0.9/numel(x).^.3);
811+
'MarkerEdgeAlpha',0.05 + 0.25/numel(x).^.3, ...
812+
'MarkerFaceAlpha',0.05 + 0.25/numel(x).^.3);
811813
if opt.datasymbol, sc.SizeData = 12; end % dotlike but with transparency
812814
else
813815
plot(x,y,opt.datasymbol,'Color',[scl*0.3*opt.groupcolor(ii,:)]);
@@ -1169,6 +1171,7 @@
11691171
Range=maximum-minimum;
11701172
MIN=minimum-Range/2; MAX=maximum+Range/2;
11711173
end
1174+
if MIN==MAX, MIN=MIN-1; MAX=MAX+1; end
11721175
% set up the grid over which the density estimate is computed;
11731176
R=MAX-MIN; dx=R/(n-1); xmesh=MIN+[0:dx:R]; N=length(unique(data));
11741177
%bin the data uniformly using the grid defined above;

0 commit comments

Comments
 (0)