필터 지우기
필터 지우기

Problems with figures generated by the compiled App

조회 수: 3 (최근 30일)
RITAM BASU
RITAM BASU 2023년 1월 8일
댓글: Sulaymon Eshkabilov 2023년 1월 13일
I am facing a peculiar problem with the compiled version of my Matlab App.
The App generates some characteristic curves based on the motor selected. Now, the figure has four axis. When I make the plots for the first time in the app by clicking a button, the color of one axis is coming wrong (as purple, should be green). When I click the same button for the 2nd time, the new figure gets its color corrected. Now, the underlying script is the same for both clicks. And this issue does not occur in the uncompiled version at all. The colors are coded like this,
co = get(groot,'defaultAxesColorOrder');
I have shared the both pictures.
Can someone make any sense of this? I am kinda clueless as to what might be the issue.
Have a nice day ahead.

채택된 답변

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2023년 1월 8일
This type of issues happen, when "hold all" or "hold on" is being used in the code.
The solution is to use "hold off":
...
plot(x, y),
hold all
plot(x, f),
hold off
Or
...
clf
plot(x, y),
hold all
plot(x, f)
  댓글 수: 2
RITAM BASU
RITAM BASU 2023년 1월 13일
It is a good guess... My scripts had hold all, hold on functions without the hold off. However, the problem did not go away even after I implemented "hold off".
Actually, the script uses the "addaxis" scipts from the file exchange . "https://www.mathworks.com/matlabcentral/fileexchange/9016-addaxis"
In addition, the main scripts shuffles the color order. I believe it is creating the problem with the compiled App. I could not find the exact root cause. Instead, used a cheap trick to bypass this issue..
%%% to solve the purple color axis bug in the deployed app
color_check = hplts.Color ;
if isdeployed && isequal(color_check,[0.4940,0.1840,0.5560]) % purple
hplts.Color = [0.4660,0.6740,0.1880]; % green
end
Anyway, thanks for your suggestion. have a nice day.
Sulaymon Eshkabilov
Sulaymon Eshkabilov 2023년 1월 13일
Most welcome.

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

추가 답변 (0개)

카테고리

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

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by