How to set the plot box to particular size

17 views (last 30 days)
Ole
Ole on 24 Sep 2021
Edited: Ole on 24 Sep 2021
How to set the plot box to pixel size.
x = linspace(1,20,100);
y = x.^2;
figure(1)
plot(x,y)
xlabel('X')
ylabel('Y')
The code below will set the figure size. Instead I would like only the plot box without labels to have the size of 200x500.
x0=10;
y0=10;
width = 500;
height = 200;
set(gcf,'position',[x0,y0,width,height])

Answers (0)

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Tags

Products


Release

R2021a

Community Treasure Hunt

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

Start Hunting!