[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Axiom-developer] Re: several images on one page

From: Ralf Hemmecke
Subject: [Axiom-developer] Re: several images on one page
Date: Mon, 18 Sep 2006 16:50:41 +0200
User-agent: Thunderbird (X11/20060719)

At various places in the Axiom (Jenks) book there are supposed to
be multiple images on the page. Nothing I tried would place an image where I wanted it. Images "float" and tend to move to the
previous or next page and I'm unable to stop this behavior.

If you're interested take a look at the Jenks book for a page
that contains multiple images and then look at the latex code
in src/doc. See if you can reproduce the multiple image page.

I actually don't see a problem with having multiple pictures on one page.

The biggest problem is that AXIOM does not produce bounding boxes in the .ps file, so one must handcode that in the .tex file. (Which I have tried in the attached file.)

Hope that helps.

% struggle with latex figure-floating behavior

% spadcommands are the actual text that you type at the axiom prompt
{\begin{flushleft}{\tt #1}\end{flushleft}\vskip .1cm }

% spadgraph are the actual text that you type at the axiom prompt for draw
{\begin{flushleft}{\tt #1}\end{flushleft}\vskip .1cm }

% returnType is the type signature returned by the axiom interpreter
{\begin{flushright}{\tt #1}\end{flushright}\vskip .1cm}

% spadsig gives the standard -> notation for signatures
\newcommand{\spadsig}[2]{{\sf #1 $\rightarrow$ #2}}

% The book begins with some introductory material that is not really
% listed as a chapter. This creates a header similar to \chapter.
{\vskip .5in \noindent {\Large{\bf #1}}\vskip .5in}

% The book begins with some introductory material that is not really
% listed as a section. This creates a header similar to \section.
{\vskip .25in \noindent {\large{\bf #1}}\vskip .25in}

% spadofFrom records the operation in the index and the domain in the index
\newcommand{\spadopFrom}[2]{\index{library!operations!#1 @\begingroup 
\string\tt{} #1 \endgroup}\index{#2}``{\tt #1}''}

% spadfunFrom records the function name and domain in the index
\newcommand{\spadfunFrom}[2]{{\bf #1}\index{#1 @\begingroup \string\bf{} #1 

% special meanings for math characters
\newcommand{\N}{\mbox{\bbold N}}
\newcommand{\Natural}{\mbox{\bbold N}}
\newcommand{\Z}{\mbox{\bbold Z}}
\newcommand{\Integer}{\mbox{\bbold Z}}
\newcommand{\Rational}{\mbox{\bbold Q}}
\newcommand{\Q}{\mbox{\bbold Q}}
\newcommand{\Complex}{\mbox{\bbold C}}
\newcommand{\C}{{\mathcal C}}
\newcommand{\Real}{\mbox{\bbold R}}
\newcommand{\F}{{\mathcal F}}
\newcommand{\R}{{\mathcal R}}

% draw a box around a text block

\newcommand{\optArg}[1]{{{\tt [}{#1}{\tt ]}}}
\newcommand{\argDef}[1]{{\tt ({#1})}}
\newcommand{\funSyntax}[2]{{\bf #1}{\tt ({\small\it{#2}})}}
\newcommand{\funArgs}[1]{{\tt ({\small\it {#1}})}\newline}

\newcommand{\condata}[4]{{\bf #1} {\bf #2} {\bf #3} {\bf #4}}

\def\glossaryTerm#1{{\bf #1}\index{#1}}
\def\glossaryTermNoIndex#1{{\bf #1}}
\def\glossarySyntaxTerm#1{{\tt #1}\index{#1}}
\def\csch{\mathop{\rm csch}\nolimits}

\def\erf{\mathop{\rm erf}\nolimits}

  {{\hfill \left. {#1} \right|}
   {\left| {#2} \right. \hfill}

% these bitmaps are used by HyperDoc
\baseLeftSkip=\commentWidth \advance\baseLeftSkip by \colGutterWidth


\section{Two-Dimensional Graphics}

The Axiom two-di\-men\-sion\-al graphics package provides the ability
to \index{graphics!two-dimensional} display
\item curves defined by functions of a single real variable
\item curves defined by parametric equations
\item implicit non-singular curves defined by polynomial equations
\item planar graphs generated from lists of point components.

These graphs can be modified by specifying various options, such as
calculating points in the polar coordinate system or changing the size
of the graph viewport window.

\subsection{Plotting Two-Dimensional Functions of One Variable}

\index{curve!one variable function} The first kind of
two-di\-men\-sion\-al graph is that of a curve defined by a function
$y = f(x)$ over a finite interval of the $x$ axis.

\vskip 0.1cm
The general format for drawing a function defined by a formula $f(x)$ is:
{\tt draw(f(x), x = a..b, {\it options})}

where $a..b$ defines the range of $x$, and where {\it options}
prescribes zero or more options as described in
\ref{ugGraphTwoDOptions} on page~\pageref{ugGraphTwoDOptions}.  An
example of an option is $curveColor == bright red().$ An alternative
format involving functions $f$ and $g$ is also available.\\

A simple way to plot a function is to use a formula.  The first
argument is the formula.  For the second argument, write the name of
the independent variable (here, $x$), followed by an ``{\tt =}'', and the
range of values.

Display this formula over the range $0 \leq x \leq 6$.
Axiom converts your formula to a compiled function so that the
results can be computed quickly and efficiently. 

\spadgraph{draw(sin(tan(x)) - tan(sin(x)),x = 0..6)}
{\rm draw(sin(tan(x)) - tan(sin(x)),x = 0..6)\\}
\vskip 0.2cm
\includegraphics[scale=0.5,bb=0 0 300 300]{ps/}
\caption{$sin(tan(x)) - tan(sin(x))\ \ \ x = 0 \ldots6$}
Notice that Axiom compiled the function before the graph was put
on the screen.

Here is the same graph on a different interval.\\

draw(sin(tan(x)) - tan(sin(x)),x = 10..16)\\
\vskip 0.2cm
\spadgraph{draw(sin(tan(x)) - tan(sin(x)),x = 10..16)}
\includegraphics[scale=0.5,bb=0 0 400 400]{ps/}
\caption{$sin(tan(x)) - tan(sin(x))\ \ \ x = 10 \ldots16$}

Once again the formula is converted to a compiled function before any
points were computed.  If you want to graph the same function on
several intervals, it is a good idea to define the function first so
that the function has to be compiled only once.

This time we first define the function.
\spadcommand{f(x) == (x-1)*(x-2)*(x-3) }
\includegraphics[scale=0.3,bb=0 0 300 300]{ps/}
\returnType{Type: Void}
\includegraphics[scale=0.4,bb=14 14 188 199]{ps/}

To draw the function, the first argument is its name and the second is
just the range with no independent variable.
\spadgraph{draw(f, 0..4) }
% window was 300 x 300
\includegraphics[scale=0.3,bb=0 0 295 295]{ps/}


reply via email to

[Prev in Thread] Current Thread [Next in Thread]