Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scatterhist not working #384

Open
danton267 opened this issue Sep 20, 2021 · 0 comments
Open

scatterhist not working #384

danton267 opened this issue Sep 20, 2021 · 0 comments
Assignees

Comments

@danton267
Copy link
Member

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.

@gilbertogalvis gilbertogalvis self-assigned this Sep 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants