truncated plot displayed adding the size

4 views (last 30 days)
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])

Accepted Answer

Les Beckham
Les Beckham on 14 Feb 2023
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

More Answers (0)

Tags

Products

Community Treasure Hunt

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

Start Hunting!