Annotating Graphs & Plots
A tutorial for adding annotations to a graph. The following is a brief listing of the commands.
- text and gtext are the commands for
putting text anywhere inside a plot or graph. The gtext
command allows one to use the mouse to click on the location
where one wants to place the text.
- xlabel and ylabel controls the labelling
of the x and y axes of the plot.
- title controls the heading of the plot
- legend controls the plot legend
You can also input greek symbols and some other miscellaneous
symbols by using the TeX control characters .
The list of available TeX characters is here .
For example, consider the following sequence of commands
x = 1:100
y=x.^1.5.*(log2(x).^3)
plot(x,y, x,1.1*y-x)
gtext('This is the plot of the function y = x^{3/2}log_{2}^3 x')
gtext('If we now let x = \alpha + \pi \times \delta - \omega^2')
gtext('Here \omega is minimum \rightarrow \bullet')
xlabel('Bananas in quantity of \omega tons')
ylabel('Frequency')
The output is then as follow