MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   资料存档 (https://www.labfans.com/bbs/forumdisplay.php?f=72)
-   -   在uitab上创建具有多个轴的图。在Matlab中使用addaxis (https://www.labfans.com/bbs/showthread.php?t=22435)

poster 2019-12-05 22:40

在uitab上创建具有多个轴的图。在Matlab中使用addaxis
 
我创建了一个选项卡式面板,在该面板中我想创建一个具有多个轴的图。为此,我正在使用[URL="https://de.mathworks.com/matlabcentral/fileexchange/9016-addaxis"]https://de.mathworks.com/matlabcentral/fileexchange/9016-addaxis中的[/URL] “ addaxis”。

我的代码:

obj.plot=axes('Parent', obj.tab, 'Position',[0.05, 0.15 , 0.92, 0.83], 'Units', 'normalized'); x = 0:.1:4*pi; plot(x,sin(x)); addaxis(x,sin(x-pi/3)); addaxis(x,sin(x-pi/2),[-2 5],'linewidth',2); addaxis(x,sin(x-pi/1.5),[-2 2],'v-','linewidth',2); addaxis(x,5.3*sin(x-pi/1.3),':','linewidth',2); addaxislabel(1,'one'); addaxislabel(2,'two'); addaxislabel(3,'three'); addaxislabel(4,'four'); addaxislabel(5,'five'); addaxisplot(x,sin(x-pi/2.3)+2,3,'--','linewidth',2); addaxisplot(x,sin(x-pi/1),5,'--','linewidth',2); legend('one','two','three','four','five','three-2','five-2'); 但是当我执行代码时,轴丢失了。创建图形时:

figure() x = 0:.1:4*pi; plot(x,sin(x)); addaxis(x,sin(x-pi/3)); addaxis(x,sin(x-pi/2),[-2 5],'linewidth',2); addaxis(x,sin(x-pi/1.5),[-2 2],'v-','linewidth',2); addaxis(x,5.3*sin(x-pi/1.3),':','linewidth',2); addaxislabel(1,'one'); addaxislabel(2,'two'); addaxislabel(3,'three'); addaxislabel(4,'four'); addaxislabel(5,'five'); addaxisplot(x,sin(x-pi/2.3)+2,3,'--','linewidth',2); addaxisplot(x,sin(x-pi/1),5,'--','linewidth',2); legend('one','two','three','four','five','three-2','five-2'); 一切顺利。

我添加了两个屏幕截图。

[URL="https://i.stack.imgur.com/pO3Qs.png"][IMG]https://i.stack.imgur.com/pO3Qs.png[/IMG][/URL]

[URL="https://i.stack.imgur.com/Q8nxZ.png"][IMG]https://i.stack.imgur.com/Q8nxZ.png[/IMG][/URL]



[url=https://stackoverflow.com/q/59197218]更多&回答...[/url]


所有时间均为北京时间。现在的时间是 23:37

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.