# MatLab

## Inset figure in MatLab2

This post explains how to plot data in main-inset figure. In inset figure a portion of main figure data is plotted in close-up. Some people referred to it as figure-within-figure or figure-inside-figure. To plot main-inset figure, follow the steps here: Create a handle to main figure Plot the data of […]

## MatLab Startup

At startup time, MATLAB automatically executes the file matlabrc.m . This function establishes the MATLAB path, sets the default figure size, and sets some uicontrol defaults. matlabrc At startup time, MATLAB automatically executes the file matlabrc.m . This function establishes the MATLAB path, sets the default figure size, and sets […]

## PLOTYY : 2-D line plots with y-axes on both left and right side

This section explains how to plot more than two graphs on two y-axes using plotyy function in MATLAB. plotyy(X1,Y1,X2,Y2) plots X1 versus Y1 with y-axis labeling on the left(y1-axis) and plots X2 versus Y2 with y-axis labeling on the right. plotyy(X1,Y1,X2,Y2,’function’) uses the plotting function specified by the string ‘function’ […]

## Label Maximum and Minimum in MatLab Figure

Sometimes it is required to label the minimum and maximum values of a plot in a Matlab figure. The code snippet below demonstrate that functionality, for minimum and maximum values along the y-axis. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 […]

## Legend Settings in MatLab

This post describes how to handle expression and background color of legend box in MatLab figures. We can print LaTex expressions in legend box, by instructing the legend to interpret the following string as latex expression. Create the handle to legend box and set the interpreter option to latex as […]

## Numbering Subplots in MatLab

This post describes how to mark subplots as , , and and give a common title for all subplots. Consider the case where we want to mark subplot(2,2,1) as . The circle around the letter is produced using latex command textcircled{a}. MatLab understands it as a latex command due to […]