plotyy is not recommended
figure x1 = 0:0.1:40; y1 = 4.*cos(x1)./(x1+2); line(x1,y1,'Color','r') title(' ') % ax1 = gca; % current axes ax1.XColor = 'r'; ax1.YColor = 'r'; ax1_pos = ax1.Position; % position of first axes ax2 = axes('Position',ax1_pos,... 'XAxisLocation','top',... 'YAxisLocation','right',... 'Color','none'); x2 = 1:0.2:20; y2 = x2.^2./x2.^3; line(x2,y2,'Parent',ax2,'Color','k') xlabel('f,') %
clc clear all close all %% , U=[5.5 5.5 5.5 5.2 5.1 5 5 4.8 4.8]; % F=[30 40 50 10000 12000 14000 16000 18000 20000]; % [xi,ni]=find(F==50); K=U/U(ni); % %% figure %% , set(0,'DefaultAxesFontSize',20,'DefaultAxesFontName','Times New Roman'); set(0,'DefaultTextFontSize',20,'DefaultTextFontName','Times New Roman'); %% , ax=get(axes,'Position'); % a=gca; % set(a,'Position',[ax(1) ax(2)+(ax(2)/2) ax(3) ax(4)-ax(4)/10]) % plot(a,log(F),K,'-o'); % xlim(a,[min(log(F)) max(log(F))]) % grid on % BX=get(gca,'XTick'); % x BY=get(gca,'YTick'); % y %% xlabel('','Position',[BX(size(BX,2))+1.1 BY(1)+(BY(1)/100)]) ylabel('K(f)') %% F1=num2str(F,'%0.0i\n'); % ax2=[ax(1) ax(2)-(ax(2)/4) ax(3) 0]; % b=axes('Position',ax2); % xlabel('f, ', 'Position',[BX(size(BX,2))+1.1 BY(1)+(BY(1)/100)]) % xlim(b,[min(log(F)) max(log(F))]) % , xticks(b,log(F)) % xticklabels(b,F1) % xtickangle(90) % ,
ax=get(axes,'Position');
set(a,'Position',[ax(1) ax(2)+(ax(2)/2) ax(3) ax(4)-ax(4)/10])
ax2=[ax(1) ax(2)-(ax(2)/4) ax(3) 0];
BX=get(gca,'XTick'); BY=get(gca,'YTick'); xlabel('','Position',[BX(size(BX,2))+1.1 BY(1)+(BY(1)/100)]) xlabel('f, ', 'Position',[BX(size(BX,2))+1.1 BY(1)+(BY(1)/100)])
Source: https://habr.com/ru/post/350836/
All Articles