Need help with Scatter and colorbar,

10 visualizaciones (últimos 30 días)
Ale
Ale el 22 de Jun. de 2017
Respondida: Zahra Sharifnezhadazizi el 9 de En. de 2019
Hi! Why is the colorbar unavailable for variable z in a scatter plot?
z are values from 1000 to 4000, and I want a colorbar from those values (matrix 513x1) I've trying with a imagesc(z), get the colorbar and use it; also, I tried with hsv2rgb, etc... but I can't...

Respuestas (2)

Walter Roberson
Walter Roberson el 23 de Jun. de 2017
Editada: Walter Roberson el 23 de Jun. de 2017
x = randi(25,1,10); y = randi(25,1,10); z = randi([1000,4000],1,10);
scatter(x,y,30,z) %30 is point size
colorbar
works fine for me.

Zahra Sharifnezhadazizi
Zahra Sharifnezhadazizi el 9 de En. de 2019
bins=200;
n = hist3(St,[bins bins]); % Extract histogram data;
% % % default to 10x10 bins
n1 = n';
n1( size(n,1) + 1 ,size(n,2) + 1 ) = 0;
% Generate grid for 2-D projected view of intensities:
% n = EE-EE3;
% n1=n';
xb = linspace(min(dat(:,1)),max(dat(:,1)),size(n,1)+1);
yb = linspace(min(dat(:,2)),max(dat(:,2)),size(n,1)+1);
%Make a pseudocolor plot:
n1(n1<3)=nan;
imagesc(xb,yb,n1); axis xy

Categorías

Más información sobre Colormaps 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!

Translated by