Interpolate data to present with limited size of data
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Miraboreasu
am 2 Nov. 2022
Bearbeitet: William Rose
am 2 Nov. 2022
Suppose I only have 35 data points, it is very expensive to run.
x=rand(5,7)
figure
imagesc(x)
axisx=[11 12 13 14 15 16 17]
axisy=[10 20 30 40 50]
Is there any way to present them smoother, using imagesc gives too pixel. Is there any interpolation?
and display the axis with my axisx and axisy
1 Kommentar
Akzeptierte Antwort
Davide Masiello
am 2 Nov. 2022
x=rand(5,7)
figure
contourf(x,'LineColor','none')
shading interp
axis equal off
4 Kommentare
Davide Masiello
am 2 Nov. 2022
Bearbeitet: Davide Masiello
am 2 Nov. 2022
axisx = [11 12 13 14 15 16 17];
axisy = [10 20 30 40 50];
[x,y] = meshgrid(axisx,axisy);
z = rand(5,7);
[x_new,y_new] = meshgrid(linspace(axisx(1),axisx(end),100),linspace(axisy(1),axisy(end),100));
z_new = interp2(x,y,z,x_new,y_new);
contourf(x_new,y_new,z_new,linspace(min(z(:)),max(z(:)),100),'LineColor','none')
shading interp
colorbar
xlabel('x axis')
ylabel('y axis')
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!