www.gusucode.com > symbolic 源码程序 matlab案例代码 > symbolic/ModifyContourPlotAfterCreationExample.m

    %% Modify Contour Plot After Creation
% Plot the contours of $e^{-(x/3)^2-(y/3)^2} + e^{-(x+2)^2-(y+2)^2}$. Specify an output to make
% |fcontour| return the plot object.
syms x y
f = exp(-(x/3)^2-(y/3)^2) + exp(-(x+2)^2-(y+2)^2);
fc = fcontour(f)
%%
% Change the |LineWidth| to |1| and the |LineStyle| to a dashed line
% by using dot notation to set properties of the object |fc|. Visualize contours
% close to |0| and |1| by setting |LevelList| to |[1 0.9 0.8 0.2 0.1]|.
fc.LineStyle = '--';
fc.LineWidth = 1;
fc.LevelList = [1 0.9 0.8 0.2 0.1];
colorbar