Table of Contents

Module: utils Gnuplot/
Utility functions used by Gnuplot.

This module contains utility functions used by which aren't particularly gnuplot-related.

Imported modules   
import Numeric
import string
float_array ( m )

Return the argument as a Numeric array of type at least Float32.

Leave Float64 unchanged, but upcast all other types to Float32. Allow also for the possibility that the argument is a python native type that can be converted to a Numeric array using Numeric.asarray(), but in that case don't worry about downcasting to single-precision float.

write_array (
        item_sep=' ',

Write an array of arbitrary dimension to a file.

A general recursive array writer. The last four parameters allow a great deal of freedom in choosing the output format of the array. The defaults for those parameters give output that is gnuplot-readable. But using (",", "{", "}", ", ") would output an array in a format that Mathematica could read. item_sep should not contain % (or if it does, it should be escaped to %%) since it is put into a format string.

The default 2-d file organization:

        set[0,0] set[0,1] ...
        set[1,0] set[1,1] ...

The 3-d format:

        set[0,0,0] set[0,0,1] ...
        set[0,1,0] set[0,1,1] ...

        set[1,0,0] set[1,0,1] ...
        set[1,1,0] set[1,1,1] ...

Table of Contents

This document was automatically generated on Sun Oct 19 17:10:22 2003 by HappyDoc version 2.1