# Two Dimensional Graphs Drawing In MatLab(Illustrated Expression)

Two dimensional graphs are frequently used in data analysis. Also you could have to draw two dimensional graphs in Matlab with various variables. In this article, we will explain how to draw two dimensional graphs in Matlab.

### How To Draw Two Dimensional Graphs In Matlab?

To draw 2D graphs, you need to have 2 variables needed to be created in Matlab. For example we created a complex number in Matlab to show you how to create two dimensional graphs.

The command to create two dimensitonal graphs in Matlab is ‘plot()’ as shown in magenta box above in Matlab. You need to type the variables inside the plot(a, b) command then also you can add a pointer like above which is added as ‘o’. This pointer shows the location of complex number ‘a’ as shown by arrow above.

With ‘xlabel()’ command, you can define the name of x label of two dimensional graph that you create in Matlab. You need to type the name of the x label inside the xlabel() code as ‘name of the label x’.

Also you can do the same thing for y label of drawn graph with ‘ylabel()’ command as shown above in Matlab.

With ‘title()’ command, you can add a expressive title to your two dimensional graph in Matlab. Use of this code is same with xlabel() and ylabel() commands.

You can define the boundries of axes aith axis() command as above. For example we type dthe boundry values of x and y axes inside the axis() command as [x x y y] which is start and end value of x axis and start and end value of y axis respectively.

Also we wanted to arrange our graph in square shape in Matlab, then we simply typed ‘axis square’ as shown above.

Also you can do;

• axis equal: Automatically arranges the axes equally.
• axis normal: Arranges axes as rectangular shape of graph.

The most basic two dimensional graph creation in Matlab can be expressed like this. Also we can publish much more complex examples about two dimensional axis creation in Matlab if you wish.