Change plot size

So I have to make a picture like this


I have a few questions. How can I change the size when plotting. So far I have this:
Screenshot 2022-01-02 172556
It kinda looks like the brows and the mouth but it’s too big. How can I change that?
Also how can I make an ellipse for the head with this equation: x^2+y^2=1?
And lastly how can I make the axis look like in the smiley face picture? As you can see from the second picture my axis look a bit different. Thanks!
This is my code
x = 0:0.1:2*pi;
y = sin(x);
v = [x(: ) y(:)];
pkg load matgeom;
%drawEllipse([3 0.7 3.25 3.5 0]);
for i = 0:0.0555555556:0.5
plot(x, y+i);
%plot(x + 1.5, y+i);
hold on;
grid on;
axis([-0.5 6.5 -4 4.5], “square”);
endfor

Hi GasiJeGej

Answering to the question about the proportions of the mouth, you can adjust it with axis, when you are ploting the mouth, you must write something like that:

axis([1.6 4.6 -3 -1]);

This will take the plot closer and with the real dimensions.

Answering to the ellipse, take the ecuation of an ellipse:

(y/a)^2 + (x/b)^2 = 1

If you want a ellipse more depth in x than y, you must take ‘b’ bigger than 1 and ‘a’ as 1.
If you want a ellipse depth in y than x, a must be bigger than 1 and b as 1.

% drawing the ellipse for the face
a = 2;
b = 1;
x = linspace(-5,5,1000);
y = b*sqrt(1 - (x/a).^2); % remember that has positive and negative parts

figure(1);
plot(x,y,'b');
hold on;
plot(x,-y,'b'); % negative part
axis([-5 5 -5 5]);

Resolving the final question, it is because the axis are not simetric, let me explain, if you put the horizontal axis from -1 to 1 for example, you must set the vertical axis so if you put it from A to B, B - A must be the same as you did in horizontal axis, in this example -1 -(-1) = 2.
In your example, you have to put axis as ``` axis([0 6 -3 3]) for example.

Regards and enjoy experimenting with octave :slight_smile:

Thanks for your answers. I am still a bit confused about the first question. When I put

axis([1.6 4.6 -3 -1]);

when plotting it just zooms in really close but the figure I plotted remains the same size when I zoom out. I kinda understand what you mean but I need to adjust the size of every component of the smiley’s face and I am not sure how to do it with the axis. I am new to octave so maybe it is right but I don’t understand it yet.

You can try with the calibration tools that octave plot has at the top

you can use Z+ and select a part of area and see the axis to take knowledge about how much axis do you need, also you can use Autoscale if you want to reverse your actions, and Z- to move away.