I want to increase the width of the x axis of a plot.
Changing set(gcf, 'Position', [100, 100, 650, 650]) just increases the size of the window of the figure, not the plot's width. I do not want to change the height, just the width.
How can I do this?
Thank you in advance!

2 Kommentare

KSSV
KSSV am 22 Feb. 2022
set(gca,'linewidth',6)
ABCDEFG HIJKLMN
ABCDEFG HIJKLMN am 22 Feb. 2022
This increases the thickness of the lines, I just want to increase the length of the axis.

Melden Sie sich an, um zu kommentieren.

 Akzeptierte Antwort

ABCDEFG HIJKLMN
ABCDEFG HIJKLMN am 22 Feb. 2022

0 Stimmen

I have figured it out, I had to add set(gca,'FontSize',12,'DataAspectRatio',[1 1.75 1]) for it to work.
Thank you for the help.

Weitere Antworten (1)

Ive J
Ive J am 22 Feb. 2022

0 Stimmen

You need to set gca and not gcf:
set(gca, 'Position', ...)

1 Kommentar

ABCDEFG HIJKLMN
ABCDEFG HIJKLMN am 22 Feb. 2022
Hello, thank you for your answer. I tried setting this, but the figure just comes out completely blank. What could be causing this? I assured that the size of the axes was smaller than the size of the figure...

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Hilfe-Center und File Exchange

Produkte

Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by