Effacer les filtres
Effacer les filtres

truncated plot displayed adding the size

5 vues (au cours des 30 derniers jours)
SYML2nd
SYML2nd le 14 Fév 2023
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])

Réponse acceptée

Les Beckham
Les Beckham le 14 Fév 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

Plus de réponses (0)

Tags

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by