how to specify filling properties in gscatter?
17 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Zhe Dong
el 30 de Mzo. de 2024
Comentada: Voss
el 30 de Mzo. de 2024
I'm trying to make a group scatter plot using gscatter function, there are two contrast groups each has three subgroups, is there a way I can seperate two contrast groups by filling or not filling the markers' interiors? here's a group example, how can I set female group with marker face filled while the male group is not?
group = {'female1','female2','femaler','male1','male2','male3'};
0 comentarios
Respuesta aceptada
Voss
el 30 de Mzo. de 2024
Editada: Voss
el 30 de Mzo. de 2024
You can modify the required markers after calling gscatter. Here's an example:
% random data for 6 groups
N = 100;
Ngroups = 6;
x = rand(N,1);
y = rand(N,1);
g = randi(Ngroups,N,1);
% make the gscatter plot with filled markers
h = gscatter(x,y,g,[],'o','filled')
% make the markers for 3 of the groups un-filled
fill_idx = [1 2 3];
set(h(fill_idx),'MarkerFaceColor','none')
2 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Scatter Plots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!