how to clear axes in live edition
조회 수: 2 (최근 30일)
이전 댓글 표시
i use the function axes in the first section, and plot a figure like this:
semilogx(wout,20*log10(mag)); % plot bode for RC circuit with x-axis has log scale
xlabel('Normalized angular frequency [rads/sec]');
ylabel('Magnitude [dB]');
title('Bode plot for RC circuit: R=1kΩ , C=1μF');
grid on % show grid
figure
axes('Position', [0.45 0.2 0.4 0.4]);
semilogx(w_zoom,zoom_y_lim);
grid on;
x = [0.52 0.65]; % add an arrow
y = [0.86 0.625];
annotation('textarrow',x,y);
hold off;
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/808734/image.png)
however, when i cerate another section and plot a figure, it will shows like that:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/808739/image.png)
I just want the figure on the lower right corner, i think the reason of this problem is using axes, could u please tell me how to fix it
댓글 수: 0
답변 (1개)
Cris LaPierre
2021년 12월 29일
The live editor keeps using the same axes unless told otherwise. Here, your new plot is being added to the current axes, which is the last axes you plotted to (the smaller inset graph).
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Axis Labels에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!