필터 지우기
필터 지우기

Plots Stacking when it is unwanted.

조회 수: 3 (최근 30일)
Lawson Hoover
Lawson Hoover 2012년 12월 6일
When I run my program it works perfectly except when you run it a second time. It stores the last plot saved and then plots the new one created. I want it to erase the old one and only plot the new one. Also I am plot two lines at once. One is the original position of the line and does not move, the other is a moving line. Here is the code:
plot(x,y,'--r','LineWidth',3); % This is the original position of the Beam
hold on % Holds only the axes values
plot(Beam.x,Beam.y,'b','LineWidth',2); % The New position of Beam
xlabel('Beam Length (in.)','Color','g');
ylabel(bstr,'Color','g');
ylim([-max(Beam.y(20)) max(Beam.y)]);
legend('Without Deflection','With Deflection','Location','SouthWest');
title(astr,'Color','y','fontweight','b');
set(S.ax,'YDir','reverse');
set(S.ax,'XGrid','on');
set(S.ax,'YGrid','on');

채택된 답변

Matt Fig
Matt Fig 2012년 12월 6일
Your description of the problem is not clear. Do you want to put a:
hold off
as the last line of this section of code?
  댓글 수: 1
Lawson Hoover
Lawson Hoover 2012년 12월 6일
Yep that is what I needed to do! Thank you!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by