0
votes

I am now having trouble plotting something by matlab.

x1 = 1:2500;
y1 = 1:2500:2500^2;
y2 = 1:2400:2500*2400;

figure
subplot(2,2,1);

semilogy(x1, y1, '-', x1, y2, '-.');
set(gca,'xticklabel',{[]});

pp = subplot(2,2,2);
pospp = get(pp, 'Position');
ax3 = axes('Position',pospp);
ax4 = axes('Position',[0.7 0.7 0.1 0.1]);
axes(ax3);
semilogy(x1, y1, '-', x1, y2, '-.');
set(gca,'xticklabel',{[]});
axes(ax4);
semilogy(2000:2500, y1(2000:2500), '-', 2000:2500, y2(2000:2500), '-.');
set(ax3,'xticklabel',{[]});
set(ax4,'xticklabel',{[]});

Here is the figure

I am wondering how can I remove one y axis from the right subplot? The one with "0, 0.2, 0.4, 0.6, 0.8, 1.0"? I only want to keep the log-scale one.

Thank you.

1
Turn off YTickLabel like you're turning off XTickLabel - excaza
Hello, I tried but not working. - ZZ32

1 Answers

0
votes

In this line:

ax3 = axes('Position',pospp);

you create an extra axes object. Remove this line and the axes will be gone. Use pp instead of ax3.