Borrar filtros
Borrar filtros

Why imagesc always interpolates the data?

13 visualizaciones (últimos 30 días)
Tworit Dash
Tworit Dash el 30 de Abr. de 2021
Comentada: Jonas el 1 de Mayo de 2021
I have a 3D data
x = [-7.500000000000000,-5.625000000000000,-3.750000000000000,-1.875000000000000,0,1.875000000000000,3.750000000000000,5.625000000000000];
y = linspace(0, 359, 360);
z = ones(360, 8);
figure; imagesc(x, y, z); shading interp; colorbar; colormap('jet');
However, in the plot (screenshot attached), the x axis starts before -8 which is undesrible. Why doesn't it stick to the limits given in the array instead? Does it do interpolation? How can I avoid it?
  1 comentario
Jonas
Jonas el 1 de Mayo de 2021
i think your actual problem is that the pixels are centered around the positions you specify. if you want to have n columns exactly between a and b, then the width of each column is width=(b-a)/n and your x positions should be (a+width/2):width:(b-width/2)

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Images en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by