axtoolbar tooltips not working for uifigure with tiledlayout

조회 수: 23 (최근 30일)
CM
CM 2025년 9월 19일
댓글: dpb 2025년 10월 26일 13:20
The tooltips do not work for the following code, but if I use axtoolbar(plotHandle, ...) instead of axtoolbar(tileHandle, ...), they do. It also works if I use figure instead of uifigure.
f = uifigure('HandleVisibility', 'on');
tileHandle = tiledlayout(f, 1, 1);
plotHandle = nexttile(tileHandle);
line = plot(plotHandle, [0 1], [0 1]);
tb = axtoolbar(tileHandle, {'export', 'datacursor', 'pan', 'zoomin', 'zoomout', 'restoreview'});
I have also tried specifying the tooltips for each button explicitly. That does not work either.
  댓글 수: 2
CM
CM 2025년 10월 25일 5:51
편집: CM 2025년 10월 25일 5:53
Mathworks has acknowledged this as a bug and will hopefully get it fixed in a later release, however I need a workaround for the current release as there are other issues preventing me from using more recent versions.
Another bug, probably related: if you add a legend and then axtoolbar, the zoom stops working.
f = uifigure('HandleVisibility', 'on');
tileHandle = tiledlayout(f, 1, 1);
h = nexttile(tileHandle, 1);
line = plot(h, [0 1], [0 1], 'DisplayName', 'this legend triggers the error after call to axtoolbar on zoom button press');
lHandle = legend(h);
tb = axtoolbar(tileHandle, {'export', 'datacursor', 'pan', 'zoomin', 'zoomout', 'restoreview'});
If I hit the zoom button after this, I get this error:
Warning: Invalid argument at position 1. Value must be of type
matlab.graphics.axis.AbstractAxes or be convertible to
matlab.graphics.axis.AbstractAxes.
Error while evaluating ValueChangedFcn for axes toolbar.
dpb
dpb 2025년 10월 26일 13:20
I doubt there will be workarounds for internal callback issues since they're Mathworks-supplied.
The only chance I would see would be it you could somehow catch the error in the callback if it were in m-code but I'd expect being able to figure out how to do something about it would be tough even if could.

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

답변 (1개)

dpb
dpb 2025년 9월 19일
이동: dpb 2025년 9월 19일
Hadn't ever looked, but the same behavior exists as far back as R2021b as well.
Mayhaps somebody w/ new release can confirm whether has been fixed more recently or not.
Submit this to Mathworks as an official support request/bug at <Product Support Page>

카테고리

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

제품


릴리스

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by