필터 지우기
필터 지우기

Splitapply, each data of group in a new figure/plot

조회 수: 6 (최근 30일)
KFrenkie
KFrenkie 2016년 5월 16일
댓글: Sterling Baird 2020년 10월 19일
Hi all,
I am using the function splitapply. However I have problems with plotting each group in another figure (or hide one or more groups).
Currently I am using (attachment with .mat-file):
hold on splitapply(@(difference_mean,difference)plot(difference_mean,difference,'o'),difference_mean,difference,G);
It would be the best to create three seperate figures with each group another figure. Alternatively, create 3 times the same figure and delete the other data.
Can somebody provide me with de solution :)?
Greetings,
Martijn

채택된 답변

Duncan Po
Duncan Po 2016년 5월 17일
You can do it but not with an anonymous function. You need a separate function to pass into splitapply:
function myplot(dm,d)
figure;
plot(dm,d,'o');
Pass this function into splitapply:
splitapply(@myplot,difference_mean,difference,G);
  댓글 수: 4
Meet Desai
Meet Desai 2019년 6월 26일
Is there any way that I can do splitapply and also get different title, name of axes for different graphs?
Thank you.
Sterling Baird
Sterling Baird 2020년 10월 19일
Make that an argument to your custom plotting function?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Import and Analysis에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by