Datatip content does appear properly using app designer on Combined Line and Bar Chart.

1 回表示 (過去 30 日間)
Hi everyone!
I'm having a problem with my code and I hope someone here can help me. I am creating a Combined Line and Bar Chart and my issue is that using Matlab App designer (Without the designer it works properly) the datatip content does not show up or remind visible for the bar chart when I use the array plot_arr2_not_working, but it works perfectly fine with the first one (plot_arr1_working). I've included my source code, arrays, and two pictures to help explain the problem.
The used arrays:
plot_arr1_working = 1.0e-06 *[0 0.0000 0.0000 0.0038 0.0195 0.0437 0.0706 0.0968 0.1208 0.1420 0.1605 0.1762 0.2004 0.2163 0.2257 0.2298];
plot_arr2_not_working = 1.0e-04 * [0 0.0456 0.1521 0.2693 0.3121 0.3234 0.3217 0.3148 0.3058 0.2963 0.2866 0.2771 0.2589 0.2418 0.2258 0.2109];
bar_values = 1.0e-05 * [0 0.0000 0.0000 0.0005 0.0047 0.0172 0.0401 0.0736 0.1172 0.1699 0.2305 0.2979 0.4491 0.6163 0.7935 0.9761];
x_axis_values = [0 0.5000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 12.0000 14.0000 16.0000 18.0000];
The code:
app.UIAxes = uiaxes(app.GridLayout);
yyaxis(app.UIAxes,'left')
plot(app.UIAxes,x_axis_values,plot_arr2_not_working);
%plot(app.UIAxes,x_axis_values,plot_arr1_working);
yyaxis(app.UIAxes,'right')
bar(app.UIAxes,x_axis_values,bar_values);
using plot_arr1_working:
using plot_arr2_not_working:

採用された回答

Shushant
Shushant 2023 年 2 月 14 日
Hi Máté,
I was able to reproduce the problem you were facing and have made the relevant people aware of the issue. As a workaround for this problem zooming out the figure makes the data tips content appear as shown in the Image below.
  3 件のコメント
Shushant
Shushant 2023 年 2 月 14 日
There is another workaround which I found, If we change the Axes -> Ruler -> YScale to log instead of linear. The Data tips works as intended.
Máté
Máté 2023 年 2 月 16 日
Thank you it works!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDevelop Apps Using App Designer についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by