Question: This is a MATLAB terminology question on the Parent application in Matlab. Often I use `axes1 = axes(‘Parent’, figure1)` in my plotting, because I have memorized the plotting steps. Yet I don’t even understand why I use this line. 

I understand we have parent and children objects in Matlab graphics. However I thought parent objects only pertain to the figure and all other graphical objects are below. What does the Parent mean we applied as: `axes1 = axes(‘Parent’, figure1).`

Answer: 
`Parent` is a property of an `axes` object or many other graphical objects in MATLAB, which stores the handle of the object's parent.

The syntax you are using to create an `axes` object is an overload of `axes()`:

> 
> `axes(Name,Value)` modifies the axes appearance or controls the way data displays using one or more name-value pair arguments. For example, 'FontSize',14 sets the font size for the axes text.
> 
> 
> 

*Ref: <https://uk.mathworks.com/help/matlab/ref/axes.html?s_tid=doc_ta>*

Therefore, `axes1 = axes('Parent', figure1)` creates an `axes` object and assigns `figure1` to its `Parent` property. By doing this, the `axes` is placed inside `figure1`.

This is necessary when you have multiple `figure` window and wish to add the `axes` to the specific `figure` that isn't topmost. For example:

```
figure1 = figure;
figure2 = figure;

% Now you have two figure windows and you only want to add an axes to figure1.
% Note that figure2 is the topmost figure since it is created at a later time.
axes1 = axes('Parent', figure1);

```

If you only have one figure window or the figure window needs a new axes is topmost, you can simple type `axes`. For example:

```
figure1 = figure;
figure2 = figure;

% add a new axes to figure2.
axes1 = axes;

```

---

**A bit more about the syntax**

Such syntax is not uncommon in MATLAB. For example:

```
figure('Color',[0 0 0], ....
              'Position', [0 0 100 100]);

scatter(x,y,'MarkerEdgeColor',[0 .5 .5],...
              'MarkerFaceColor',[0 .7 .7],...
              'LineWidth',1.5);

```
That's right, your understanding is correct. The line:

```
axes1 = axes(‘Parent’, figure1)

```

creates a sets of axes under the variable `axes1` and specifies that the parent object fot this set of axes is the graphical object under the variable `figure1`, which is probably a figure as your correctly guessed.

Explicitly specifying which figure is the parents of of which axes object can be useful when you are creating and dealing with multiple figures/axes at the same time, so that you know which one is which.