Matlab:y-label-isn';t显示在小图形窗口中

Matlab:y-label-isn';t显示在小图形窗口中,matlab,size,label,figure,Matlab,Size,Label,Figure,我正在使用以下代码: x = linspace(0, 9, 10); y1 = x; y2 = x.^2; y3 = x.^4; myfig = figure('Position', [500 500 400 320]); %[left, bottom, width, height]: ax1 = gca; hold on p1 = plot(x,y1,'x--r'); p2 = plot(x,y2,'*-b'); xlabel('blaaa'); ylabel('fooo'); xlim

我正在使用以下代码:

x = linspace(0, 9, 10);
y1 = x;
y2 = x.^2;
y3 = x.^4;

myfig = figure('Position', [500 500 400 320]); %[left, bottom, width, height]:
ax1 = gca;
hold on
p1 = plot(x,y1,'x--r');
p2 = plot(x,y2,'*-b');

xlabel('blaaa');
ylabel('fooo'); 
xlim([0 max(x)]);
ax2 = axes('Position',get(ax1,'Position'),...
       'XAxisLocation','top',...
       'YAxisLocation','right',...
       'Color','none',...
       'XTickLabel', [],...
       'XColor','k','YColor','k');
ylabel(ax2, 'asdasd');
linkaxes([ax1 ax2],'x');
hold on
p3 = plot(x,y3,'s:g','Parent',ax2);

legend([p1 p2 p3], {'one', 'two', 'three'}, 'Location', 'NorthWest');
而右y标签未显示:是否有办法通过减小左边缘和左y标签之间的边距或在不调整图形窗口大小的情况下减小实际打印数据的宽度来显示右y标签

谢谢

编辑:添加图像:


减小红色边距或“绿色”大小,因为当蓝色箭头出现时,y标签不再显示,因为它不适合

尝试更换线路:

ax1 = gca;
与:

把钥匙放进去


我不想运行代码。你能添加一个数字吗?@d00b:我添加了一个,提前谢谢!感谢它似乎工作,不知道你可以轻松地设置第一轴!
ax1 = axes('Position',[0.11 0.11 0.75 0.812]);