- create multiple (possibly overlapping) axes and use a different colormap for each; or
- convert all-but-one of the graphic objects to use RGB instead of mapped colors; or
- convert all of the graphics objects to use RGB; or
- convert the graphics objects to be different kinds of graphics objects that can use RGB
Apply different colormaps to different data sets on histogram2
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
histogram2(x, y, xedges, yedges, 'normalization', 'probability', 'DisplayStyle','tile', 'FaceColor','flat')
hold on
histogram2(x2, y2, xedges, yedges, 'normalization', 'probability', 'DisplayStyle','tile', 'FaceColor','flat')
hold off
colormap summer
colorbar

Here, I have two different datasets with the histogram2 function, but I'm not sure how to apply different colormaps to each of them.
0 comentarios
Respuestas (1)
Walter Roberson
el 21 de Abr. de 2023
Editada: Walter Roberson
el 21 de Abr. de 2023
MATLAB permits one colormap per axes .
If you need more than one colormap then you have a couple of choices:
There is a useful File Exchange contribution freezecolors that can convert objects to RGB -- though it might not have caught up to some of the newer graphics objects.
Looking at Histogram2 objects, it does not look to me as if they can be converted directly to RGB. But you appear to be viewing from above -- which is a situation where you can create arrays of values and use imagesc() or pcolor() as long as you do not need to permit the user to dynamically change the histogram properties.
0 comentarios
Ver también
Categorías
Más información sobre Color and Styling 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!