Effacer les filtres
Effacer les filtres

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

6 vues (au cours des 30 derniers jours)
KFrenkie
KFrenkie le 16 Mai 2016
Commenté : Sterling Baird le 19 Oct 2020
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

Réponse acceptée

Duncan Po
Duncan Po le 17 Mai 2016
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 commentaires
Meet Desai
Meet Desai le 26 Juin 2019
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 le 19 Oct 2020
Make that an argument to your custom plotting function?

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Data Import and Analysis dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by