# [Maxima] plotting numeric functions

Leo Butler l.butler at ed.ac.uk
Mon May 24 02:28:23 CDT 2010

```
On Mon, 24 May 2010, James Limbouris wrote:

< Hi all,
<
< Something I have had trouble with for quite some time is the plotting of
< numeric functions.
< Say you have a very complicated function f(x), that will go away and not come
< back if you attempt
< to evaluate it symbolically. Maybe its definition contains a bunch of nested
< noun form functions
< for instance. Now say it evaluates instantly as:
<
< f(x), x=3, numer, keepfloat;
<
< But if you try to plot it:
<
< wxplot2d(f(x), [x, 1, 3]), numer;
<
< it will go away and not come back. Now if it were just a numeric function that
< required that its
< arguments be floats, you could fix this by using:
<
< wxplot2d('f(x), [x, 1, 3]), numer;
<
< The quote would suppress evaluation of f(x) until its arguments were
< substituted, and it would work.
< But for hideous analytic functions, I have had no luck with any combination of
< quotes, or hacks of the form:
<
< hack(expression, x) :=
< block(
<     if not numberp(x) then return('hack(expression, x)),
<     return(ev(expression, expand, nouns, numer, keepfloat))
< )\$
<
< or anything else I can think of.
<
< I know you can do discrete plots in 2D, but plot3D has no discretes, and
< draw3d's mesh function gives incorrect axis values.
< Does anyone know a way around this? Can any developers see a why to fix this
< behavior? Any help advice would be much appreciated.
<
< Thanks,
< James

Hi James,
It's difficult to know what your problem really is unless you provide us
with an example. Do you have an example that you could send us?

It is intrinsically a worthwhile exercise in coming up with a 'simplest'
example, too. This often clarifies what the real problem is.

Leo

--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.

```