gca
stands for "Get Current Axes", and it is a MATLAB function that returns the handle of the current axes in the current figure. If no axes exists, it creates one.
Here is an example of how to get and modify the properties of the current axes using gca
:
main.m285 chars15 lines
In this example, ax
will be a handle to the current axes. We can then use this handle to modify the axes' properties such as the limits of the x and y axis, the axis labels, and the title.
Note that if you want to set the properties of a specific set of axes, you can also use the axes
function to create or select an axes explicitly, rather than relying on gca
.
gistlibby LogSnag