필터 지우기
필터 지우기

Plot title keeps rewriting on top in livescript

조회 수: 1 (최근 30일)
Daniel Joseph
Daniel Joseph 2022년 11월 22일
댓글: Daniel Joseph 2022년 11월 22일
Hello,
I have an issue with regards to plots in my livescript. When I execute a section of code multiple times, the plot looks like this
As you can see the title is scuffed, almost like it's been rewritten multiple times on top of each other.
Here's the code:
x=linspace(0,5,100); % Spring displacement [mm]
y=11.58*x.^3 - 96.56*x.^2 + 274.7*x - 0.0276; % Force output (non-linear spring) [N]
fig1=figure(1);
ax5=axes('Parent',fig1)
plot(x,y)
xlabel('Displacement in mm')
ylabel('Force [N]')
title('Disc Spring - Force vs Deflection (w/o preload)')
The title appears normal when I execute this section outside of the live script or if I explictly open a seperate figure window.
However, the screenshot above, is from running and re-running the code multiple times. Any support is appreciated.
Many thanks,
Daniel

채택된 답변

VBBV
VBBV 2022년 11월 22일
close all % add this line at begin
x=linspace(0,5,100);
  댓글 수: 1
Daniel Joseph
Daniel Joseph 2022년 11월 22일
I feel stupid now, such a simple solution. Thanks a lot VBBV.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by