How to create 3-D contour plots with filled surfaces?
21 ビュー (過去 30 日間)
古いコメントを表示
Hello,
is it possible to create 3-D isoline plots in Matlab as they are shown in the Application Note 733 (A Filter Primer) from Maxim?
Here are some links to the plots I’m talking about:
- http://www.maximintegrated.com/en/images/appnotes/733/733Fig02b.gif
- http://www.maximintegrated.com/en/images/appnotes/733/733Fig04a.gif
- http://www.maximintegrated.com/en/images/appnotes/733/733Fig06.gif
My problem is that I'm not able to fill the surface between the 3-D isolines. The best result I'm able to get is a plot like this:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/145631/image.png)
[MATLAB]
% Transfer function
H_tf = tf(1,[2 1],'variable','p','TimeUnit','seconds');
[H_tf_Enumerator, H_tf_Denominator] = tfdata(H_tf);
% Grid
omega_Min = -1.0;
omega_Max = 1.5;
sigma_Min = -2.0;
sigma_Max = -0;
sigma_GridVector = linspace(sigma_Min,sigma_Max,40);
omega_GridVector = linspace(omega_Min,omega_Max,40);
[sigma_GridMatrix, omega_GridMatrix] = meshgrid(sigma_GridVector,omega_GridVector);
p_Grid = complex(sigma_GridMatrix,omega_GridMatrix);
% Transfer function values
Response = polyval(H_tf_Enumerator{:}, p_Grid)./polyval(H_tf_Denominator{:}, p_Grid);
Response_dB = 20*log10(abs(Response));
% 3-D plot
hfigure = figure;
view(axes('Parent',hfigure),[120 40]);
grid on;
hold on;
contour3(sigma_GridVector,omega_GridVector,Response_dB,10);
surface(sigma_GridVector,omega_GridVector,Response_dB,'EdgeColor',[0.6 0.6 0.6],'FaceColor','w');
[/MATLAB]
Is there a way to fill the regions between the isolines with a colour? There should be a function like "contour3f".
Best regards Guido
0 件のコメント
回答 (3 件)
Star Strider
2014 年 10 月 7 日
Comment-out your contour3 call and change your surface call to surf with a few changes:
% contour3(sigma_GridVector,omega_GridVector,Response_dB,10);
surf(sigma_GridVector,omega_GridVector,Response_dB)
Is that what you want it to look like?
1 件のコメント
Star Strider
2014 年 10 月 7 日
Add these lines after the surf call:
shading interp
colormap(jet(8))
Marina
2022 年 8 月 31 日
I had the same problem and solved it like this:
hold on
contour3(sigma_GridVector,omega_GridVector,Response_dB,10);
surf(sigma_GridVector,omega_GridVector,Response_dB,'facealpha',0)
Face alpha makes the surf plot transparent.
Marina
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Surface and Mesh Plots についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!