yyaxis not working in app designer.

조회 수: 8 (최근 30일)
David Levesque
David Levesque 2019년 11월 7일
편집: Adam Danz 2020년 4월 8일
Hi, I'm trying to plot a line on both the left and right side of a UIAxes in App Designer with the command yyaxis(myAxes, 'left'). I stripped down the problem to its most simple expression, a single figure with a UIAxes in it.
yyaxis.png
When I click on the graph I get that error:
Warning: Error occurred while executing the listener callback for event WindowMousePress defined for class
matlab.ui.Figure:
Unrecognized method, property, or field 'processFigureHitObject' for class 'matlab.ui.control.UIAxes'.
Error in matlab.graphics.internal.YYAxisEventManager
Error in matlab.graphics.internal.YYAxisEventManager
The code in the startupFcn is:
yyaxis(app.UIAxes, 'left');
x = pi:0.1:3*pi;
y = sin(x);
plot(app.UIAxes,x,y);
I use Matlab R2019b.
Anyone got an idea?
  댓글 수: 4
Adam Danz
Adam Danz 2019년 11월 8일
편집: Adam Danz 2019년 11월 15일
Tested in r2019b on my end and it threw the same warning (not an error). I didn't have more time to look into it.
The warning occurs when you click on an object within the UIAxis but not when you click on the axis background itself.
Adam Danz
Adam Danz 2019년 11월 15일
Mark Gerber 's answer moved here as a comment.
I am experiencing similar problems.

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

채택된 답변

Adam Danz
Adam Danz 2019년 11월 15일
편집: Adam Danz 2020년 4월 8일
The problem (r2019b)
A warning is thrown when clicking on UIAxis objects that were plotted with yyaxis. To recreate the problem:
% (in r2019b)
fh = uifigure();
uia = uiaxes(fh);
yyaxis(uia, 'left');
plot(uia,rand(1,5),'-o');
yyaxis(uia, 'right');
plot(uia,rand(1,5),'-o');
% Now, click on the x or y axes or any of the line objects
Temporary work-around
This has been reported to Tech Support (case #03884386) and hopefully will be addressed in future releases. If the warning is bothersome, you can suppress it (and any other warnings caused by a callback error) by executing this line of code before or immediately after the yyaxis plot is created.
% in app designer, this can go in your startupFcn
warning('off','MATLAB:callback:error')
to turn the warning back on (which you should do)
% in app designer, this can go in your UIFigureCloseRequest function
% otherwise, it should be a part of your figure's CloseRequestFcn
warning('on','MATLAB:callback:error')
Update: The bug is no longer a problem in r2020a.
  댓글 수: 2
Nils
Nils 2020년 4월 8일
I am facing the same problem when clicking on the UIAxes containing a yyaxis in my App using R2019b (Update 5) only that my App does not respond to any click afterwards and the command window does not respond either. I am using a timerclass object that updates an animated line in the UIAxes which works without using yyaxis but also showing the abovementioned warning from time to time. My guess is that the continuous timer execution results in the lack of response. I could circumvent the issue by using disableDefaultInteractivity(ax).
Are there any news concerning a bug fix? I could not find any bug report online.
Adam Danz
Adam Danz 2020년 4월 8일
"Are there any news concerning a bug fix? "
Yes, I just tested it in 2020a and the bug seems to be gone. If you can upgrade, that would be the easiest solution.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Specifying Target for Graphics Output에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by