Smoothing filled contours by interpolation
11 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
The following code creates and labels (including a colorbar) a figure showing filled contours for a 30 x 30 matrix called 'stab', made up of values between 0.0 and 2.1 in steps of 0.3.
I'm trying to figure out how to smooth the contours by interpolation: 30 steps in each dimension leads to pretty chunky contour lines.
Struggling to figure out how to create an interpolation grid and the relevant interpolation values.
Before asking a question like this I'd normally have at least had a go myself, but after reading every page and help file I can on this I just have no clue how to get started.
Any and all help gratefully received.
hold on;
colormap(winter);
cl = [0.0:0.3:2.1];
[C,h] = contourf(stab,cl);
axis xy;
% Relabel axes to fix scale
set(gca,'XTick',0:5:30)
set(gca,'XTickLabel',[0:.5:3.0])
set(gca,'YTick',0:5:30)
set(gca,'YTickLabel',[-1:.5:2])
% Label axes (could add units later)
xlabel ('q','Fontsize',16);
ylabel ('a','Fontsize',16);
% Label graph
title ('Stability Regions of Damped Matheiu Equation for b=0 to b=2.1','Fontsize',14);
hcb = colorbar;
set(hcb,'YTick',[0.0:0.3:2.1]);
hold off;
0 commentaires
Réponses (0)
Voir également
Catégories
En savoir plus sur Contour Plots dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!