yyaxis not working in app designer.
Show older comments
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.

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 Comments
Ankit
on 8 Nov 2019
Following code works for me in 2018b. Have you tried including the right axis and still you face the same problem?
function startFcn_Callback(app)
yyaxis(app.UIAxes, 'left');
x = pi:0.1:3*pi;
y = sin(x);
plot(app.UIAxes,x,y);
yyaxis(app.UIAxes,'right');
x = pi:0.1:3*pi;
y = cos(x);
plot(app.UIAxes,x,y);
end
David Levesque
on 8 Nov 2019
Adam Danz
on 15 Nov 2019
Mark Gerber 's answer moved here as a comment.
I am experiencing similar problems.
Accepted Answer
More Answers (0)
Categories
Find more on Develop Apps Using App Designer in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!