Skip to content

scatterhist not working #384

Closed
Closed
@danton267

Description

@danton267

None of these work properly, first 3 examples only plot scatter plot and not the histogram, the last 2 examples yield an error.
reference: https://uk.mathworks.com/help/stats/scatterhist.html

load fisheriris.mat;
x = meas(:,1);
y = meas(:,2);

scatterhist(x,y);
load fisheriris.mat;
x = meas(:,1);
y = meas(:,2);
scatterhist(x,y,'Group',species,'Kernel','on');
load fisheriris.mat;
x = meas(:,1);
y = meas(:,2);
scatterhist(x,y,'Group',species,'Kernel','on','Location','SouthEast',...
    'Direction','out','Color','kbr','LineStyle',{'-','-.',':'},...
    'LineWidth',[2,2,2],'Marker','+od','MarkerSize',[4,5,6]);
load fisheriris.mat;
x = meas(:,1);
y = meas(:,2);

h = scatterhist(x,y,'Group',species);
hold on;
clr = get(h(1),'colororder');
boxplot(h(2),x,species,'orientation','horizontal',...
     'label',{'','',''},'color',clr);
boxplot(h(3),y,species,'orientation','horizontal',...
     'label', {'','',''},'color',clr);
set(h(2:3),'XTickLabel','');
view(h(3),[270,90]);  % Rotate the Y plot
axis(h(1),'auto');  % Sync axes
hold off;
load fisheriris
x = meas(:,1);
y = meas(:,2);
figure
hp1 = uipanel('position',[0 .5 1 .5]);
hp2 = uipanel('position',[0 0 1 .5]);
scatterhist(x,y,'Group',species,'Kernel','on','Parent',hp1);
axes('Parent',hp2);
hist(x);

After it is fixed, please reply with links to chart studio plots, so I can include them in the online documents.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions