truncated plot displayed adding the size

4 次查看(过去 30 天)
Hi,
I am trying to set the size of my graph. I simply added at the end of set 'units','points','position',[70,70,750,200], as you can see in the code. Unfortunatlly it appears a truncated plot. How can I see the whole plot with the dimension I settled?
figure('DefaultAxesFontSize',16)
semilogy([45,45],[10^-5,1],'--r')
hold on
semilogy([80,80],[10^-5,1],'--r')
xlabel ('x','FontSize', 18)
ylabel ('y','FontSize', 18)
ylim([10^-4,1])
xlim([30,220])
tickposx = [30 40 50 60 70 80 90 100 110 120 130 140 150 160 170 180 190 200 210 220 ];
tickposy = [ 10^-5 10^-4 10^-3 10^-2 10^-1 1];
grid on
set(gca, 'XTick', tickposx, 'YTick', tickposy,'units','points','position',[70,70,750,200])

采纳的回答

Les Beckham
Les Beckham 2023-2-14
figure('DefaultAxesFontSize',16)
semilogy([45,45],[10^-5,1],'--r')
hold on
semilogy([80,80],[10^-5,1],'--r')
xlabel ('x','FontSize', 18)
ylabel ('y','FontSize', 18)
ylim([10^-4,1])
xlim([30,220])
tickposx = [30 40 50 60 70 80 90 100 110 120 130 140 150 160 170 180 190 200 210 220 ];
tickposy = [ 10^-5 10^-4 10^-3 10^-2 10^-1 1];
grid on
% set(gca, 'XTick', tickposx, 'YTick', tickposy,'units','points','position',[70,70,750,200])
set(gca, 'XTick', tickposx, 'YTick', tickposy)
set(gcf, 'units', 'points', 'position', [70,70,750,200]) %<< Set position of the figure, not the axes

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Annotations 的更多信息

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by