how to do pcolor plots from 3d data?
Afficher commentaires plus anciens
Hi all,
I have a data set of the type
x=100;
y=100;
z=100;
r = randi([1 5],x,y,z);
I would like to plot a contourplot from pcolor or contourf (2D data from r in z=60) which colors only all number 1's (like r(:,:,60)=1) with red color, in z=60. The other numbers are represented by the transparent pixels.
I tested
f = figure(1);
pcolor(r(:,:,60)==1);
shading interp;
hcb=colorbar;
But does not work. Can anybody help me?
Thank you so much in advance.
Réponse acceptée
Plus de réponses (1)
KSSV
le 16 Jan 2022
0 votes
This is a 3D data, read about slice.
Catégories
En savoir plus sur Creating, Deleting, and Querying Graphics Objects dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!









