File:  [LON-CAPA] / loncom / html / adm / help / tex / Authoring_Dynamic_Plot_Gnuplot.tex
Revision 1.9: download - view: text, annotated - select for diffs
Mon Sep 9 20:59:44 2013 UTC (10 years, 10 months ago) by raeburn
Branches: MAIN
CVS tags: version_2_12_X, version_2_11_X, version_2_11_5, version_2_11_4_uiuc, version_2_11_4_msu, version_2_11_4, version_2_11_3_uiuc, version_2_11_3_msu, version_2_11_3, version_2_11_2_uiuc, version_2_11_2_msu, version_2_11_2_educog, version_2_11_2, version_2_11_1, version_2_11_0_RC3, version_2_11_0_RC2, version_2_11_0, HEAD
- Section titles in double quotes.

\label{Authoring_Dynamic_Plot_Gnuplot}

\index{gnuplot}\index{plot}\index{dynamic plot}
The \textbf{gnuplot} LON-CAPA tag allows an author to design a plot which will be
created programatically at the time when it is requested for display by a student. 
This is intended for use in homework problems where a distinct plot should be 
rendered for each student.  It can be used in conjunction with a 
\textbf{script} tag to generate curve data for random plots.
If you are using
static data a dynamically generated plot is not appropriate because of
the overhead associated with generating the plot. In that case, use a
picture (see ``Adding Picture'' section \ref{Authoring_Adding_Pictures}).

The easiset way to create a template for a gnuplot tag is to use the colorful 
problem editor, and select \textbf{GnuPlot} from the \textbf{Insert} dropdown menu. 
Thereafter the boxes may be filled using this documentation to assist you. By default, only
the parent \textbf{gnuplot} tag and the child \textbf{curve} tag are created by 
when the plot is inserted into a problem using the colorful editor. Other tags can be 
added to decorate and polish your plot using the \textbf{Insert:} dropdown 
provided by the colorful editor.

The following \textbf{gnuplot} parameters may be set:

\begin{itemize}
\item \texttt{brief description of the plot} 
This text is used as the \texttt{alt} value of the \texttt{img} tag 
used to display the plot on a web page.

\item \texttt{background color of image (xffffff)}
See the ``Color Selection'' section \ref{Authoring_Dynamic_Plot_Color_Selection}
for help on specifying colors.

\item \texttt{foreground color of image (x000000)} 
See the ``Color Selection'' section \ref{Authoring_Dynamic_Plot_Color_Selection}
for help on specifying colors.

\item \texttt{height of image (pixels)}

\item \texttt{width of image (pixels)}

\item \texttt{Size of font to use} ``small'', ``medium'', or ``large''.  
The font used for any text on the plot is set with this tag.

\item \texttt{Transparent image} ``Yes'' or ``No''.  
If the image is transparent the background color will be ignored.

\item \texttt{Display grid} ``Yes'' or ``No''.  

\item \texttt{Number of samples for non-data plots}  If a \textbf{function} tag is used
(see ``Plotting Functions'' section \ref{Authoring_Dynamic_Plot_Curve_Function}) to specify the
\textbf{curve} (see ``Specifying Curves to Plot'' section \ref{Authoring_Dynamic_Plot_Curve}), 
this indicates the number of sample points to use.

\item \texttt{Draw border around plot} ``Yes'' or ``No''

\item \texttt{alignment for image in html} ``Left'', ``Center'', or ``Right''.
This is the value used for the \texttt{align} parameter in the \texttt{img} 
tag which embeds the plot in the problem.

\item \texttt{Width of plot when printed (mm)} The width in mm of the plot when
it is printed.  The default is approximately one half of a U.S. letter size 
page, 93 mm.

\item \texttt{Font size to use in TeX output (pts)} The size in points of text
on the graph when it is printed out.

\item \texttt{Plot type} ``Cartesian'' or ``Polar''.  

\item \texttt{margin width (pts)} The left, right, top, or bottom margin width
measured in points.

\item \texttt{Size of major tic marks} The size of the larger tic marks on the
plot border or axes, measured in graph units.

\item \texttt{Size of minor tic marks} The size of the smaller tic marks on the
plot border or axes, measured in graph units.

\end{itemize}

The parent \texttt{gnuplot} tag allows use of the following child tags 
(only the \textbf{curve} tag is added automatically when inserting with the colorful
editor):

\begin{itemize}
\item \textbf{curve} (see ``Specifying Curves to Plot'' section \ref{Authoring_Dynamic_Plot_Curve})
\item \textbf{title}, \textbf{xlabel}, and \textbf{ylabel} (see ``Plot Labels and Key'' section 
\ref{Authoring_Dynamic_Plot_Title_X_Y_Label})
\item \textbf{key}   (see ``Plot Labels and Key'' section \ref{Authoring_Dynamic_Plot_Key})
\item \textbf{label} (see ``Plot Labels and Key'' section \ref{Authoring_Dynamic_Plot_Label}) 
\item \textbf{axes}  (see ``Plot Axes Details'' section \ref{Authoring_Dynamic_Plot_Axes})
\item \textbf{tics}  (see ``Plot Axes Details'' section \ref{Authoring_Dynamic_Plot_Tics})
\end{itemize}


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>