필터 지우기
필터 지우기

How to hold on with visible off for plots

조회 수: 2 (최근 30일)
ubaid haroon
ubaid haroon 2017년 12월 27일
댓글: dpb 2017년 12월 27일
I am running a loop iloop = 1:23 and plotting data 23 times on a scatter plot. This job is currently running on a cluster so I can't have the gui open and I have set figure('Visible','off'). When I use this with 'hold on' only the last iteration of loop is plotted. How can I keep my figure visible but still retain the hold for 1:23?
  댓글 수: 5
ubaid haroon
ubaid haroon 2017년 12월 27일
I was able to make this work by running multiple loops for each plot i was making.
dpb
dpb 2017년 12월 27일
More than likely your problems stem from the following code snippet...
for i = 1:23
..........
fig1 = figure('name','NameOfFigure','Visible','off')
The above creates 23 different figures but uses the same variable has the handle for each. And, each call to scatter will thus plot into a new gca which will be the axes object of the lastest figure created. And, subsequently, when you use fig1 as the handle to the figure, you get only the last one; you've overwritten the variable for the previous 22 that are still there, just not visible.

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

답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by