MLX file dual Y-axis plot interaction warning

조회 수: 14 (최근 30일)
泽凯
泽凯 2025년 10월 14일
답변: Tridib 2025년 10월 28일 8:45
When I use the code above in mlx file in MATLAB2025b, when I open the figure, I receive the warning
figure;
hold on;
yyaxis left
L3 = plot(Test_data_PCCommand_2.('Time (rel)'),Test_data_PCCommand_2.Var10,'-','LineWidth',2,'Color','blue');
L4 = plot(Test_data_PCCommand_2.('Time (rel)'),Test_data_PCCommand_2.Var12,'--','LineWidth',2,'Color','blue');
L5 = plot(Test_data_PCCommand_2.('Time (rel)'),Test_data_PCCommand_2.Var14,'-','LineWidth',2,'Color','green');
L6 = plot(Test_data_PCCommand_2.('Time (rel)'),Test_data_PCCommand_2.Var16,'--','LineWidth',2,'Color','green');
yyaxis right
L2 = plot(Test_data_PCCommand_2.('Time (rel)'),Test_data_PCCommand_2.Var8,'-','LineWidth',2);
L7 = plot(Test_data_PCCommand_2.('Time (rel)'),Test_data_PCCommand_2.Var18,'--','LineWidth',2);
set(gca,'FontSize',11);
ylabel('转矩加载速率/P/I','fontsize',12,'FontName','宋体');
xlabel('时间','fontsize',12,'FontName','宋体');
legend([L2 L3 L4 L5 L6 L7],{'转矩加载速率','外环P','外环I','内环P×10','内环I×10', '燃油增量限制'},'fontsize',12,'location','northwest','FontName','宋体');
grid on;
box on;
警告: 旧探索模式不支持 InteractionOptions。
> 位置:matlab.graphics.interaction.interactionoptions/CartesianAxesInteractionOptions/warnIfUnsupportedFigure
位置: matlab.graphics.interaction.interactionoptions/CartesianAxesInteractionOptions/updateInteractionOptionsAfterSet
位置: matlab.graphics.interaction.graphicscontrol.AxesControl.updateInteractionOptions
警告: 旧探索模式不支持 InteractionOptions。
> 位置:matlab.graphics.interaction.interactionoptions/CartesianAxesInteractionOptions/warnIfUnsupportedFigure
位置: matlab.graphics.interaction.interactionoptions/CartesianAxesInteractionOptions/updateInteractionOptionsAfterSet
位置: matlab.graphics.interaction.interactioncontainers/BaseAxesInteractionContainer/setupInteractions
位置: matlab.graphics.interaction.internal.UnifiedAxesInteractions.createDefaultInteractionsOnAxes
位置: matlab.graphics.interaction.internal.UnifiedAxesInteractions.createDefaultInteractionsInSync
位置: matlab.graphics.interaction.internal.UnifiedAxesInteractions.createDefaultInteractions>@()matlab.graphics.interaction.internal.UnifiedAxesInteractions.createDefaultInteractionsInSync(ax,is2dim,numDataSpaces)

답변 (1개)

Tridib
Tridib 2025년 10월 28일 8:45
The warning means that the old figure interaction mode does not support the new InteractionOptions for axes. This usually happens if the figure is made in a way that turns off modern interaction features (by using legacy figure properties or callbacks). The warning is just for your information and does not affect how your plot or data looks. Some interactive features, like pan, zoom, or data tips, might not work as expected or could be missing.
You may try these steps which might help avoid the warning:
  • Use the default way to create figures. Just use figure, without any extra properties or callbacks.
  • Try not to use code that sets old figure properties or turns off the default interactions.
  • If you need special interactions, try using the modern interaction methods.
  • When using yyaxis, make sure you are not mixing it with old or outdated plotting functions.
Hope this helps!

카테고리

Help CenterFile Exchange에서 可视化探查에 대해 자세히 알아보기

제품


릴리스

R2025b

Community Treasure Hunt

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

Start Hunting!