Simple plots in R

plot(1,2,xlim=c(0,5),ylim=c(0,5),xlab="x",ylab="y")
points(3,1)
text(1,2,"(1,2)",pos=4, cex=2)
text(3,1,"(3,1)",pos=4, cex=2)

Points on a plane, drawn with R.
Graphing functions in R
\begin{itemize}
\item plot - plots a scatter plot (as a line plot)
\item points - adds points to a plot
\item text - adds text to a plot
\item lines - adds lines to a plot
\end{itemize}
Explanation
The following R commands can be used to generate a plot with two points:

\begin{verbatim}
> plot(1,2,xlim=c(0,5),ylim=c(0,5),xlab="x",ylab="y")
> points(3,1)
> text(1,2,"(1,2)",pos=4, cex=2)
> text(3,1,"(3,1)",pos=4, cex=2)
\end{verbatim}
Examples
\begin{xmpl}

\begin{lstlisting}
plot(2,3)
\end{lstlisting}

gives a single plot and

\begin{lstlisting}
plot(2,3, xlim=c(0,5), ylim=c(0,5))
\end{lstlisting}

gives a single plot but forces both axes to range from 0 to 5.
\end{xmpl}
\begin{xmpl}
The following R commands can be used to generate a plot with two points:

\begin{lstlisting}
plot(1,2,xlim=c(0,5),ylim=c(0,5),xlab="x",ylab="y")
points(3,1)
text(1,2,"(1,2)",pos=4, cex=2)
text(3,1,"(3,1)",pos=4, cex=2)
\end{lstlisting}
\end{xmpl}
\begin{xmpl}


In this example, we plot 3 points. The first two
points are by including vectors with a length of 2 as the x and y
arguments of the plot function. The third plot was added with the
points function. The second and third points were labeled using the
text function and a line was drawn between them using the lines
function. \\
\begin{notes}
Note that if you are unsure of what format the arguments of
an R function needs to be, you can call a help file by typing "?"
before the function name (e.g. "?lines")
\end{notes}

\begin{lstlisting}
plot(c(2,3),c(3,4),xlim=c(2,6),ylim=c(1,5),xlab="x",ylab="y")
points(4,2)
text(3,4,"(3,4)",pos=4, cex=2)
text(4,2,"(4,2)",pos=4, cex=2)
lines(c(3,4), c(4,2))
\end{lstlisting}
\end{xmpl}