gnuplot-py-1.8/0000755000076400007640000000000011006707732013013 5ustar alfordalfordgnuplot-py-1.8/.happydoc.__init__.py0000644000076400007640000000121311006707250017000 0ustar alfordalford(S'38573b487aff902e949cb66f64c00639' p1 (ihappydoclib.parseinfo.moduleinfo ModuleInfo p2 (dp3 S'_namespaces' p4 ((dp5 (dp6 tp7 sS'_import_info' p8 (ihappydoclib.parseinfo.imports ImportInfo p9 (dp10 S'_named_imports' p11 (dp12 sS'_straight_imports' p13 (lp14 sbsS'_filename' p15 S'Gnuplot/__init__.py' p16 sS'_docstring' p17 S'' sS'_name' p18 S'__init__' p19 sS'_parent' p20 NsS'_comment_info' p21 (dp22 sS'_configuration_values' p23 (dp24 S'include_comments' p25 I1 sS'cacheFilePrefix' p26 S'.happydoc.' p27 sS'useCache' p28 I1 sS'docStringFormat' p29 S'StructuredText' p30 ssS'_class_info' p31 g5 sS'_function_info' p32 g6 sS'_comments' p33 S'' sbt.gnuplot-py-1.8/doc/0000755000076400007640000000000011006707732013560 5ustar alfordalfordgnuplot-py-1.8/doc/Gnuplot/0000755000076400007640000000000011006707732015210 5ustar alfordalfordgnuplot-py-1.8/doc/Gnuplot/gp_mac.html0000644000076400007640000000741011006707252017323 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Gnuplot/gp_mac.py

Gnuplot / gp_mac.py 

Functions   
  test_persist 
test_persist ()

Mac doesn't recognize persist.

Classes   

_GNUPLOT

GnuplotOpts

GnuplotProcess


This document was automatically generated Fri May 2 16:59:06 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/test.html0000644000076400007640000000753311006707252017062 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Gnuplot/test.py

Gnuplot / test.py 

Functions   
  main 
main ()
  wait 
wait ( str=None,  prompt=None )
Classes   

This document was automatically generated Fri May 2 16:59:06 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/README.html0000644000076400007640000002364711006707252017044 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Gnuplot/README.txt

Gnuplot / README.txt 

Gnuplot.py
A pipe-based interface to the gnuplot plotting program.

The Gnuplot.py home page is

http://gnuplot-py.sourceforge.net

There you can get the latest version, view the documentation, or report bugs. There is also a mailing list for Gnuplot.py users. You can subscribe to the mailing list or view the archive of old articles at

http://lists.sourceforge.net/mailman/listinfo/gnuplot-py-users

Documentation -------------

The quickest way to learn how to use Gnuplot.py is to install it and run the simple demonstration by typing `python demo.py', then look at the demo.py file to see the commands that created the demo. One of the examples is probably similar to what you want to do.

Don't forget to read the Gnuplot.html, README.txt, and FAQ.txt files in the Gnuplot.py distribution.

HTML documentation for the Python classes is included in the doc/ directory of the distribution and is also available online (follow links from the home page). This documentation is extracted automatically from the package's docstrings using happydoc and should be helpful though it is known to have some formatting problems. Alternatively, you can look at the docstrings yourself by opening the python files in an editor.

Finally, there is a new mailing list for Gnuplot.py users. For more information about subscribing to the list or viewing the archive of old articles, please go to

http://lists.sourceforge.net/lists/listinfo/gnuplot-py-users

To get good use out of Gnuplot.py, you will want to know something about gnuplot, for which a good source is the gnuplot help (run gnuplot then type `help', or read it online at

http://www.gnuplot.info/gnuplot.html

).

For a relatively thorough test of Gnuplot.py, type `python test.py' which goes systematically through most Gnuplot.py features.

Installation ------------

Quick instructions:

  1. Download gnuplot-py-1.8.tar.gz or gnuplot-py-1.8.zip.
  2. Extract the archive to a temporary directory.
  3. Install by changing to the directory and typing "python setup.py install".

More information:

Obviously, you must have the gnuplot program if Gnuplot.py is to be of any use to you. Gnuplot can be obtained via . You also need a copy of the numpy package, which is available from the Scipy group at .

Gnuplot.py uses Python distutils and can be installed by untarring the package, changing into the top-level directory, and typing "python setup.py install". The Gnuplot.py package is pure Python--no compilation is necessary.

Gnuplot.py is structured as a python package. That means that it installs itself as a subdirectory called `Gnuplot' under a directory of your python path (usually site-packages). If you don't want to use distutils you can just move the main Gnuplot.py directory there and rename it to "Gnuplot".

There are some configuration options that can be set near the top of the platform-dependent files gp-unix.py (Unix), gp_mac.py (Macintosh), gp_macosx.py (Mac OS X), gp_win32.py (Windows), and gp_java.py (Jython/Java). (Obviously, you should change the file corresponding to your platform.) See the extensive comments in gp_unix.py for a description of the meaning of each configuration variable. Sensible values are already chosen, so it is quite possible that you don't have to change anything.

Import the main part of the package into your python programs using `import Gnuplot'. Some other features can be found in the modules Gnuplot.funcutils and Gnuplot.PlotItems.

Installation via RPM (for Linux/Unix) -------------------------------------

I decided that it doesn't make sense to package up RPM versions of Gnuplot.py, since the place where the files need to be installed depends on what version of Python you are using. But if you want the benefits of RPM management, it's easy for you to create your own RPM from the source distribution then install the RPM:

  1. Change into the source directory.
  2. Create the RPM:

    $ python ./setup.py bdist --format=rpm

  3. Install it (as root):

    # rpm -ivh dist/gnuplot-py-1.7-1.noarch.rpm

Installation on Windows -----------------------

I don't run Windows, but thanks to the help of users there is now a way to use Gnuplot.py on that platform. Any feedback or additional suggestions having to do with Windows would be especially appreciated.

Because the main MS-Windows gnuplot executable (wgnuplot.exe) doesn't accept commands on standard input, Gnuplot.py cannot communicate with it directly. However, there is a simple little program called `pgnuplot.exe' that accepts commands on stdin and passes them to wgnuplot. So to run Gnuplot.py on Windows, you need to make sure that pgnuplot.exe is installed. It comes with gnuplot since at least version 3.7.1. Alternatively you can get pgnuplot.exe alone by downloading `testing/windows-stdin.zip' from one of the gnuplot archives (e.g., ).

Continue installing Gnuplot.py by following the instructions in the previous section.

Installation on the Macintosh -----------------------------

Thanks to more user help, Gnuplot.py should work on the Macintosh too. (Here I am referring to Mac OS versions prior to OS X; OS X is unix so no special considerations apply there.)

Since pipes don't exist on the Mac, communication with gnuplot is via a python module called gnuplot_Suites.py (included) which uses AppleEvents. Note that you will have to convert the python files to Mac text files (different end-of-line character). Currently it is not possible to print directly to a printer; however, it should be possible to print to a postscript file and print that file manually. Also, inline data does not seem to be supported. Let me know if you find other problems or have patches to fix Mac limitations.

Assistance ----------

If you are having trouble installing or using Gnuplot.py, please check the following sources for help:

  1. Read the documentation! For simple questions, start with the Gnuplot.html, README.txt, and FAQ.txt files in the distribution. For more detailed information, check the online class documentation at

    http://gnuplot-py.sourceforge.net/doc/

  2. Check the mailing list archives. Chances are that somebody has already asked a similar questions and you are one quick search away from the answer. Information about the mailing list is available at

    http://lists.sourceforge.net/mailman/listinfo/gnuplot-py-users

  3. Ask your question on the mailing list. I am trying to move most email traffic about Gnuplot.py to the mailing list, partly because there are many questions (for example about Windows or Macintosh platforms) that I am completely unable to answer. The mailing list also provides an archive of old articles which should build up into a valuable resource, and a place to exchange ideas about future changes.

Feedback --------

I would love to have feedback from people letting me know whether they find Gnuplot.py useful. And certainly let me know about any problems, suggestions, or enhancements. For most purposes, please send your emails to the Gnuplot.py users mailing list:

gnuplot-py-users@lists.sourceforge.net

Information about the mailing list can be obtained at

http://lists.sourceforge.net/mailman/listinfo/gnuplot-py-users

Compatibility -------------

Gnuplot.py has been tested with version 3.7 of gnuplot, and I believe it should work with version 3.5 (though some features, like enhanced postscript mode and binary splot mode, will not work). Let me know if you have trouble.

Gnuplot.py was developed under Linux and Digital Unix; it should work without much problem on other versions of Unix. If you need to modify it for your system tell me what was necessary and I'll include your changes in a future release.

Gnuplot.py should also work under Windows and Macintosh (see above). Feedback for these platforms is especially appreciated since I can't test them myself.

License -------

See the file LICENSE.txt for license info. In brief, Gnuplot is LGPL.

Credits -------

See CREDITS.txt for a list of people who have contributed code and/or ideas to Gnuplot.py. Thanks especially to Konrad Hinsen , who wrote the first, procedural interface version of Gnuplot.py.

-- Michael Haggerty (But please use the mailing list for Gnuplot.py-related issues.)


This document was automatically generated Fri May 2 16:59:06 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/FAQ.html0000644000076400007640000001610611006707252016506 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Gnuplot/FAQ.txt

Gnuplot / FAQ.txt 

# $Id: FAQ.txt 294 2006-11-07 02:33:08Z parejkoj $

Frequently Asked Questions

This file is meant to answer the most frequently asked questions about the Gnuplot.py package. If you want to suggest additional questions (with or without answers!) please mail them to the Gnuplot.py users mailing list, .

======================================================================

Q1:

When running the following script

------------------------------------------------ #! /usr/bin/python2

import Gnuplot, Gnuplot.funcutils from numpy import *

g = Gnuplot.Gnuplot() g.plot([[0,1.1], [1,5.8], [2,3.3], [3,4.2]]) ------------------------------------------------

I get the error

gnuplot> plot /tmp/@24463.2 ^ can't read data file "/tmp/@24463.2" line 0: (No such file or directory)

However, the same commands work fine if I type them into the interpreter! What's wrong?

A1:

The problem is that in many cases Gnuplot.py sends data to gnuplot via a temporary file. But Gnuplot.py has no way of knowing when it is safe to delete the temporary file. So it deletes it when the corresponding PlotItem object is deleted, which is typically when the next Gnuplot.plot() command is executed or when the python script ends. (Until you plot something else, the Gnuplot object keeps a reference to all of the old plot items to prevent their being garbage collected.)

To prevent this problem, there are several possibilities:

  1. Switch to Unix. On that platform, Gnuplot.py now uses FIFOs (named pipes) by default to send data to gnuplot. This seems to provide a robust and somewhat elegant solution to this problem.
  2. Use "inline data" instead of temporary files to communicate with gnuplot. This is already available in gnuplot for most plotting modes if you specify the "inline=1" option to the constructor of the Data object, or if you set GnuplotOpts.prefer_inline_data=1. Since inline data doesn't involve temporary files, the problem goes away.
  3. Introduce a delay between the time you plot and the time you allow the Data object to be deleted. You could just use time.sleep(), or if you are producing a graphics file you might watch for the creation of the output file and at that point assume that gnuplot is done with the temporary file. One idea is to explicitly create a PlotItem to represent the data, and keep a reference to the PlotItem for some time after the plot() command is executed; e.g.,

    data = Gnuplot.Data([[0,1.1], [1,5.8], [2,3.3], [3,4.2]]) g.plot(data) # ... do something guaranteed to last a couple seconds del data # temporary file is deleted at this moment

  4. Change Gnuplot.py itself to implement two-way communication between gnuplot and Gnuplot.py. Then, for example, Gnuplot.py could delete temporary files when the next gnuplot prompt appears. This would be a lot of work but it would allow other new features such as detecting gnuplot errors, reading gnuplot fit command output back to python, etc.

======================================================================

Q2:

Does Gnuplot.py work under Jython/Java?

A2:

Partly. Version 1.7 added the low-level interface gp_java.py for communicating with gnuplot using the Java libraries, and that part seems to work.

However, Gnuplot.py relies on the Python Numeric library, which is a C library. The Jython equivalent, called JNumeric , therefore has to be installed. However, JNumeric is still at beta level, and operation under Jython hasn't been tested much at all, so feedback is welcome!

======================================================================

Q3:

[from Tate Wilson]

I am trying to set up your gnuplot/python package on my mac (osX). The readme file says I need to convert the files to mac text files. The coverter I usually use, maclink, won't handle these files. Can you give me a hint how to convert the files or where to look for help?

A3:

I don't know. But the same user later reported what worked for him:

I did have to convert the files. It may not be true for all mac Python users, but I suspect it is. I'm using a graphical Python development environment called "Python IDE for mac" which may have its own pickiness, but still, it wouldn't even recognize the files in your package as being the type it could open. I tried a few different file converters with no luck. Then I just opened all the files with BBedit, changed something so I would be prompted to save it on closing (like add and remove a letter), and closed BBedit. Then all the files were mac files and the Python interpreter recognised them.

======================================================================

Q4:

I am using Windows and I get an error like

> Traceback (most recent call last): > [...] > File "C:\Python23\Lib\site-packages\Gnuplot\gp_win32.py", > line 125, in __call__ > self.write(s + \n) > IOError: [Errno 22] Invalid argument

What is the problem?

A4:

This is apparently the error that results when Gnuplot.py cannot start the pgnuplot.exe executable under Windows. It could be that gnuplot (the plotting program, as opposed to Gnuplot.py) is not installed, or that it is not in your PATH. If your pgnuplot.exe executable is named differently, or you do not want to add its directory to your PATH, you can change gnuplot_command in gp_win32.py to indicate the precise path to the executable.


This document was automatically generated Fri May 2 16:59:06 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/setup.html0000644000076400007640000000360211006707252017234 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Gnuplot/setup.py

Gnuplot / setup.py 

Classes   

This document was automatically generated Fri May 2 16:59:06 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/gp_win32.py/0000755000076400007640000000000011006707732017267 5ustar alfordalfordgnuplot-py-1.8/doc/Gnuplot/gp_win32.py/GnuplotProcess.html0000644000076400007640000001241111006707252023140 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Class: GnuplotProcess

Gnuplot / gp_win32.py / GnuplotProcess 

Methods   
  __del__ 
__del__ ( self )
  close 
close ( self )
  __init__ 
__init__ ( self,  persist=None )
Exceptions   

Errors.OptionError( '-persist is not supported under Windows!' )

  __call__ 
__call__ ( self,  s )

This document was automatically generated Fri May 2 16:59:06 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/gp_win32.py/GnuplotOpts.html0000644000076400007640000000234111006707252022450 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Class: GnuplotOpts

Gnuplot / gp_win32.py / GnuplotOpts 


This document was automatically generated Fri May 2 16:59:06 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/LICENSE.html0000644000076400007640000006722411006707252017170 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Gnuplot/LICENSE.txt

Gnuplot / LICENSE.txt 

GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999

Preamble

The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users.

This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below.

When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things.

To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it.

For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights.

We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library.

To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others.

Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license.

Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs.

When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library.

We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances.

For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License.

In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system.

Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library.

The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run.

GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

  1. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you".

A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables.

The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".)

"Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library.

Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does.

  1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library.

You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.

  1. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:

    a) The modified work must itself be a software library.

    b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change.

    c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License.

    d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful.

    (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.)

Copyright (C) 1991, 1999 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.

[This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.]

These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.

  1. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices.

Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy.

This option is useful when you wish to copy part of the code of the Library into a program that is not a library.

  1. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange.

If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code.

  1. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License.

However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables.

When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law.

If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.)

Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself.

  1. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications.

You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things:

a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.)

b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with.

c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution.

d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place.

e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy.

For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.

It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute.

  1. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things:

    a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above.

    b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work.

  2. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
  3. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it.
  4. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License.
  5. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library.

Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library.

In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.

If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances.

  1. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
  2. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.

It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.

  1. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.

    NO WARRANTY

  2. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
  3. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

    END OF TERMS AND CONDITIONS

    How to Apply These Terms to Your New Libraries

If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License).

To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.

Copyright (C)

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.

Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation.

Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker.

, 1 April 1990 Ty Coon, President of Vice

Also add information on how to contact you by electronic and paper mail.

You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names:

That's all there is to it!


This document was automatically generated Fri May 2 16:59:06 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/termdefs.py/0000755000076400007640000000000011006707732017450 5ustar alfordalfordgnuplot-py-1.8/doc/Gnuplot/termdefs.py/KeywordArg.html0000644000076400007640000001000711006707252022407 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Class: KeywordArg

Gnuplot / termdefs.py / KeywordArg 

Methods   
  __call__ 
__call__ ( self,  keyw )
Exceptions   

Errors.OptionError('Illegal option %s="%s"' %( self.argname, k, ) )

  __init__ 
__init__ (
        self,
        argname,
        options,
        fixedword=None,
        default=None,
        )

This document was automatically generated Fri May 2 16:59:06 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/termdefs.py/BareStringArg.html0000644000076400007640000000644111006707252023032 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Class: BareStringArg

Gnuplot / termdefs.py / BareStringArg 

Methods   
  __call__ 
__call__ ( self,  keyw )
  __init__ 
__init__ (
        self,
        argname,
        fixedword=None,
        default=None,
        )

This document was automatically generated Fri May 2 16:59:06 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/termdefs.py/BooleanArg.html0000644000076400007640000000647611006707252022361 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Class: BooleanArg

Gnuplot / termdefs.py / BooleanArg 

Methods   
  __call__ 
__call__ ( self,  keyw )
  __init__ 
__init__ (
        self,
        argname,
        trueval,
        falseval,
        fixedword=None,
        default=None,
        )

This document was automatically generated Fri May 2 16:59:06 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/termdefs.py/KeywordOrBooleanArg.html0000644000076400007640000001031311006707252024210 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Class: KeywordOrBooleanArg

Gnuplot / termdefs.py / KeywordOrBooleanArg 

Methods   
  __call__ 
__call__ ( self,  keyw )
Exceptions   

Errors.OptionError('Arguments %s and %s cannot both be specified' %( option, k, ) )
Errors.OptionError('Arguments %s and %s are contradictory' %( self.argname, k, ) )
Errors.OptionError('Illegal option %s=%s' %( self.argname, k, ) )

  __init__ 
__init__ (
        self,
        options,
        argname=None,
        fixedword=None,
        default=None,
        )

This document was automatically generated Fri May 2 16:59:06 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/termdefs.py/MutuallyExclusiveArgs.html0000644000076400007640000000774311006707252024667 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Class: MutuallyExclusiveArgs

Gnuplot / termdefs.py / MutuallyExclusiveArgs 

Methods   
  __call__ 
__call__ ( self,  keyw )
Exceptions   

Errors.OptionError('Arguments %s and %s cannot both be specified' %( foundargname, argname, ) )

  __init__ 
__init__ ( self,  *subargs )

This document was automatically generated Fri May 2 16:59:06 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/termdefs.py/ArgOneParam.html0000644000076400007640000000640611006707252022475 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Class: ArgOneParam

Gnuplot / termdefs.py / ArgOneParam 

Methods   
  get_option 
get_option ( self,  keyw )
  __init__ 
__init__ (
        self,
        argname,
        default,
        )

This document was automatically generated Fri May 2 16:59:06 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/termdefs.py/StringArg.html0000644000076400007640000000776511006707252022252 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Class: StringArg

Gnuplot / termdefs.py / StringArg 

Methods   
  __call__ 
__call__ ( self,  keyw )
Exceptions   

Errors.OptionError('Option %s must be a string' %( self.argname, ) )

  __init__ 
__init__ (
        self,
        argname,
        fixedword=None,
        default=None,
        )

This document was automatically generated Fri May 2 16:59:06 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/termdefs.py/Arg.html0000644000076400007640000000232111006707252021042 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Class: Arg

Gnuplot / termdefs.py / Arg 


This document was automatically generated Fri May 2 16:59:06 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/Errors.py/0000755000076400007640000000000011006707732017113 5ustar alfordalfordgnuplot-py-1.8/doc/Gnuplot/Errors.py/OptionError.html0000644000076400007640000000233511006707252022263 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Class: OptionError

Gnuplot / Errors.py / OptionError 


This document was automatically generated Fri May 2 16:59:06 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/Errors.py/Error.html0000644000076400007640000000232111006707252021065 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Class: Error

Gnuplot / Errors.py / Error 


This document was automatically generated Fri May 2 16:59:06 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/Errors.py/DataError.html0000644000076400007640000000233111006707252021660 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Class: DataError

Gnuplot / Errors.py / DataError 


This document was automatically generated Fri May 2 16:59:06 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/Errors.html0000644000076400007640000000462311006707252017354 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Gnuplot/Errors.py

Gnuplot / Errors.py 

Classes   

DataError

OptionError

Error


This document was automatically generated Fri May 2 16:59:06 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/index.html0000644000076400007640000001766511006707252017221 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Gnuplot
Classes   
Other documentation   

ANNOUNCE.txt

This is to announce the release of version 1.8 of Gnuplot.py.

CREDITS.txt

CREDITS:

FAQ.txt

# $Id: FAQ.txt 294 2006-11-07 02:33:08Z parejkoj $

Gnuplot.html

LICENSE.txt

GNU LESSER GENERAL PUBLIC LICENSE

NEWS.txt

$Id: NEWS.txt 302 2008-01-14 22:15:19Z bmcage $

README.txt

Gnuplot.py
A pipe-based interface to the gnuplot plotting program.

RELEASES.txt

# $Id: RELEASES.txt 306 2008-05-02 01:09:02Z alford $

TODO.txt

$Id: TODO.txt 294 2006-11-07 02:33:08Z parejkoj $

Python files   

Errors.py

PlotItems.py

_Gnuplot.py

demo.py

funcutils.py

gnuplot_Suites.py

gp.py

gp_cygwin.py

gp_java.py

gp_mac.py

gp_macosx.py

gp_unix.py

gp_win32.py

setup.py

termdefs.py

test.py

utils.py


This document was automatically generated Fri May 2 16:59:06 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/gp_macosx.html0000644000076400007640000000707611006707253020066 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Gnuplot/gp_macosx.py

Gnuplot / gp_macosx.py 

Functions   
  test_persist 
test_persist ()
Classes   

GnuplotOpts

GnuplotProcess


This document was automatically generated Fri May 2 16:59:07 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/utils.html0000644000076400007640000000776511006707252017252 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Gnuplot/utils.py

Gnuplot / utils.py 

Functions   
  write_array 
write_array (
        f,
        set,
        item_sep=None,
        nest_prefix=None,
        nest_suffix=None,
        nest_sep=None,
        )
  float_array 
float_array ( m )
Classes   

This document was automatically generated Fri May 2 16:59:06 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/TODO.html0000644000076400007640000000572111006707252016645 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Gnuplot/TODO.txt

Gnuplot / TODO.txt 

$Id: TODO.txt 294 2006-11-07 02:33:08Z parejkoj $

Some ideas for future work. I don't know whether I'll get around to any of these items; some of them are probably better left undone anyway. Of course if anybody else wants to take one up...

  • Implement missing values. Gnuplot allows you to specify that values are missing from data files via the `set missing' command. This should probably be implemented via Numeric's masked arrays. (Comments?) The real benefit of dealing with values is that (I think) gnuplot can still put a mesh on a surface even if the surface has holes.
  • Figure out how to suck gnuplot error messages back into Python and turn them into exceptions. This would be tricky: for one thing, not all gnuplot output is indicative of an error. Moreover, implementation on Windows and Mac would require additional effort to change their GnuplotProcess classes. The output from the show command could be processed in a similar manner.
  • Implement multiple graphs on a single page. I haven't used this feature of gnuplot much myself, so I'm not sure how difficult it would be to build it into the Gnuplot.py framework. Ideally one would like to be able to spawn multiple GnuplotWindow's from a single Gnuplot instance, each one behaving much like a Gnuplot object. Or maybe treat sub-windows as a kind of meta-PlotItem that can itself contain PlotItems.
  • Add a way to use Gnuplot.py without Numeric. This would probably not require too much work, and would also be convenient for Jython users since JNumeric is not as far along as Numeric.
  • Support gnuplot's new abilities to allow user interaction via the mouse. I believe this will require 2-way communication between Gnuplot.py and gnuplot.

This document was automatically generated Fri May 2 16:59:06 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/_Gnuplot.html0000644000076400007640000000436011006707253017666 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Gnuplot/_Gnuplot.py

Gnuplot / _Gnuplot.py 

Classes   

Gnuplot

_GnuplotFile


This document was automatically generated Fri May 2 16:59:07 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/funcutils.html0000644000076400007640000001313111006707252020106 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Gnuplot/funcutils.py

Gnuplot / funcutils.py 

Functions   
  compute_Data 
compute_Data (
        xvals,
        f,
        ufunc=None,
        **keyw,
        )
  tabulate_function 
tabulate_function (
        f,
        xvals,
        yvals=None,
        dtype=None,
        ufunc=None,
        )
  GridFunc 
GridFunc (
        f,
        xvals,
        yvals,
        **keyw,
        )

For backwards compatibility:

  compute_GridData 
compute_GridData (
        xvals,
        yvals,
        f,
        ufunc=None,
        **keyw,
        )
Classes   

This document was automatically generated Fri May 2 16:59:06 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/NEWS.html0000644000076400007640000002570511006707252016660 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Gnuplot/NEWS.txt

Gnuplot / NEWS.txt 

$Id: NEWS.txt 302 2008-01-14 22:15:19Z bmcage $

This file describes the changes introduced in each version of the Gnuplot.py package.

Version ?.?

Version 1.8:

  • hardcopy allows for terminal=svg (using a patch from Spyros Blanas)
  • Use with_ instead of with as that will be a python keyword in the future.
  • Added an option "filename" to Data and GridData in PlotItems.py. This allows saving the data to a permanent, rather than temporary, file. (Patch contributed by Matthew Fulmer.)
  • Added a pdf terminal definition (using a patch from Jim Kleckner).
  • Added close() and __del__() methods to the Gnuplot class. This might help with some cases of premature temporary file deletion. (Suggested by Jim Kleckner.)

Version 1.7:

  • Relaxed license from GPL to LGPL.
  • Significant reorganization of PlotItem.py:

    + Deleted the AnyFile classes from PlotItem: AnyFile, TempFile, ArrayFile, and TempArrayFile. Those classes weren't pulling their weight.

    + Added a new _FileItem class to represent all forms of data that gnuplot treats as a file.

    + Added a new _TempFileItem class to represent PlotItems that are based on a temporary file.

    + Added a new _InlineFileItem class to represent PlotItems whose data is passed to gnuplot inline.

    + Changed PlotItems.File() and PlotItems.Data from classes into factory functions that produce instances of the classes mentioned above.

  • Slightly changed the PlotItem interface to support the new derived classes:

    + Removed the basecommand argument to the constructor. Instead added a get_base_command_string() method to retrieve that string. This function is not defined in PlotItem so it is added to the derived classes. (This function is used by _FIFOFileItem as the hook where _FIFOWriters are created.

    + Added a new get_command_option_string() method which abstracts out the construction of the option part of the command() method.

  • Added support for sending data to gnuplot via FIFOs (named pipes) via a new _FIFOFileItem class. This mechanism removes the ambiguity about when temporary files should be deleted, therefore making it easier to use Gnuplot.py in script environments, etc. This feature is only implemented under nix because Python doesn't implement the required threading module and os.mkfifo() on other operating systems. Added two new configuration options, support_fifo and prefer_fifodata, to the gp.py files to switch the new feature on and off.
  • Started adding support for running Gnuplot.py under Jython/Java. Added gp_java.py, which is a functioning low-level interface to gnuplot via java.lang.Process objects. The rest might work, too, if you have JNumeric installed. (Gnuplot.py relies on the Numeric library; JNumeric is the Jython equivalent.) If I find the time I might try to produce a version that doesn't require Numeric at all, under either Python or Jython.
  • Removed the oldplot.py module: (1) I doubt anybody is still using it. (2) It seems to be broken anyway. (3) I don't have the energy to fix or maintain it. Let me know if I'm wrong about point 1.
  • Started a new FAQ.txt file and added an answer to the single most frequently asked question.

Version 1.6:

  • Introduced a general mechanism to make it easy to support multiple gnuplot terminal types in the Gnuplot.hardcopy() function. Added definitions for postscript, png, fig, and cgm. Other terminal types can now be added easily.
  • Changed names of Exceptions to be more consistent with other modules: OptionException -> OptionError and DataException -> DataError. Moved both to Errors.py and derive both from Errors.Error.
  • Incorporated several changes for Mac OS suggested by Jon Moody.
  • Added a gp_macosx.py file to support Mac OS X. The only difference between this and gp_unix.py is the default terminal selection.
  • Moved import statement in demo.py to global scope for Python 2.2.
  • Removed claims that demo.py can be run before installing Gnuplot.py.

Version 1.5:

  • Broke up the module a bit for better maintainability. The most commonly-used facilities are still available through "import Gnuplot", but a few more specialized things have been moved to separate modules, in particular funcutils.py and PlotItems.py. __init__.py now just imports things from other modules.
  • funcutils.tabulate_function() can be used to evaluate a function on a 1-D or 2-D grid of points (this replaces grid_function, which only worked with 2-D grids).
  • Added two helper functions, funcutils.compute_Data and funcutils.compute_GridData, which compute a function's values on a set of points and package the results into a PlotItem.
  • GridFunc is no longer an independent class; it is now a factory function that returns a GridData. GridFunc is deprecated in favor of funcutils.compute_GridData.
  • Changed set_option to work from a table, so that it doesn't need to be overloaded so often.
  • Made changes like those submitted by Matthew Martin to allow the `smooth' option.
  • Implemented test_persist for each platform to make it easier for users to determine whether the `-persist' option is supported.
  • Added a prefer_persist option to serve as the default `persist' choice.
  • Following a suggestion by Jannie Hofmeyr , use "from os import popen" for Python 2.0 under Windows. I don't use Windows, so let me know how this works.
  • Added a setup.py file so that Gnuplot.py can be installed using Python distutils.
  • Added support for the `axes' parameter of the `plot' command.
  • Reworked the comment strings in an effort to make them work nicely with happydoc.

Version 1.4:

  • Added support for the Macintosh, thanks to help from Tony Ingraldi.
  • Split the platform-dependent code, including the configuration options, into separate modules: gp.py, gp_mac.py, and gp_win32.py. The GnuplotProcess class defined in those files is a lightweight interface to the gnuplot program that could also conceivably be useful to somebody.
  • Allow access to all of the postscript printer driver options through the hardcopy() method.
  • Fixed an import problem in test.py.

Version 1.3:

  • Converted to package format. The main file is now called __init__.py, so that it can be loaded by typing import Gnuplot.
  • Passing GridData a callable function was basically broken because of the kludgey way of overloading the argument. Instead of trying to fix it, I moved that functionality to a new type of PlotItem called GridFunc.
  • Added a new keyword argument, ufunc, to grid_function and to GridFunc. If that argument is nonzero, then the function is evaluated matrix-wise (in that case it must be composed only of ufunctions or ufunction-like routines).
  • Fixed a typecode problem with grid_function (typecode is apparently a positional, not a keyword, argument in the Numeric library).
  • Separated the demonstration code into a separate file, demo.py, to shorten __init__.py a bit.

Version 1.2 (8 Aug 1999):

  • Support for MS Windows, using the `pgnuplot.exe' program. Thanks go especially to Craig Schardt for help with this.
  • Support for using binary files to send grid data to splot. This saves a lot of time and usually saves space compared with the old text files. (Only works with recent versions of gnuplot.)
  • Support for sending data to gnuplot as `inline data' (i.e., "plot '-'"). This method should be faster than the alternate method, temporary files. (Only works with recent versions of gnuplot.)
  • Allows PlotItem options to be modified after the PlotItem is constructed.
  • Simplified the PlotItem inheritance hierarchy (Data and GridData are no longer derived from File).
  • Added several configuration options (see top of Gnuplot.py).
  • Separated function-based interface into a separate file (Gnuplot_plot.py).
  • Added a test module, Gnuplot_test.py, which tests most of the features of Gnuplot.py.
  • A README file, lots of documentation changes, etc.

Version 1.1a (9 Apr 1999):

This version just addresses a couple of minor portability issues.

Version 1.1 (31 Jan 1999):

  • 3-D plots are now supported through the new splot method: + To create a scatter plot, pass splot a 2-D array containing (x,y,z) triplets; + To create a grid plot, pass a 3-D array consisting of a 2-D array of (x,y,z) triplets; or + Use the new `GridData' PlotItem to plot gridded data (data tabulated on a rectangular grid).
  • It is now easier to pass data to gnuplot. The Data PlotItem now accepts multiple arguments representing subsequent columns of the dataset; e.g., what used to be written as

    g = Gnuplot.Gnuplot() x = numpy.arange(100)/10.0 y = x**2 # Create an array of (x,y) pairs: g.plot(Gnuplot.Data(numpy.transpose((x, y))))

    can now be shortened to

    # Plot y vs. x directly: g.plot(Gnuplot.Data(x, y))

    (both examples plot x squared vs. x). Similarly, splot can be passed three arrays representing the values of x, y, and z. Note that the old interpretation is still used if a single argument is passed to `Data'.


This document was automatically generated Fri May 2 16:59:06 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/gnuplot_Suites.py/0000755000076400007640000000000011006707732020663 5ustar alfordalfordgnuplot-py-1.8/doc/Gnuplot/gnuplot_Suites.py/gnuplot_Suite.html0000644000076400007640000001451311006707253024414 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Class: gnuplot_Suite

Gnuplot / gnuplot_Suites.py / gnuplot_Suite 

Methods   
  gnuexec 
gnuexec (
        self,
        _object=None,
        _attributes=None,
        **_arguments,
        )
Exceptions   

aetools.Error, aetools.decodeerror( _arguments )
TypeError, 'No optional args expected'

  plot 
plot (
        self,
        _object=None,
        _attributes=None,
        **_arguments,
        )
Exceptions   

aetools.Error, aetools.decodeerror( _arguments )
TypeError, 'No optional args expected'

  splot 
splot (
        self,
        _object=None,
        _attributes=None,
        **_arguments,
        )
Exceptions   

aetools.Error, aetools.decodeerror( _arguments )
TypeError, 'No optional args expected'


This document was automatically generated Fri May 2 16:59:07 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/gnuplot_Suites.py/odds_and_ends.html0000644000076400007640000000655311006707253024344 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Class: odds_and_ends

Gnuplot / gnuplot_Suites.py / odds_and_ends 

Methods   
  select 
select (
        self,
        _object=None,
        _attributes=None,
        **_arguments,
        )
Exceptions   

aetools.Error, aetools.decodeerror( _arguments )
TypeError, 'No optional args expected'


This document was automatically generated Fri May 2 16:59:07 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/gnuplot_Suites.py/name.html0000644000076400007640000000233711006707253022474 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Class: name

Gnuplot / gnuplot_Suites.py / name 


This document was automatically generated Fri May 2 16:59:07 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/gnuplot_Suites.py/bounds.html0000644000076400007640000000234311006707253023043 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Class: bounds

Gnuplot / gnuplot_Suites.py / bounds 


This document was automatically generated Fri May 2 16:59:07 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/gnuplot_Suites.py/index.html0000644000076400007640000000234111006707253022656 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Class: index

Gnuplot / gnuplot_Suites.py / index 


This document was automatically generated Fri May 2 16:59:07 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/gnuplot_Suites.py/zoomable.html0000644000076400007640000000234711006707253023365 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Class: zoomable

Gnuplot / gnuplot_Suites.py / zoomable 


This document was automatically generated Fri May 2 16:59:07 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/gnuplot_Suites.py/window.html0000644000076400007640000000234311006707253023060 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Class: window

Gnuplot / gnuplot_Suites.py / window 


This document was automatically generated Fri May 2 16:59:07 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/gnuplot_Suites.py/floating.html0000644000076400007640000000234711006707253023360 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Class: floating

Gnuplot / gnuplot_Suites.py / floating 


This document was automatically generated Fri May 2 16:59:07 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/gnuplot_Suites.py/application.html0000644000076400007640000000235511006707253024057 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Class: application

Gnuplot / gnuplot_Suites.py / application 


This document was automatically generated Fri May 2 16:59:07 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/gnuplot_Suites.py/modal.html0000644000076400007640000000234111006707253022643 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Class: modal

Gnuplot / gnuplot_Suites.py / modal 


This document was automatically generated Fri May 2 16:59:07 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/gnuplot_Suites.py/closeable.html0000644000076400007640000000235111006707253023501 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Class: closeable

Gnuplot / gnuplot_Suites.py / closeable 


This document was automatically generated Fri May 2 16:59:07 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/gnuplot_Suites.py/position.html0000644000076400007640000000234711006707253023421 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Class: position

Gnuplot / gnuplot_Suites.py / position 


This document was automatically generated Fri May 2 16:59:07 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/gnuplot_Suites.py/graph.html0000644000076400007640000000234111006707253022650 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Class: graph

Gnuplot / gnuplot_Suites.py / graph 


This document was automatically generated Fri May 2 16:59:07 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/gnuplot_Suites.py/picture.html0000644000076400007640000000234511006707253023226 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Class: picture

Gnuplot / gnuplot_Suites.py / picture 


This document was automatically generated Fri May 2 16:59:07 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/gnuplot_Suites.py/zoomed.html0000644000076400007640000000234311006707253023046 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Class: zoomed

Gnuplot / gnuplot_Suites.py / zoomed 


This document was automatically generated Fri May 2 16:59:07 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/gnuplot_Suites.py/Standard_Suite.html0000644000076400007640000003312011006707253024457 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Class: Standard_Suite

Gnuplot / gnuplot_Suites.py / Standard_Suite 

Methods   
  set 
set (
        self,
        _object,
        _attributes=None,
        **_arguments,
        )
Exceptions   

aetools.Error, aetools.decodeerror( _arguments )

  get 
get (
        self,
        _object,
        _attributes=None,
        **_arguments,
        )
Exceptions   

aetools.Error, aetools.decodeerror( _arguments )
TypeError, 'No optional args expected'

  make 
make (
        self,
        _no_object=None,
        _attributes=None,
        **_arguments,
        )
Exceptions   

aetools.Error, aetools.decodeerror( _arguments )
TypeError, 'No direct arg expected'

  _print 
_print (
        self,
        _object,
        _attributes=None,
        **_arguments,
        )
Exceptions   

aetools.Error, aetools.decodeerror( _arguments )
TypeError, 'No optional args expected'

  close 
close (
        self,
        _object,
        _attributes=None,
        **_arguments,
        )
Exceptions   

aetools.Error, aetools.decodeerror( _arguments )

  save 
save (
        self,
        _object,
        _attributes=None,
        **_arguments,
        )
Exceptions   

aetools.Error, aetools.decodeerror( _arguments )

  open 
open (
        self,
        _object,
        _attributes=None,
        **_arguments,
        )
Exceptions   

aetools.Error, aetools.decodeerror( _arguments )
TypeError, 'No optional args expected'

  data_size 
data_size (
        self,
        _object,
        _attributes=None,
        **_arguments,
        )
Exceptions   

aetools.Error, aetools.decodeerror( _arguments )
TypeError, 'No optional args expected'


This document was automatically generated Fri May 2 16:59:07 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/gnuplot_Suites.py/visible.html0000644000076400007640000000234511006707253023210 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Class: visible

Gnuplot / gnuplot_Suites.py / visible 


This document was automatically generated Fri May 2 16:59:07 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/gnuplot_Suites.py/Miscellaneous_Events.html0000644000076400007640000001156011006707253025701 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Class: Miscellaneous_Events

Gnuplot / gnuplot_Suites.py / Miscellaneous_Events 

Methods   
  do_script 
do_script (
        self,
        _object=None,
        _attributes=None,
        **_arguments,
        )
Exceptions   

aetools.Error, aetools.decodeerror( _arguments )
TypeError, 'No optional args expected'

  revert 
revert (
        self,
        _object,
        _attributes=None,
        **_arguments,
        )
Exceptions   

aetools.Error, aetools.decodeerror( _arguments )
TypeError, 'No optional args expected'


This document was automatically generated Fri May 2 16:59:07 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/gnuplot_Suites.py/titled.html0000644000076400007640000000234311006707253023036 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Class: titled

Gnuplot / gnuplot_Suites.py / titled 


This document was automatically generated Fri May 2 16:59:07 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/gnuplot_Suites.py/modified.html0000644000076400007640000000244011006707253023327 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Class: modified

Gnuplot / gnuplot_Suites.py / modified 

repeated property name the title of the document


This document was automatically generated Fri May 2 16:59:07 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/gnuplot_Suites.py/document.html0000644000076400007640000000234711006707253023373 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Class: document

Gnuplot / gnuplot_Suites.py / document 


This document was automatically generated Fri May 2 16:59:07 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/gnuplot_Suites.py/resizable.html0000644000076400007640000000235111006707253023530 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Class: resizable

Gnuplot / gnuplot_Suites.py / resizable 


This document was automatically generated Fri May 2 16:59:07 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/gp_mac.py/0000755000076400007640000000000011006707732017065 5ustar alfordalfordgnuplot-py-1.8/doc/Gnuplot/gp_mac.py/GnuplotProcess.html0000644000076400007640000001513011006707252022737 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Class: GnuplotProcess

Gnuplot / gp_mac.py / GnuplotProcess 

Methods   
  __del__ 
__del__ ( self )
  write 
write ( self,  s )
  flush 
flush ( self )
  __call__ 
__call__ ( self,  s )
  close 
close ( self )
  __init__ 
__init__ ( self,  persist=None )
Exceptions   

Errors.OptionError( '-persist is not supported on the Macintosh!' )


This document was automatically generated Fri May 2 16:59:06 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/gp_mac.py/GnuplotOpts.html0000644000076400007640000000233511006707252022251 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Class: GnuplotOpts

Gnuplot / gp_mac.py / GnuplotOpts 


This document was automatically generated Fri May 2 16:59:06 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/gp_mac.py/_GNUPLOT.html0000644000076400007640000000501511006707252021240 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Class: _GNUPLOT

Gnuplot / gp_mac.py / _GNUPLOT 

Methods   
  __init__ 
__init__ ( self )

This document was automatically generated Fri May 2 16:59:06 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/demo.html0000644000076400007640000000624611006707253017030 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Gnuplot/demo.py

Gnuplot / demo.py 

Functions   
  demo 
demo ()
Classes   

This document was automatically generated Fri May 2 16:59:07 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/gp_unix.html0000644000076400007640000000706611006707252017555 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Gnuplot/gp_unix.py

Gnuplot / gp_unix.py 

Functions   
  test_persist 
test_persist ()
Classes   

GnuplotOpts

GnuplotProcess


This document was automatically generated Fri May 2 16:59:06 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/gp.html0000644000076400007640000000632211006707252016504 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Gnuplot/gp.py

Gnuplot / gp.py 

Functions   
  double_quote_string 
double_quote_string ( s )
Classes   

This document was automatically generated Fri May 2 16:59:06 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/gp_macosx.py/0000755000076400007640000000000011006707732017617 5ustar alfordalfordgnuplot-py-1.8/doc/Gnuplot/gp_macosx.py/GnuplotProcess.html0000644000076400007640000001242611006707253023477 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Class: GnuplotProcess

Gnuplot / gp_macosx.py / GnuplotProcess 

Methods   
  __del__ 
__del__ ( self )
  close 
close ( self )
  __init__ 
__init__ ( self,  persist=None )
Exceptions   

( '-persist does not seem to be supported ' 'by your version of gnuplot!' )

  __call__ 
__call__ ( self,  s )

This document was automatically generated Fri May 2 16:59:07 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/gp_macosx.py/GnuplotOpts.html0000644000076400007640000000234311006707253023003 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Class: GnuplotOpts

Gnuplot / gp_macosx.py / GnuplotOpts 


This document was automatically generated Fri May 2 16:59:07 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/CREDITS.html0000644000076400007640000000614411006707252017175 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Gnuplot/CREDITS.txt

Gnuplot / CREDITS.txt 

CREDITS:

Gnuplot.py was written by Michael Haggerty , inspired by and partly derived from an earlier version by Konrad Hinsen. I maintain it and continue to develop it, though by now it has most of the features that I had planned for it.

I would like to acknowledge and express my appreciation to the following people for their contributions:

Konrad Hinsen wrote the first, procedural interface version of Gnuplot.py. His code is still present in many components of the current version. The oldplot.py module, which used to be included in Gnuplot.py for backwards compatibility with his version, hasn't been supported for a while so I deleted it.

Berthold Hoellmann introduced me to the helpful `pythondoc' package, and contributed some docstring changes to allow web documentation to be generated from the Gnuplot.py source. He also submitted a setup.py file to be used with Python distutils.

Craig Schardt and Francois Ladouceur contributed changes to enable Gnuplot.py to work under MS-Windows.

Tony Ingraldi got Gnuplot.py to work on the Macintosh and Noburu Yamamoto also contributed to this code.

Stuard Reynolds made some helpful suggestions for automating the tabulation of function values.

Jannie Hofmeyr suggested using "from os import popen" in gp_win32.py for versions of Python subsequent to 2.0.

Daehyok Shin pointed out that support for the `axes' keyword was missing.

Jon Moody suggested some changes for Mac OS.

Andy Main contributed terminal_opts for metapost output.

Matthew Fulmer contributed a patch to add the "filename" argument to Data and GridData.

Benny Malengier will push out new versions if the need arises starting from 1.8


This document was automatically generated Fri May 2 16:59:06 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/_Gnuplot.py/0000755000076400007640000000000011006707732017426 5ustar alfordalfordgnuplot-py-1.8/doc/Gnuplot/_Gnuplot.py/_GnuplotFile.html0000644000076400007640000000632711006707253022711 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Class: _GnuplotFile

Gnuplot / _Gnuplot.py / _GnuplotFile 

Methods   
  __call__ 
__call__ ( self,  s )
  __init__ 
__init__ ( self,  filename )

This document was automatically generated Fri May 2 16:59:07 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/_Gnuplot.py/Gnuplot.html0000644000076400007640000005330311006707253021746 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Class: Gnuplot

/ Gnuplot / _Gnuplot.py / Gnuplot 

Methods   
  load 
load ( self,  filename )
  set 
set ( self,  **keyw )
Exceptions   

'option %s is not supported' %( k, )

  _add_to_queue 
_add_to_queue ( self,  items )
  replot 
replot (
        self,
        *items,
        *keyw,
        )
  set_label 
set_label (
        self,
        option,
        s=None,
        offset=None,
        font=None,
        )
  set_boolean 
set_boolean (
        self,
        option,
        value,
        )
  close 
close ( self )
  __init__ 
__init__ (
        self,
        filename=None,
        persist=None,
        debug=None,
        )
Exceptions   

Errors.OptionError( 'Gnuplot with output to file does not allow ' 'persist option.' )

  plot 
plot (
        self,
        *items,
        *keyw,
        )
  set_range 
set_range (
        self,
        option,
        value,
        )
  interact 
interact ( self )
  ylabel 
ylabel (
        self,
        s=None,
        offset=None,
        font=None,
        )
  __call__ 
__call__ ( self,  s )
  save 
save ( self,  filename )
  __del__ 
__del__ ( self )
  zlabel 
zlabel (
        self,
        s=None,
        offset=None,
        font=None,
        )
  hardcopy 
hardcopy (
        self,
        filename=None,
        terminal=None,
        **keyw,
        )
Exceptions   

Errors.OptionError('Terminal "%s" is not configured in Gnuplot.py.' %( terminal, ) )
Errors.OptionError( 'default_lpr is not set, so you can only print to a file.' )
Errors.OptionError('The following options are unrecognized: %s' %( string.join( keyw.keys(), ', ' ), ) )

  splot 
splot (
        self,
        *items,
        *keyw,
        )
  set_string 
set_string (
        self,
        option,
        s=None,
        )
  _clear_queue 
_clear_queue ( self )
  reset 
reset ( self )
  clear 
clear ( self )
  title 
title (
        self,
        s=None,
        offset=None,
        font=None,
        )
  refresh 
refresh ( self )
  xlabel 
xlabel (
        self,
        s=None,
        offset=None,
        font=None,
        )

This document was automatically generated Fri May 2 16:59:07 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/gp_cygwin.py/0000755000076400007640000000000011006707732017625 5ustar alfordalfordgnuplot-py-1.8/doc/Gnuplot/gp_cygwin.py/GnuplotProcess.html0000644000076400007640000001241311006707253023501 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Class: GnuplotProcess

Gnuplot / gp_cygwin.py / GnuplotProcess 

Methods   
  __del__ 
__del__ ( self )
  close 
close ( self )
  __init__ 
__init__ ( self,  persist=None )
Exceptions   

Errors.OptionError( '-persist is not supported under Windows!' )

  __call__ 
__call__ ( self,  s )

This document was automatically generated Fri May 2 16:59:07 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/gp_cygwin.py/GnuplotOpts.html0000644000076400007640000000234311006707253023011 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Class: GnuplotOpts

Gnuplot / gp_cygwin.py / GnuplotOpts 


This document was automatically generated Fri May 2 16:59:07 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/PlotItems.py/0000755000076400007640000000000011006707732017557 5ustar alfordalfordgnuplot-py-1.8/doc/Gnuplot/PlotItems.py/_FileItem.html0000644000076400007640000001424311006707252022303 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Class: _FileItem

Gnuplot / PlotItems.py / _FileItem 

Methods   
  set_option_binary 
set_option_binary ( self,  binary )
Exceptions   

Errors.OptionError( 'Gnuplot.py is currently configured to reject binary data' )

  get_base_command_string 
get_base_command_string ( self )
  __init__ 
__init__ (
        self,
        filename,
        **keyw,
        )
  set_option_colonsep 
set_option_colonsep (
        self,
        name,
        value,
        )
Exceptions   

Errors.OptionError('%s=%s' %( name, value, ) )


This document was automatically generated Fri May 2 16:59:06 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/PlotItems.py/PlotItem.html0000644000076400007640000002441511006707252022205 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Class: PlotItem

Gnuplot / PlotItems.py / PlotItem 

Methods   
  get_option 
get_option ( self,  name )
Exceptions   

KeyError( 'option %s is not set!' % name )

  get_command_option_string 
get_command_option_string ( self )
  set_string_option 
set_string_option (
        self,
        option,
        value,
        default,
        fmt,
        )
  command 
command ( self )
  clear_option 
clear_option ( self,  name )
  __init__ 
__init__ ( self,  **keyw )
  pipein 
pipein ( self,  f )
  set_option 
set_option ( self,  **keyw )
Exceptions   

Errors.OptionError( 'Cannot modify %s option after construction!', option )
Errors.OptionError('%s=%s' %( option, value ) )

  get_base_command_string 
get_base_command_string ( self )
Exceptions   

NotImplementedError()


This document was automatically generated Fri May 2 16:59:06 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/PlotItems.py/_NewFileItem.html0000644000076400007640000000642011006707252022753 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Class: _NewFileItem

Gnuplot / PlotItems.py / _NewFileItem 

Methods   
  __del__ 
__del__ ( self )
  __init__ 
__init__ (
        self,
        content,
        filename=None,
        **keyw,
        )

This document was automatically generated Fri May 2 16:59:06 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/PlotItems.py/_InlineFileItem.html0000644000076400007640000000772311006707252023447 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Class: _InlineFileItem

Gnuplot / PlotItems.py / _InlineFileItem 

Methods   
  __init__ 
__init__ (
        self,
        content,
        **keyw,
        )
Exceptions   

Errors.OptionError( 'binary inline data is not supported' )

  pipein 
pipein ( self,  f )

This document was automatically generated Fri May 2 16:59:06 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/PlotItems.py/_unset.html0000644000076400007640000000233111006707252021736 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Class: _unset

Gnuplot / PlotItems.py / _unset 


This document was automatically generated Fri May 2 16:59:06 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/PlotItems.py/Func.html0000644000076400007640000000643211006707252021342 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Class: Func

Gnuplot / PlotItems.py / Func 

Methods   
  get_base_command_string 
get_base_command_string ( self )
  __init__ 
__init__ (
        self,
        function,
        **keyw,
        )

This document was automatically generated Fri May 2 16:59:06 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/gp_unix.py/0000755000076400007640000000000011006707732017310 5ustar alfordalfordgnuplot-py-1.8/doc/Gnuplot/gp_unix.py/GnuplotProcess.html0000644000076400007640000001242211006707252023163 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Class: GnuplotProcess

Gnuplot / gp_unix.py / GnuplotProcess 

Methods   
  __del__ 
__del__ ( self )
  close 
close ( self )
  __init__ 
__init__ ( self,  persist=None )
Exceptions   

( '-persist does not seem to be supported ' 'by your version of gnuplot!' )

  __call__ 
__call__ ( self,  s )

This document was automatically generated Fri May 2 16:59:06 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/gp_unix.py/GnuplotOpts.html0000644000076400007640000000233711006707252022476 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Class: GnuplotOpts

Gnuplot / gp_unix.py / GnuplotOpts 


This document was automatically generated Fri May 2 16:59:06 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/Gnuplot.html0000644000076400007640000001701511006707252017527 0ustar alfordalford Gnuplot.py

Gnuplot.py on SourceForge Logo

Quick links:

Intro

Gnuplot.py is a Python package that interfaces to gnuplot, the popular open-source plotting program. It allows you to use gnuplot from within Python to plot arrays of data from memory, data files, or mathematical functions. If you use Python to perform computations or as `glue' for numerical programs, you can use this package to plot data on the fly as they are computed. And the combination with Python makes it is easy to automate things, including to create crude `animations' by plotting different datasets one after another.

Commands are communicated to gnuplot through a pipe and data either through the same pipe (as "inline" data), through FIFOs (named pipes), or through temporary files. It has been developed under Unix and is known to work under various forms of Unix (including Linux), MS Windows, MacOS, and Mac OS X. There is now also preliminary support for running Gnuplot.py under Jython/Java.

This package has an object-oriented design that allows the user flexibility to set plot options and to run multiple gnuplot sessions simultaneously. If you are more ambitious, it is not difficult to add entirely new types of plottable items by deriving from the `PlotItem' class.

The package includes a demonstration that can be run by typing `python demo.py'.

News

(January 2008) Gnuplot.py version 1.8 is out. This version includes bugfixes and improvements that have piled up since 1.7. For more information, read the NEWS.txt file in the distribution.

(17 October 2003) Gnuplot.py version 1.7 is out. This version includes a change of license from GPL to LGPL, support for sending data to Gnuplot via FIFOs (named pipes) under unix, and preliminary support for running Gnuplot.py under Jython. For more information, read the NEWS.txt file in the distribution.

Documentation

The quickest way to learn how to use Gnuplot.py is to install it then run the simple demonstration by typing `python demo.py', then to look at the demo.py file to see the commands that create the demo. One of the examples is probably similar to what you want to do.

Don't forget to read the Gnuplot.html, README.txt and FAQ.txt files in the Gnuplot.py distribution.

HTML documentation for the Python classes is included in the doc/ directory of the distribution and is also available online. This documentation is extracted automatically from the package's docstrings using happydoc and is known to have some formatting problems. Alternatively, you can look at the docstrings yourself by opening the python files in an editor.

Finally, there is a new mailing list for Gnuplot.py users. For more information about subscribing to the list or viewing the archive of old articles, please click here.

To get good use out of Gnuplot.py, you will want to know something about gnuplot, for which a good source is the gnuplot help (run gnuplot then type `help', or read it online at this website). You might also want to check out Bernhard Reiter's gnuplot information page, which has many more links.

Installation

More detailed installation instructions are contained in README.txt.

Before you can use Gnuplot.py, you will need working versions of

If you want to run under MS Windows, make sure you have pgnuplot.exe (see the README.txt file for details).

To install Gnuplot.py:

  1. Download either gnuplot-py-1.8.tar.gz or Gnuplot-1.8.zip.
  2. Gunzip and untar (or unzip) it, which will create a directory called gnuplot-1.8.
  3. Refer to README.txt in that directory for further instructions. Usually it should be enough to type python setup.py install.

You can also access the latest Gnuplot.py sources via Subversion. Click here for more information.

Copyleft

Gnuplot.py is released under the GNU Lesser General Public License, which means that it can be freely copied and used, but that there are some restrictions on your rights to incorporate it into commercial products. See the LICENCE file for more information. (If these restrictions are a problem for you, please contact me to discuss the issue.)

Credits

The Gnuplot.py package was written by Michael Haggerty.

The package was inspired by and partly derived from the Gnuplot.py module written by Konrad Hinsen.

Berthold Höllmann submitted a setup.py file to be used with distutils.

Craig Schardt and Francois Ladouceur contributed changes that enable Gnuplot.py to work under MS-Windows. Tony Ingraldi contributed changes for the Macintosh.

Jannie Hofmeyr submitted a fix for Windows under Python 2.0.

Matthew Fulmer contributed a patch to add the filename argument to Data and GridData.

Thanks also to many other users who have submitted suggestions, bug fixes, and other feedback.


Written by Michael Haggerty (email <mhagger@alum.mit.edu>)

Valid HTML 4.01! This page should be viewable on any standards-compliant browser.

gnuplot-py-1.8/doc/Gnuplot/termdefs.html0000644000076400007640000000652011006707252017707 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Gnuplot/termdefs.py

Gnuplot / termdefs.py 

Classes   

ArgOneParam

BooleanArg

BareStringArg

MutuallyExclusiveArgs

StringArg

KeywordArg

Arg

KeywordOrBooleanArg


This document was automatically generated Fri May 2 16:59:06 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/gp_win32.html0000644000076400007640000000714111006707252017526 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Gnuplot/gp_win32.py

Gnuplot / gp_win32.py 

Functions   
  test_persist 
test_persist ()

Mac doesn't recognize persist.

Classes   

GnuplotOpts

GnuplotProcess


This document was automatically generated Fri May 2 16:59:06 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/ANNOUNCE.html0000644000076400007640000001211111006707253017276 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Gnuplot/ANNOUNCE.txt

Gnuplot / ANNOUNCE.txt 

This is to announce the release of version 1.8 of Gnuplot.py.

Gnuplot.py is a Python [1] package that allows you to create graphs from within Python using the gnuplot [2] plotting program.

Gnuplot.py can be obtained from

http://gnuplot-py.sourceforge.net/

Prerequisites (see footnotes): the Python interpreter [1] the Python numpy module [3] the gnuplot program [2]

or, to use it under Java (experimental): a Java interpreter the Jython interpreter [4] the Jython version of the Numeric module [5] the gnuplot program [2]

Some ways this package can be used:

  1. Interactive data processing: Use Python's excellent numpy package to create and manipulate arrays of numbers, and use Gnuplot.py to visualize the results. 2. Web graphics: write CGI scripts in Python that use gnuplot to output plots in (for example) PNG format and return them to the client. 3. Glue for numerical applications (this is my favorite): wrap your C++/C/Fortran subroutines so that they are callable from Python, then you can perform numerical computations interactively from scripts or from the command line and use Gnuplot.py to plot the output on the fly. 4. Compute a series of datasets in Python and plot them one after the other using Gnuplot.py to produce a crude animation.

New features in this version: + Various bug fixes + an option "filename" to Data and GridDat This allows saving the data to a permanent, rather than temporary + pdf terminal definition

Features already present in older versions:

+ Two and three-dimensional plots. + Plot data from memory, from a file, or from an expression. + Support for multiple simultaneous gnuplot sessions. + Can pass arbitrary commands to the gnuplot program. + Object oriented, extensible design with several built-in types of plot items. + Portable and easy to install (nothing to compile except on Windows). + Support for Unix (including Linux and Mac OS X), MS Windows, and Mac OS. The platform-dependent layer is fairly well abstracted out, so it shouldn't be too difficult to add support for other platforms. + Support for sending data to gnuplot as `inline' or `binary' data. These are optimizations that also remove the need for temporary files. + Partly table-driven to make it easy to extend. New terminal types can be supported easily by adding data to a table. + Install via distutils. + LGPL license . + Support for sending data to gnuplot via FIFOs (named pipes, linux only). + Preliminary support for running Gnuplot.py under Jython

Footnotes: ---------- [1] Python is an excellent object-oriented scripting/rapid development language that is also especially good at gluing programs together. [2] gnuplot is a free, popular, very portable plotting program with a command-line interface. It can make 2-d and 3-d plots and can output to myriad printers and graphics terminals. [3] The numpy Python extension is a Python module that adds fast and convenient array manipulations to the Python language. [4] Jython is a Python interpreter that runs within a Java virtual machine. [5] JNumeric is a version of the Numeric module that runs under Java/Jython.


This document was automatically generated Fri May 2 16:59:07 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/gp_cygwin.html0000644000076400007640000000714511006707253020071 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Gnuplot/gp_cygwin.py

Gnuplot / gp_cygwin.py 

Functions   
  test_persist 
test_persist ()

Mac doesn't recognize persist.

Classes   

GnuplotOpts

GnuplotProcess


This document was automatically generated Fri May 2 16:59:07 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/RELEASES.html0000644000076400007640000000721111006707252017277 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Gnuplot/RELEASES.txt

Gnuplot / RELEASES.txt 

# $Id: RELEASES.txt 306 2008-05-02 01:09:02Z alford $

These are my notes about the steps to make a new release of Gnuplot.py.

  1. Edit the following files for the release:
    NEWS.txt
    add the version number at the top of the file and make sure that the comments are up-to-date.
    ANNOUNCE.txt
    add the version number at the top of the file and update the blurbs as appropriate.
    Gnuplot.html
    update the version number where it appears. Update the "News" section.
    __init__.py
    increment the __version__ string. No "+" on the end.
  2. Check the changes into Subversion. $ svn commit -m "Official version 1.8"
  3. Tag the release in Subversion: $ svn cp https://gnuplot-py.svn.sourceforge.net/svnroot/gnuplot-py/trunk \ https://gnuplot-py.svn.sourceforge.net/svnroot/gnuplot-py/tags/release-1.8 -m "Adding tag for release 1.8."
  4. Create new documentation using happydoc:

    $ rm -rf doc $ ( cd .. ; happydoc -d Gnuplot/doc -t Gnuplot.py \ --author=Michael Haggerty <mhagger@alum.mit.edu> Gnuplot )

  5. Generate the source distributions:

    $ python2 ./setup.py sdist --formats=gztar,zip

  6. [OMIT THIS] Generate the binary distributions. [I don't think a binary distribution is worthwhile because the place that the files need to be installed is dependent on the version of python being used.]

    $ python2 ./setup.py bdist --format=gztar,zip,rpm,wininst

  7. Release the files on SourceForge:
    1. Go to the "Admin" page.
    2. Go to the "File release system" page.
    3. Click on "Add Release" for package Gnuplot-py.
    4. Type a release name of the form "1.8".
    5. Paste the "New features in this version" section of ANNOUNCE.txt into the "release notes" text box.
    6. Follow the instructions to release the files.
    7. Send an email to people monitoring the project with the button at the bottom of the release page.
  8. Send an announcement to gnuplot-py-users.
  9. Send an announcement to comp.lang.python.
  10. Append a + to the __version__ string in __init__.py to distinguish intermediate Subversion releases from official releases. Add a "Version ?.?:" line to NEWS.txt to receive future change notes. Check the changes into Subversion.

This document was automatically generated Fri May 2 16:59:06 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/gp_java.html0000644000076400007640000000736411006707252017514 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Gnuplot/gp_java.py

Gnuplot / gp_java.py 

Functions   
  test_persist 
test_persist ()
Classes   

GnuplotOpts

OutputProcessor

GnuplotProcess


This document was automatically generated Fri May 2 16:59:06 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/gp_java.py/0000755000076400007640000000000011006707732017246 5ustar alfordalfordgnuplot-py-1.8/doc/Gnuplot/gp_java.py/GnuplotProcess.html0000644000076400007640000001514211006707252023123 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Class: GnuplotProcess

Gnuplot / gp_java.py / GnuplotProcess 

Methods   
  __del__ 
__del__ ( self )
  write 
write ( self,  s )
  flush 
flush ( self )
  __call__ 
__call__ ( self,  s )
  close 
close ( self )
  __init__ 
__init__ ( self,  persist=None )
Exceptions   

( '-persist does not seem to be supported ' 'by your version of gnuplot!' )


This document was automatically generated Fri May 2 16:59:06 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/gp_java.py/GnuplotOpts.html0000644000076400007640000000233711006707252022434 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Class: GnuplotOpts

Gnuplot / gp_java.py / GnuplotOpts 


This document was automatically generated Fri May 2 16:59:06 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/gp_java.py/OutputProcessor.html0000644000076400007640000000637311006707252023342 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Class: OutputProcessor

Gnuplot / gp_java.py / OutputProcessor 

Methods   
  run 
run ( self )
  __init__ 
__init__ (
        self,
        name,
        input,
        output,
        )

This document was automatically generated Fri May 2 16:59:06 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/PlotItems.html0000644000076400007640000002030411006707252020012 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Gnuplot/PlotItems.py

Gnuplot / PlotItems.py 

Functions   
  GridData 
GridData (
        data,
        xvals=None,
        yvals=None,
        inline=None,
        filename=None,
        **keyw,
        )
Exceptions   

Errors.DataError( 'The size of yvals must be the same as the size of ' 'the second dimension of the data array' )
Errors.OptionError( 'binary inline data not supported' )
Errors.DataError( 'The size of xvals must be the same as the size of ' 'the first dimension of the data array' )
Errors.OptionError( 'cannot pass data both inline and via a file' )
Errors.DataError( 'data array must be two-dimensional' )

  Data 
Data ( *data,  *keyw )
Exceptions   

Errors.OptionError( 'cannot pass data both inline and via a file' )

  File 
File ( filename,  **keyw )
Exceptions   

Errors.OptionError('Argument (%s) must be a filename' %( filename, ) )

Classes   

PlotItem

_NewFileItem

_FileItem

_unset

_InlineFileItem

Func


This document was automatically generated Fri May 2 16:59:06 2008 by HappyDoc version 3.1 gnuplot-py-1.8/doc/Gnuplot/gnuplot_Suites.html0000644000076400007640000001363311006707253021126 0ustar alfordalford HappyDoc Generated Documentation
HappyDoc Generated Documentation Gnuplot/gnuplot_Suites.py

Gnuplot / gnuplot_Suites.py 

Classes   

titled

modified

repeated property name the title of the document

visible

floating

index

graph

Standard_Suite

application

window

zoomed

document

Miscellaneous_Events

picture

gnuplot_Suite

resizable

zoomable

name

bounds

odds_and_ends

modal

position

closeable


This document was automatically generated Fri May 2 16:59:07 2008 by HappyDoc version 3.1 gnuplot-py-1.8/README.txt0000644000076400007640000002053611006462763014521 0ustar alfordalfordGnuplot.py -- A pipe-based interface to the gnuplot plotting program. The Gnuplot.py home page is http://gnuplot-py.sourceforge.net There you can get the latest version, view the documentation, or report bugs. There is also a mailing list for Gnuplot.py users. You can subscribe to the mailing list or view the archive of old articles at http://lists.sourceforge.net/mailman/listinfo/gnuplot-py-users Documentation ------------- The quickest way to learn how to use Gnuplot.py is to install it and run the simple demonstration by typing `python demo.py', then look at the demo.py file to see the commands that created the demo. One of the examples is probably similar to what you want to do. Don't forget to read the Gnuplot.html, README.txt, and FAQ.txt files in the Gnuplot.py distribution. HTML documentation for the Python classes is included in the doc/ directory of the distribution and is also available online (follow links from the home page). This documentation is extracted automatically from the package's docstrings using happydoc and should be helpful though it is known to have some formatting problems. Alternatively, you can look at the docstrings yourself by opening the python files in an editor. Finally, there is a new mailing list for Gnuplot.py users. For more information about subscribing to the list or viewing the archive of old articles, please go to http://lists.sourceforge.net/lists/listinfo/gnuplot-py-users To get good use out of Gnuplot.py, you will want to know something about gnuplot, for which a good source is the gnuplot help (run gnuplot then type `help', or read it online at http://www.gnuplot.info/gnuplot.html ). For a relatively thorough test of Gnuplot.py, type `python test.py' which goes systematically through most Gnuplot.py features. Installation ------------ Quick instructions: 1. Download gnuplot-py-1.8.tar.gz or gnuplot-py-1.8.zip. 2. Extract the archive to a temporary directory. 3. Install by changing to the directory and typing "python setup.py install". More information: Obviously, you must have the gnuplot program if Gnuplot.py is to be of any use to you. Gnuplot can be obtained via . You also need a copy of the numpy package, which is available from the Scipy group at . Gnuplot.py uses Python distutils and can be installed by untarring the package, changing into the top-level directory, and typing "python setup.py install". The Gnuplot.py package is pure Python--no compilation is necessary. Gnuplot.py is structured as a python package. That means that it installs itself as a subdirectory called `Gnuplot' under a directory of your python path (usually site-packages). If you don't want to use distutils you can just move the main Gnuplot.py directory there and rename it to "Gnuplot". There are some configuration options that can be set near the top of the platform-dependent files gp-unix.py (Unix), gp_mac.py (Macintosh), gp_macosx.py (Mac OS X), gp_win32.py (Windows), and gp_java.py (Jython/Java). (Obviously, you should change the file corresponding to your platform.) See the extensive comments in gp_unix.py for a description of the meaning of each configuration variable. Sensible values are already chosen, so it is quite possible that you don't have to change anything. Import the main part of the package into your python programs using `import Gnuplot'. Some other features can be found in the modules Gnuplot.funcutils and Gnuplot.PlotItems. Installation via RPM (for Linux/Unix) ------------------------------------- I decided that it doesn't make sense to package up RPM versions of Gnuplot.py, since the place where the files need to be installed depends on what version of Python you are using. But if you want the benefits of RPM management, it's easy for you to create your own RPM from the source distribution then install the RPM: 1. Change into the source directory. 2. Create the RPM: $ python ./setup.py bdist --format=rpm 3. Install it (as root): # rpm -ivh dist/gnuplot-py-1.7-1.noarch.rpm Installation on Windows ----------------------- I don't run Windows, but thanks to the help of users there is now a way to use Gnuplot.py on that platform. Any feedback or additional suggestions having to do with Windows would be especially appreciated. Because the main MS-Windows gnuplot executable (wgnuplot.exe) doesn't accept commands on standard input, Gnuplot.py cannot communicate with it directly. However, there is a simple little program called `pgnuplot.exe' that accepts commands on stdin and passes them to wgnuplot. So to run Gnuplot.py on Windows, you need to make sure that pgnuplot.exe is installed. It comes with gnuplot since at least version 3.7.1. Alternatively you can get pgnuplot.exe alone by downloading `testing/windows-stdin.zip' from one of the gnuplot archives (e.g., ). Continue installing Gnuplot.py by following the instructions in the previous section. Installation on the Macintosh ----------------------------- Thanks to more user help, Gnuplot.py should work on the Macintosh too. (Here I am referring to Mac OS versions prior to OS X; OS X is unix so no special considerations apply there.) Since pipes don't exist on the Mac, communication with gnuplot is via a python module called gnuplot_Suites.py (included) which uses AppleEvents. Note that you will have to convert the python files to Mac text files (different end-of-line character). Currently it is not possible to print directly to a printer; however, it should be possible to print to a postscript file and print that file manually. Also, inline data does not seem to be supported. Let me know if you find other problems or have patches to fix Mac limitations. Assistance ---------- If you are having trouble installing or using Gnuplot.py, please check the following sources for help: 1. Read the documentation! For simple questions, start with the Gnuplot.html, README.txt, and FAQ.txt files in the distribution. For more detailed information, check the online class documentation at http://gnuplot-py.sourceforge.net/doc/ 2. Check the mailing list archives. Chances are that somebody has already asked a similar questions and you are one quick search away from the answer. Information about the mailing list is available at http://lists.sourceforge.net/mailman/listinfo/gnuplot-py-users 3. Ask your question on the mailing list. I am trying to move most email traffic about Gnuplot.py to the mailing list, partly because there are many questions (for example about Windows or Macintosh platforms) that I am completely unable to answer. The mailing list also provides an archive of old articles which should build up into a valuable resource, and a place to exchange ideas about future changes. Feedback -------- I would love to have feedback from people letting me know whether they find Gnuplot.py useful. And certainly let me know about any problems, suggestions, or enhancements. For most purposes, please send your emails to the Gnuplot.py users mailing list: gnuplot-py-users@lists.sourceforge.net Information about the mailing list can be obtained at http://lists.sourceforge.net/mailman/listinfo/gnuplot-py-users Compatibility ------------- Gnuplot.py has been tested with version 3.7 of gnuplot, and I believe it should work with version 3.5 (though some features, like enhanced postscript mode and binary splot mode, will not work). Let me know if you have trouble. Gnuplot.py was developed under Linux and Digital Unix; it should work without much problem on other versions of Unix. If you need to modify it for your system tell me what was necessary and I'll include your changes in a future release. Gnuplot.py should also work under Windows and Macintosh (see above). Feedback for these platforms is especially appreciated since I can't test them myself. License ------- See the file LICENSE.txt for license info. In brief, Gnuplot is LGPL. Credits ------- See CREDITS.txt for a list of people who have contributed code and/or ideas to Gnuplot.py. Thanks especially to Konrad Hinsen , who wrote the first, procedural interface version of Gnuplot.py. -- Michael Haggerty (But please use the mailing list for Gnuplot.py-related issues.) gnuplot-py-1.8/PKG-INFO0000644000076400007640000000061711006707732014114 0ustar alfordalfordMetadata-Version: 1.0 Name: gnuplot-py Version: 1.8 Summary: A Python interface to the gnuplot plotting program. Home-page: http://gnuplot-py.sourceforge.net Author: Michael Haggerty Author-email: mhagger@alum.mit.edu License: LGPL Description: Gnuplot.py is a Python package that allows you to create graphs from within Python using the gnuplot plotting program. Platform: UNKNOWN gnuplot-py-1.8/.happydoc.gp_win32.py0000644000076400007640000000475711006707250016711 0ustar alfordalford(S'5e8718907d0003a0b02a0ea6e4032793' p1 (ihappydoclib.parseinfo.moduleinfo ModuleInfo p2 (dp3 S'_namespaces' p4 ((dp5 S'GnuplotOpts' p6 (ihappydoclib.parseinfo.classinfo ClassInfo p7 (dp8 g4 ((dp9 (dp10 tp11 sS'_filename' p12 S'Gnuplot/gp_win32.py' p13 sS'_docstring' p14 S'' sS'_class_member_info' p15 (lp16 sS'_name' p17 g6 sS'_parent' p18 g2 sS'_comment_info' p19 (dp20 (S'test_persist' tp21 S" Mac doesn't recognize persist.\n" p22 ssS'_base_class_info' p23 (lp24 sS'_configuration_values' p25 (dp26 sS'_class_info' p27 g9 sS'_function_info' p28 g10 sS'_comments' p29 S'' sbsS'GnuplotProcess' p30 (ihappydoclib.parseinfo.classinfo ClassInfo p31 (dp32 g4 ((dp33 (dp34 S'__del__' p35 (ihappydoclib.parseinfo.functioninfo FunctionInfo p36 (dp37 g4 ((dp38 (dp39 tp40 sS'_exception_info' p41 (dp42 sS'_parameter_names' p43 (S'self' p44 tp45 sS'_parameter_info' p46 (dp47 g44 (NNNtp48 ssg12 g13 sg14 S'' sg17 g35 sg18 g31 sg19 g20 sg25 (dp49 sg27 g38 sg28 g39 sg29 S'' sbsS'close' p50 (ihappydoclib.parseinfo.functioninfo FunctionInfo p51 (dp52 g4 ((dp53 (dp54 tp55 sg41 (dp56 sg43 (S'self' p57 tp58 sg46 (dp59 g57 (NNNtp60 ssg12 g13 sg14 S'' sg17 g50 sg18 g31 sg19 g20 sg25 (dp61 sg27 g53 sg28 g54 sg29 S'' sbsS'__init__' p62 (ihappydoclib.parseinfo.functioninfo FunctionInfo p63 (dp64 g4 ((dp65 (dp66 tp67 sg41 (dp68 S"Errors.OptionError( '-persist is not supported under Windows!' )" p69 Nssg43 (S'self' p70 S'persist' p71 tp72 sg46 (dp73 g70 (NNNtp74 sg71 (I1 NNtp75 ssg12 g13 sg14 S'' sg17 g62 sg18 g31 sg19 g20 sg25 (dp76 sg27 g65 sg28 g66 sg29 S'' sbsS'__call__' p77 (ihappydoclib.parseinfo.functioninfo FunctionInfo p78 (dp79 g4 ((dp80 (dp81 tp82 sg41 (dp83 sg43 (S'self' p84 S's' tp85 sg46 (dp86 g84 (NNNtp87 sS's' (NNNtp88 ssg12 g13 sg14 S'' sg17 g77 sg18 g31 sg19 g20 sg25 (dp89 sg27 g80 sg28 g81 sg29 S'' sbstp90 sg12 g13 sg14 S'' sg15 (lp91 sg17 g30 sg18 g2 sg19 g20 sg23 (lp92 sg25 (dp93 sg27 g33 sg28 g34 sg29 S'' sbs(dp94 S'test_persist' p95 (ihappydoclib.parseinfo.functioninfo FunctionInfo p96 (dp97 g4 ((dp98 (dp99 tp100 sg41 (dp101 sg43 (tsg46 (dp102 sg12 g13 sg14 S'' sg17 g95 sg18 g2 sg19 g20 sg25 (dp103 sg27 g98 sg28 g99 sg29 g22 sbstp104 sS'_import_info' p105 (ihappydoclib.parseinfo.imports ImportInfo p106 (dp107 S'_named_imports' p108 (dp109 sS'_straight_imports' p110 (lp111 sbsg12 g13 sg14 S'' sg17 S'gp_win32' p112 sg18 Nsg19 g20 sg25 (dp113 S'include_comments' p114 I1 sS'cacheFilePrefix' p115 S'.happydoc.' p116 sS'useCache' p117 I1 sS'docStringFormat' p118 S'StructuredText' p119 ssg27 g5 sg28 g94 sg29 S'' sbt.gnuplot-py-1.8/TODO.txt0000644000076400007640000000335311006462763014327 0ustar alfordalford$Id: TODO.txt 294 2006-11-07 02:33:08Z parejkoj $ Some ideas for future work. I don't know whether I'll get around to any of these items; some of them are probably better left undone anyway. Of course if anybody else wants to take one up... * Implement missing values. Gnuplot allows you to specify that values are missing from data files via the `set missing' command. This should probably be implemented via Numeric's masked arrays. (Comments?) The real benefit of dealing with values is that (I think) gnuplot can still put a mesh on a surface even if the surface has holes. * Figure out how to suck gnuplot error messages back into Python and turn them into exceptions. This would be tricky: for one thing, not all gnuplot output is indicative of an error. Moreover, implementation on Windows and Mac would require additional effort to change their GnuplotProcess classes. The output from the 'show' command could be processed in a similar manner. * Implement multiple graphs on a single page. I haven't used this feature of gnuplot much myself, so I'm not sure how difficult it would be to build it into the Gnuplot.py framework. Ideally one would like to be able to spawn multiple GnuplotWindow's from a single Gnuplot instance, each one behaving much like a Gnuplot object. Or maybe treat sub-windows as a kind of meta-PlotItem that can itself contain PlotItems. * Add a way to use Gnuplot.py without Numeric. This would probably not require too much work, and would also be convenient for Jython users since JNumeric is not as far along as Numeric. * Support gnuplot's new abilities to allow user interaction via the mouse. I believe this will require 2-way communication between Gnuplot.py and gnuplot. gnuplot-py-1.8/.happydoc.test.py0000644000076400007640000000222711006707251016227 0ustar alfordalford(S'982ad2e328ef6089a0b108c4e04fd58a' p1 (ihappydoclib.parseinfo.moduleinfo ModuleInfo p2 (dp3 S'_namespaces' p4 ((dp5 (dp6 S'main' p7 (ihappydoclib.parseinfo.functioninfo FunctionInfo p8 (dp9 g4 ((dp10 (dp11 tp12 sS'_exception_info' p13 (dp14 sS'_parameter_names' p15 (tsS'_parameter_info' p16 (dp17 sS'_filename' p18 S'Gnuplot/test.py' p19 sS'_docstring' p20 S'' sS'_name' p21 g7 sS'_parent' p22 g2 sS'_comment_info' p23 (dp24 sS'_configuration_values' p25 (dp26 sS'_class_info' p27 g10 sS'_function_info' p28 g11 sS'_comments' p29 S'' sbsS'wait' p30 (ihappydoclib.parseinfo.functioninfo FunctionInfo p31 (dp32 g4 ((dp33 (dp34 tp35 sg13 (dp36 sg15 (S'str' p37 S'prompt' p38 tp39 sg16 (dp40 g38 (I1 NNtp41 sg37 (I1 NNtp42 ssg18 g19 sg20 S'' sg21 g30 sg22 g2 sg23 g24 sg25 (dp43 sg27 g33 sg28 g34 sg29 S'' sbstp44 sS'_import_info' p45 (ihappydoclib.parseinfo.imports ImportInfo p46 (dp47 S'_named_imports' p48 (dp49 sS'_straight_imports' p50 (lp51 sbsg18 g19 sg20 S'' sg21 S'test' p52 sg22 Nsg23 g24 sg25 (dp53 S'include_comments' p54 I1 sS'cacheFilePrefix' p55 S'.happydoc.' p56 sS'useCache' p57 I1 sS'docStringFormat' p58 S'StructuredText' p59 ssg27 g5 sg28 g6 sg29 S'' sbt.gnuplot-py-1.8/NEWS.txt0000644000076400007640000002215111006462763014333 0ustar alfordalford$Id: NEWS.txt 302 2008-01-14 22:15:19Z bmcage $ This file describes the changes introduced in each version of the Gnuplot.py package. Version ?.? Version 1.8: * hardcopy allows for terminal='svg' (using a patch from Spyros Blanas) * Use with_ instead of with as that will be a python keyword in the future. * Added an option "filename" to Data and GridData in PlotItems.py. This allows saving the data to a permanent, rather than temporary, file. (Patch contributed by Matthew Fulmer.) * Added a 'pdf' terminal definition (using a patch from Jim Kleckner). * Added close() and __del__() methods to the Gnuplot class. This might help with some cases of premature temporary file deletion. (Suggested by Jim Kleckner.) Version 1.7: * Relaxed license from GPL to LGPL. * Significant reorganization of PlotItem.py: + Deleted the AnyFile classes from PlotItem: AnyFile, TempFile, ArrayFile, and TempArrayFile. Those classes weren't pulling their weight. + Added a new _FileItem class to represent all forms of data that gnuplot treats as a file. + Added a new _TempFileItem class to represent PlotItems that are based on a temporary file. + Added a new _InlineFileItem class to represent PlotItems whose data is passed to gnuplot inline. + Changed PlotItems.File() and PlotItems.Data from classes into factory functions that produce instances of the classes mentioned above. * Slightly changed the PlotItem interface to support the new derived classes: + Removed the basecommand argument to the constructor. Instead added a get_base_command_string() method to retrieve that string. This function is not defined in PlotItem so it is added to the derived classes. (This function is used by _FIFOFileItem as the hook where _FIFOWriters are created. + Added a new get_command_option_string() method which abstracts out the construction of the option part of the command() method. * Added support for sending data to gnuplot via FIFOs (named pipes) via a new _FIFOFileItem class. This mechanism removes the ambiguity about when temporary files should be deleted, therefore making it easier to use Gnuplot.py in script environments, etc. This feature is only implemented under *nix because Python doesn't implement the required threading module and os.mkfifo() on other operating systems. Added two new configuration options, support_fifo and prefer_fifo_data, to the gp_*.py files to switch the new feature on and off. * Started adding support for running Gnuplot.py under Jython/Java. Added gp_java.py, which is a functioning low-level interface to gnuplot via java.lang.Process objects. The rest might work, too, if you have JNumeric installed. (Gnuplot.py relies on the Numeric library; JNumeric is the Jython equivalent.) If I find the time I might try to produce a version that doesn't require Numeric at all, under either Python or Jython. * Removed the oldplot.py module: (1) I doubt anybody is still using it. (2) It seems to be broken anyway. (3) I don't have the energy to fix or maintain it. Let me know if I'm wrong about point 1. * Started a new FAQ.txt file and added an answer to the single most frequently asked question. Version 1.6: * Introduced a general mechanism to make it easy to support multiple gnuplot terminal types in the Gnuplot.hardcopy() function. Added definitions for 'postscript', 'png', 'fig', and 'cgm'. Other terminal types can now be added easily. * Changed names of Exceptions to be more consistent with other modules: OptionException -> OptionError and DataException -> DataError. Moved both to Errors.py and derive both from Errors.Error. * Incorporated several changes for Mac OS suggested by Jon Moody. * Added a gp_macosx.py file to support Mac OS X. The only difference between this and gp_unix.py is the default terminal selection. * Moved import statement in demo.py to global scope for Python 2.2. * Removed claims that demo.py can be run before installing Gnuplot.py. Version 1.5: * Broke up the module a bit for better maintainability. The most commonly-used facilities are still available through "import Gnuplot", but a few more specialized things have been moved to separate modules, in particular funcutils.py and PlotItems.py. __init__.py now just imports things from other modules. * funcutils.tabulate_function() can be used to evaluate a function on a 1-D or 2-D grid of points (this replaces grid_function, which only worked with 2-D grids). * Added two helper functions, funcutils.compute_Data and funcutils.compute_GridData, which compute a function's values on a set of points and package the results into a PlotItem. * GridFunc is no longer an independent class; it is now a factory function that returns a GridData. GridFunc is deprecated in favor of funcutils.compute_GridData. * Changed set_option to work from a table, so that it doesn't need to be overloaded so often. * Made changes like those submitted by Matthew Martin to allow the `smooth' option. * Implemented test_persist for each platform to make it easier for users to determine whether the `-persist' option is supported. * Added a prefer_persist option to serve as the default `persist' choice. * Following a suggestion by Jannie Hofmeyr , use "from os import popen" for Python 2.0 under Windows. I don't use Windows, so let me know how this works. * Added a setup.py file so that Gnuplot.py can be installed using Python distutils. * Added support for the `axes' parameter of the `plot' command. * Reworked the comment strings in an effort to make them work nicely with happydoc. Version 1.4: * Added support for the Macintosh, thanks to help from Tony Ingraldi. * Split the platform-dependent code, including the configuration options, into separate modules: gp.py, gp_mac.py, and gp_win32.py. The GnuplotProcess class defined in those files is a lightweight interface to the gnuplot program that could also conceivably be useful to somebody. * Allow access to all of the postscript printer driver options through the hardcopy() method. * Fixed an import problem in test.py. Version 1.3: * Converted to package format. The main file is now called __init__.py, so that it can be loaded by typing 'import Gnuplot'. * Passing GridData a callable function was basically broken because of the kludgey way of overloading the argument. Instead of trying to fix it, I moved that functionality to a new type of PlotItem called 'GridFunc'. * Added a new keyword argument, 'ufunc', to grid_function and to GridFunc. If that argument is nonzero, then the function is evaluated matrix-wise (in that case it must be composed only of ufunctions or ufunction-like routines). * Fixed a 'typecode' problem with grid_function (typecode is apparently a positional, not a keyword, argument in the Numeric library). * Separated the demonstration code into a separate file, demo.py, to shorten __init__.py a bit. Version 1.2 (8 Aug 1999): * Support for MS Windows, using the `pgnuplot.exe' program. Thanks go especially to Craig Schardt for help with this. * Support for using binary files to send grid data to splot. This saves a lot of time and usually saves space compared with the old text files. (Only works with recent versions of gnuplot.) * Support for sending data to gnuplot as `inline data' (i.e., "plot '-'"). This method should be faster than the alternate method, temporary files. (Only works with recent versions of gnuplot.) * Allows PlotItem options to be modified after the PlotItem is constructed. * Simplified the PlotItem inheritance hierarchy (Data and GridData are no longer derived from File). * Added several configuration options (see top of Gnuplot.py). * Separated function-based interface into a separate file (Gnuplot_plot.py). * Added a test module, Gnuplot_test.py, which tests most of the features of Gnuplot.py. * A README file, lots of documentation changes, etc. Version 1.1a (9 Apr 1999): This version just addresses a couple of minor portability issues. Version 1.1 (31 Jan 1999): * 3-D plots are now supported through the new 'splot' method: + To create a scatter plot, pass splot a 2-D array containing (x,y,z) triplets; + To create a grid plot, pass a 3-D array consisting of a 2-D array of (x,y,z) triplets; or + Use the new `GridData' PlotItem to plot gridded data (data tabulated on a rectangular grid). * It is now easier to pass data to gnuplot. The 'Data' PlotItem now accepts multiple arguments representing subsequent 'columns' of the dataset; e.g., what used to be written as g = Gnuplot.Gnuplot() x = numpy.arange(100)/10.0 y = x**2 # Create an array of (x,y) pairs: g.plot(Gnuplot.Data(numpy.transpose((x, y)))) can now be shortened to # Plot y vs. x directly: g.plot(Gnuplot.Data(x, y)) (both examples plot x squared vs. x). Similarly, splot can be passed three arrays representing the values of x, y, and z. Note that the old interpretation is still used if a single argument is passed to `Data'. gnuplot-py-1.8/.happydoc.gp_unix.py0000644000076400007640000000466611006707251016732 0ustar alfordalford(S'733b69b34f37336d33b053ab7c152202' p1 (ihappydoclib.parseinfo.moduleinfo ModuleInfo p2 (dp3 S'_namespaces' p4 ((dp5 S'GnuplotOpts' p6 (ihappydoclib.parseinfo.classinfo ClassInfo p7 (dp8 g4 ((dp9 (dp10 tp11 sS'_filename' p12 S'Gnuplot/gp_unix.py' p13 sS'_docstring' p14 S'' sS'_class_member_info' p15 (lp16 sS'_name' p17 g6 sS'_parent' p18 g2 sS'_comment_info' p19 (dp20 sS'_base_class_info' p21 (lp22 sS'_configuration_values' p23 (dp24 sS'_class_info' p25 g9 sS'_function_info' p26 g10 sS'_comments' p27 S'' sbsS'GnuplotProcess' p28 (ihappydoclib.parseinfo.classinfo ClassInfo p29 (dp30 g4 ((dp31 (dp32 S'__del__' p33 (ihappydoclib.parseinfo.functioninfo FunctionInfo p34 (dp35 g4 ((dp36 (dp37 tp38 sS'_exception_info' p39 (dp40 sS'_parameter_names' p41 (S'self' p42 tp43 sS'_parameter_info' p44 (dp45 g42 (NNNtp46 ssg12 g13 sg14 S'' sg17 g33 sg18 g29 sg19 g20 sg23 (dp47 sg25 g36 sg26 g37 sg27 S'' sbsS'close' p48 (ihappydoclib.parseinfo.functioninfo FunctionInfo p49 (dp50 g4 ((dp51 (dp52 tp53 sg39 (dp54 sg41 (S'self' p55 tp56 sg44 (dp57 g55 (NNNtp58 ssg12 g13 sg14 S'' sg17 g48 sg18 g29 sg19 g20 sg23 (dp59 sg25 g51 sg26 g52 sg27 S'' sbsS'__init__' p60 (ihappydoclib.parseinfo.functioninfo FunctionInfo p61 (dp62 g4 ((dp63 (dp64 tp65 sg39 (dp66 S"( '-persist does not seem to be supported ' 'by your version of gnuplot!' )" p67 Nssg41 (S'self' p68 S'persist' p69 tp70 sg44 (dp71 g68 (NNNtp72 sg69 (I1 NNtp73 ssg12 g13 sg14 S'' sg17 g60 sg18 g29 sg19 g20 sg23 (dp74 sg25 g63 sg26 g64 sg27 S'' sbsS'__call__' p75 (ihappydoclib.parseinfo.functioninfo FunctionInfo p76 (dp77 g4 ((dp78 (dp79 tp80 sg39 (dp81 sg41 (S'self' p82 S's' tp83 sg44 (dp84 g82 (NNNtp85 sS's' (NNNtp86 ssg12 g13 sg14 S'' sg17 g75 sg18 g29 sg19 g20 sg23 (dp87 sg25 g78 sg26 g79 sg27 S'' sbstp88 sg12 g13 sg14 S'' sg15 (lp89 sg17 g28 sg18 g2 sg19 g20 sg21 (lp90 sg23 (dp91 sg25 g31 sg26 g32 sg27 S'' sbs(dp92 S'test_persist' p93 (ihappydoclib.parseinfo.functioninfo FunctionInfo p94 (dp95 g4 ((dp96 (dp97 tp98 sg39 (dp99 sg41 (tsg44 (dp100 sg12 g13 sg14 S'' sg17 g93 sg18 g2 sg19 g20 sg23 (dp101 sg25 g96 sg26 g97 sg27 S'' sbstp102 sS'_import_info' p103 (ihappydoclib.parseinfo.imports ImportInfo p104 (dp105 S'_named_imports' p106 (dp107 sS'_straight_imports' p108 (lp109 sbsg12 g13 sg14 S'' sg17 S'gp_unix' p110 sg18 Nsg19 g20 sg23 (dp111 S'include_comments' p112 I1 sS'cacheFilePrefix' p113 S'.happydoc.' p114 sS'useCache' p115 I1 sS'docStringFormat' p116 S'StructuredText' p117 ssg25 g5 sg26 g92 sg27 S'' sbt.gnuplot-py-1.8/.happydoc._Gnuplot.py0000644000076400007640000002271411006707251017042 0ustar alfordalford(S'a1efc500dd62886a68391f573c2847fe' p1 (ihappydoclib.parseinfo.moduleinfo ModuleInfo p2 (dp3 S'_namespaces' p4 ((dp5 S'Gnuplot' p6 (ihappydoclib.parseinfo.classinfo ClassInfo p7 (dp8 g4 ((dp9 (dp10 S'load' p11 (ihappydoclib.parseinfo.functioninfo FunctionInfo p12 (dp13 g4 ((dp14 (dp15 tp16 sS'_exception_info' p17 (dp18 sS'_parameter_names' p19 (S'self' p20 S'filename' p21 tp22 sS'_parameter_info' p23 (dp24 g20 (NNNtp25 sg21 (NNNtp26 ssS'_filename' p27 S'Gnuplot/_Gnuplot.py' p28 sS'_docstring' p29 S'' sS'_name' p30 g11 sS'_parent' p31 g7 sS'_comment_info' p32 (dp33 sS'_configuration_values' p34 (dp35 sS'_class_info' p36 g14 sS'_function_info' p37 g15 sS'_comments' p38 S'' sbsS'set' p39 (ihappydoclib.parseinfo.functioninfo FunctionInfo p40 (dp41 g4 ((dp42 (dp43 tp44 sg17 (dp45 S"'option %s is not supported' %( k, )" p46 Nssg19 (S'self' p47 S'**keyw' p48 tp49 sg23 (dp50 g47 (NNNtp51 sg48 (NNNtp52 ssg27 g28 sg29 S'' sg30 g39 sg31 g7 sg32 g33 sg34 (dp53 sg36 g42 sg37 g43 sg38 S'' sbsS'_add_to_queue' p54 (ihappydoclib.parseinfo.functioninfo FunctionInfo p55 (dp56 g4 ((dp57 (dp58 tp59 sg17 (dp60 sg19 (S'self' p61 S'items' p62 tp63 sg23 (dp64 g62 (NNNtp65 sg61 (NNNtp66 ssg27 g28 sg29 S'' sg30 g54 sg31 g7 sg32 g33 sg34 (dp67 sg36 g57 sg37 g58 sg38 S'' sbsS'replot' p68 (ihappydoclib.parseinfo.functioninfo FunctionInfo p69 (dp70 g4 ((dp71 (dp72 tp73 sg17 (dp74 sg19 (S'self' p75 S'*items' p76 S'*keyw' p77 tp78 sg23 (dp79 g76 (NNNtp80 sg75 (NNNtp81 sg77 (NNNtp82 ssg27 g28 sg29 S'' sg30 g68 sg31 g7 sg32 g33 sg34 (dp83 sg36 g71 sg37 g72 sg38 S'' sbsS'set_label' p84 (ihappydoclib.parseinfo.functioninfo FunctionInfo p85 (dp86 g4 ((dp87 (dp88 tp89 sg17 (dp90 sg19 (S'self' p91 S'option' p92 S's' S'offset' p93 S'font' p94 tp95 sg23 (dp96 S's' (I1 NNtp97 sg91 (NNNtp98 sg94 (I1 NNtp99 sg92 (NNNtp100 sg93 (I1 NNtp101 ssg27 g28 sg29 S'' sg30 g84 sg31 g7 sg32 g33 sg34 (dp102 sg36 g87 sg37 g88 sg38 S'' sbsS'set_boolean' p103 (ihappydoclib.parseinfo.functioninfo FunctionInfo p104 (dp105 g4 ((dp106 (dp107 tp108 sg17 (dp109 sg19 (S'self' p110 S'option' p111 S'value' p112 tp113 sg23 (dp114 g110 (NNNtp115 sg111 (NNNtp116 sg112 (NNNtp117 ssg27 g28 sg29 S'' sg30 g103 sg31 g7 sg32 g33 sg34 (dp118 sg36 g106 sg37 g107 sg38 S'' sbsS'close' p119 (ihappydoclib.parseinfo.functioninfo FunctionInfo p120 (dp121 g4 ((dp122 (dp123 tp124 sg17 (dp125 sg19 (S'self' p126 tp127 sg23 (dp128 g126 (NNNtp129 ssg27 g28 sg29 S'' sg30 g119 sg31 g7 sg32 g33 sg34 (dp130 sg36 g122 sg37 g123 sg38 S'' sbsS'__init__' p131 (ihappydoclib.parseinfo.functioninfo FunctionInfo p132 (dp133 g4 ((dp134 (dp135 tp136 sg17 (dp137 S"Errors.OptionError( 'Gnuplot with output to file does not allow ' 'persist option.' )" p138 Nssg19 (S'self' p139 S'filename' p140 S'persist' p141 S'debug' p142 tp143 sg23 (dp144 g142 (I1 NNtp145 sg139 (NNNtp146 sg141 (I1 NNtp147 sg140 (I1 NNtp148 ssg27 g28 sg29 S'' sg30 g131 sg31 g7 sg32 g33 sg34 (dp149 sg36 g134 sg37 g135 sg38 S'' sbsS'plot' p150 (ihappydoclib.parseinfo.functioninfo FunctionInfo p151 (dp152 g4 ((dp153 (dp154 tp155 sg17 (dp156 sg19 (S'self' p157 S'*items' p158 S'*keyw' p159 tp160 sg23 (dp161 g158 (NNNtp162 sg157 (NNNtp163 sg159 (NNNtp164 ssg27 g28 sg29 S'' sg30 g150 sg31 g7 sg32 g33 sg34 (dp165 sg36 g153 sg37 g154 sg38 S'' sbsS'set_range' p166 (ihappydoclib.parseinfo.functioninfo FunctionInfo p167 (dp168 g4 ((dp169 (dp170 tp171 sg17 (dp172 sg19 (S'self' p173 S'option' p174 S'value' p175 tp176 sg23 (dp177 g173 (NNNtp178 sg174 (NNNtp179 sg175 (NNNtp180 ssg27 g28 sg29 S'' sg30 g166 sg31 g7 sg32 g33 sg34 (dp181 sg36 g169 sg37 g170 sg38 S'' sbsS'interact' p182 (ihappydoclib.parseinfo.functioninfo FunctionInfo p183 (dp184 g4 ((dp185 (dp186 tp187 sg17 (dp188 sg19 (S'self' p189 tp190 sg23 (dp191 g189 (NNNtp192 ssg27 g28 sg29 S'' sg30 g182 sg31 g7 sg32 g33 sg34 (dp193 sg36 g185 sg37 g186 sg38 S'' sbsS'ylabel' p194 (ihappydoclib.parseinfo.functioninfo FunctionInfo p195 (dp196 g4 ((dp197 (dp198 tp199 sg17 (dp200 sg19 (S'self' p201 S's' S'offset' p202 S'font' p203 tp204 sg23 (dp205 g201 (NNNtp206 sg203 (I1 NNtp207 sS's' (I1 NNtp208 sg202 (I1 NNtp209 ssg27 g28 sg29 S'' sg30 g194 sg31 g7 sg32 g33 sg34 (dp210 sg36 g197 sg37 g198 sg38 S'' sbsS'__call__' p211 (ihappydoclib.parseinfo.functioninfo FunctionInfo p212 (dp213 g4 ((dp214 (dp215 tp216 sg17 (dp217 sg19 (S'self' p218 S's' tp219 sg23 (dp220 g218 (NNNtp221 sS's' (NNNtp222 ssg27 g28 sg29 S'' sg30 g211 sg31 g7 sg32 g33 sg34 (dp223 sg36 g214 sg37 g215 sg38 S'' sbsS'save' p224 (ihappydoclib.parseinfo.functioninfo FunctionInfo p225 (dp226 g4 ((dp227 (dp228 tp229 sg17 (dp230 sg19 (S'self' p231 S'filename' p232 tp233 sg23 (dp234 g231 (NNNtp235 sg232 (NNNtp236 ssg27 g28 sg29 S'' sg30 g224 sg31 g7 sg32 g33 sg34 (dp237 sg36 g227 sg37 g228 sg38 S'' sbsS'__del__' p238 (ihappydoclib.parseinfo.functioninfo FunctionInfo p239 (dp240 g4 ((dp241 (dp242 tp243 sg17 (dp244 sg19 (S'self' p245 tp246 sg23 (dp247 g245 (NNNtp248 ssg27 g28 sg29 S'' sg30 g238 sg31 g7 sg32 g33 sg34 (dp249 sg36 g241 sg37 g242 sg38 S'' sbsS'zlabel' p250 (ihappydoclib.parseinfo.functioninfo FunctionInfo p251 (dp252 g4 ((dp253 (dp254 tp255 sg17 (dp256 sg19 (S'self' p257 S's' S'offset' p258 S'font' p259 tp260 sg23 (dp261 g257 (NNNtp262 sg259 (I1 NNtp263 sS's' (I1 NNtp264 sg258 (I1 NNtp265 ssg27 g28 sg29 S'' sg30 g250 sg31 g7 sg32 g33 sg34 (dp266 sg36 g253 sg37 g254 sg38 S'' sbsS'hardcopy' p267 (ihappydoclib.parseinfo.functioninfo FunctionInfo p268 (dp269 g4 ((dp270 (dp271 tp272 sg17 (dp273 S'Errors.OptionError(\'Terminal "%s" is not configured in Gnuplot.py.\' %( terminal, ) )' p274 NsS"Errors.OptionError( 'default_lpr is not set, so you can only print to a file.' )" p275 NsS"Errors.OptionError('The following options are unrecognized: %s' %( string.join( keyw.keys(), ', ' ), ) )" p276 Nssg19 (S'self' p277 S'filename' p278 S'terminal' p279 S'**keyw' p280 tp281 sg23 (dp282 g279 (I1 NNtp283 sg277 (NNNtp284 sg280 (NNNtp285 sg278 (I1 NNtp286 ssg27 g28 sg29 S'' sg30 g267 sg31 g7 sg32 g33 sg34 (dp287 sg36 g270 sg37 g271 sg38 S'' sbsS'splot' p288 (ihappydoclib.parseinfo.functioninfo FunctionInfo p289 (dp290 g4 ((dp291 (dp292 tp293 sg17 (dp294 sg19 (S'self' p295 S'*items' p296 S'*keyw' p297 tp298 sg23 (dp299 g296 (NNNtp300 sg295 (NNNtp301 sg297 (NNNtp302 ssg27 g28 sg29 S'' sg30 g288 sg31 g7 sg32 g33 sg34 (dp303 sg36 g291 sg37 g292 sg38 S'' sbsS'set_string' p304 (ihappydoclib.parseinfo.functioninfo FunctionInfo p305 (dp306 g4 ((dp307 (dp308 tp309 sg17 (dp310 sg19 (S'self' p311 S'option' p312 S's' tp313 sg23 (dp314 S's' (I1 NNtp315 sg311 (NNNtp316 sg312 (NNNtp317 ssg27 g28 sg29 S'' sg30 g304 sg31 g7 sg32 g33 sg34 (dp318 sg36 g307 sg37 g308 sg38 S'' sbsS'_clear_queue' p319 (ihappydoclib.parseinfo.functioninfo FunctionInfo p320 (dp321 g4 ((dp322 (dp323 tp324 sg17 (dp325 sg19 (S'self' p326 tp327 sg23 (dp328 g326 (NNNtp329 ssg27 g28 sg29 S'' sg30 g319 sg31 g7 sg32 g33 sg34 (dp330 sg36 g322 sg37 g323 sg38 S'' sbsS'reset' p331 (ihappydoclib.parseinfo.functioninfo FunctionInfo p332 (dp333 g4 ((dp334 (dp335 tp336 sg17 (dp337 sg19 (S'self' p338 tp339 sg23 (dp340 g338 (NNNtp341 ssg27 g28 sg29 S'' sg30 g331 sg31 g7 sg32 g33 sg34 (dp342 sg36 g334 sg37 g335 sg38 S'' sbsS'clear' p343 (ihappydoclib.parseinfo.functioninfo FunctionInfo p344 (dp345 g4 ((dp346 (dp347 tp348 sg17 (dp349 sg19 (S'self' p350 tp351 sg23 (dp352 g350 (NNNtp353 ssg27 g28 sg29 S'' sg30 g343 sg31 g7 sg32 g33 sg34 (dp354 sg36 g346 sg37 g347 sg38 S'' sbsS'title' p355 (ihappydoclib.parseinfo.functioninfo FunctionInfo p356 (dp357 g4 ((dp358 (dp359 tp360 sg17 (dp361 sg19 (S'self' p362 S's' S'offset' p363 S'font' p364 tp365 sg23 (dp366 g362 (NNNtp367 sg364 (I1 NNtp368 sS's' (I1 NNtp369 sg363 (I1 NNtp370 ssg27 g28 sg29 S'' sg30 g355 sg31 g7 sg32 g33 sg34 (dp371 sg36 g358 sg37 g359 sg38 S'' sbsS'refresh' p372 (ihappydoclib.parseinfo.functioninfo FunctionInfo p373 (dp374 g4 ((dp375 (dp376 tp377 sg17 (dp378 sg19 (S'self' p379 tp380 sg23 (dp381 g379 (NNNtp382 ssg27 g28 sg29 S'' sg30 g372 sg31 g7 sg32 g33 sg34 (dp383 sg36 g375 sg37 g376 sg38 S'' sbsS'xlabel' p384 (ihappydoclib.parseinfo.functioninfo FunctionInfo p385 (dp386 g4 ((dp387 (dp388 tp389 sg17 (dp390 sg19 (S'self' p391 S's' S'offset' p392 S'font' p393 tp394 sg23 (dp395 g391 (NNNtp396 sg393 (I1 NNtp397 sS's' (I1 NNtp398 sg392 (I1 NNtp399 ssg27 g28 sg29 S'' sg30 g384 sg31 g7 sg32 g33 sg34 (dp400 sg36 g387 sg37 g388 sg38 S'' sbstp401 sg27 g28 sg29 S'' sS'_class_member_info' p402 (lp403 sg30 g6 sg31 g2 sg32 g33 sS'_base_class_info' p404 (lp405 sg34 (dp406 sg36 g9 sg37 g10 sg38 S'' sbsS'_GnuplotFile' p407 (ihappydoclib.parseinfo.classinfo ClassInfo p408 (dp409 g4 ((dp410 (dp411 S'__call__' p412 (ihappydoclib.parseinfo.functioninfo FunctionInfo p413 (dp414 g4 ((dp415 (dp416 tp417 sg17 (dp418 sg19 (S'self' p419 S's' tp420 sg23 (dp421 g419 (NNNtp422 sS's' (NNNtp423 ssg27 g28 sg29 S'' sg30 g412 sg31 g408 sg32 g33 sg34 (dp424 sg36 g415 sg37 g416 sg38 S'' sbsS'__init__' p425 (ihappydoclib.parseinfo.functioninfo FunctionInfo p426 (dp427 g4 ((dp428 (dp429 tp430 sg17 (dp431 sg19 (S'self' p432 S'filename' p433 tp434 sg23 (dp435 g432 (NNNtp436 sg433 (NNNtp437 ssg27 g28 sg29 S'' sg30 g425 sg31 g408 sg32 g33 sg34 (dp438 sg36 g428 sg37 g429 sg38 S'' sbstp439 sg27 g28 sg29 S'' sg402 (lp440 sg30 g407 sg31 g2 sg32 g33 sg404 (lp441 sg34 (dp442 sg36 g410 sg37 g411 sg38 S'' sbs(dp443 tp444 sS'_import_info' p445 (ihappydoclib.parseinfo.imports ImportInfo p446 (dp447 S'_named_imports' p448 (dp449 sS'_straight_imports' p450 (lp451 sbsg27 g28 sg29 S'' sg30 S'_Gnuplot' p452 sg31 Nsg32 g33 sg34 (dp453 S'include_comments' p454 I1 sS'cacheFilePrefix' p455 S'.happydoc.' p456 sS'useCache' p457 I1 sS'docStringFormat' p458 S'StructuredText' p459 ssg36 g5 sg37 g443 sg38 S'' sbt.gnuplot-py-1.8/gp_win32.py0000644000076400007640000000744311006462763015027 0ustar alfordalford# $Id: gp_win32.py 292 2006-03-03 09:49:04Z mhagger $ # Copyright (C) 1999-2003 Michael Haggerty # # This file is licensed under the GNU Lesser General Public License # (LGPL). See LICENSE.txt for details. """gp_win32 -- an interface to gnuplot for Windows. """ import Errors # ############ Configuration variables: ################################ class GnuplotOpts: """The configuration options for gnuplot under windows. See gp_unix.py for details about the meaning of these options. Please let me know if you know better choices for these settings. """ # Command to start up the gnuplot program. Note that on windows # the main gnuplot program cannot be used directly because it can # not read commands from standard input. See README for more # information. # # If pgnuplot is in a subdirectory with spaces in its name, extra # quoting is required for windows for it to launch gnuplot. # Moreover, it is suggested to use a raw string to avoid having to # quote backslashes in the filename. Example: # # gnuplot_command = r'"C:\Program Files\gp371w32\pgnuplot.exe"' gnuplot_command = r'pgnuplot.exe' # The '-persist' option is not supported on windows: recognizes_persist = 0 # As far as I know, gnuplot under windows can use binary data: recognizes_binary_splot = 1 # Apparently gnuplot on windows can use inline data, but we use # non-inline data (i.e., temporary files) by default for no # special reason: prefer_inline_data = 0 # os.mkfifo is apparently not supported under Windows. support_fifo = 0 prefer_fifo_data = 0 # The default choice for the 'set term' command (to display on # screen): default_term = 'windows' # According to the gnuplot help manual, the following can be used # to print directly to a printer under windows. (Of course it # won't help if your printer can't handle postscript!) default_lpr = 'PRN' # Used the 'enhanced' option of postscript by default? Set to # None (*not* 0!) if your version of gnuplot doesn't support # enhanced postscript. prefer_enhanced_postscript = 1 # ############ End of configuration options ############################ try: from sys import hexversion except ImportError: hexversion = 0 if hexversion >= 0x02000000: # Apparently at least as of Python 2.0b1, popen support for # windows is adequate. Give that a try: from os import popen else: # For earlier versions, you have to have the win32 extensions # installed and we use the popen that it provides. from win32pipe import popen # Mac doesn't recognize persist. def test_persist(): return 0 class GnuplotProcess: """Unsophisticated interface to a running gnuplot program. See gp_unix.py for usage information. """ def __init__(self, persist=0): """Start a gnuplot process. Create a 'GnuplotProcess' object. This starts a gnuplot program and prepares to write commands to it. Keyword arguments: 'persist' -- the '-persist' option is not supported under Windows so this argument must be zero. """ if persist: raise Errors.OptionError( '-persist is not supported under Windows!') self.gnuplot = popen(GnuplotOpts.gnuplot_command, 'w') # forward write and flush methods: self.write = self.gnuplot.write self.flush = self.gnuplot.flush def close(self): if self.gnuplot is not None: self.gnuplot.close() self.gnuplot = None def __del__(self): self.close() def __call__(self, s): """Send a command string to gnuplot, followed by newline.""" self.write(s + '\n') self.flush() gnuplot-py-1.8/termdefs.py0000644000076400007640000003676711006462763015223 0ustar alfordalford# $Id: termdefs.py 302 2008-01-14 22:15:19Z bmcage $ # Copyright (C) 2001-2003 Michael Haggerty # # This file is licensed under the GNU Lesser General Public License # (LGPL). See LICENSE.txt for details. """Terminal definition file. This module describes the options available to gnuplot's various terminals. For the moment, it only supports a few terminals, but the infrastructure is here to add others as they are needed. Part of the trick is that the 'set terminal' command takes myriad suboptions with various argument types, and order is sometimes significant. The other part of the trick is that there are over 50 terminal types, and each terminal has its own set of options. The strategy here is to define a general mechanism for turning Python keyword parameters into fragments of gnuplot command strings. There are a number of classes derived from Arg that do this. Some take string args, some boolean, etc. Then the list of options that each terminal accepts is stored in the terminal_opts dictionary. Gnuplot.hardcopy(), in turn, uses this dictionary to interpret its keyword arguments and build the 'set terminal' command. """ import types import gp, Errors class Arg: """Process terminal subargs and return a command fragment. Pull one or more arguments from keyw and output a list of strings that will be appended to the 'set terminal' (separated by spaces). Delete any used args from keyw. If no relevant options are found, return None. This is a base class for the actual argument-processing classes. Derived classes must define a __call__(self, keyw) method returning a list of strings or None. """ pass class ArgOneParam(Arg): """Arg abstract base class specialized for exactly one parameter. Members: 'argname' -- The name of the keyword argument used to pass this argument to Python. 'default' -- The default value of the argument, used if no keyword parameter is found. If this is None, then no default is assumed. """ def __init__(self, argname, default): self.argname = argname self.default = default def get_option(self, keyw): """Get the keyword argument corresponding to this Arg. Look in keyw for the keyword argument needed by this Arg. If it is found, delete it from keyw and return it. If it is not found, return self.default. """ try: k = keyw[self.argname] except KeyError: return self.default else: del keyw[self.argname] return k class KeywordArg(ArgOneParam): """Represent an argument that must be passed as a keyword to gnuplot. Some gnuplot options take the form of single unquoted keywords (possibly preceded by a fixed keyword). We allow those to be passed as strings 'option="keyword"'. Check that the option supplied is in the list of allowed options. Members: 'fixedword' -- the fixed keyword that must precede the variable keyword in the gnuplot command, or None if none is required. 'options' -- a list of strings containing the legal alternatives for this argument. """ def __init__(self, argname, options, fixedword=None, default=None): ArgOneParam.__init__(self, argname, default) self.fixedword = fixedword self.options = options def __call__(self, keyw): k = self.get_option(keyw) if k is None: return None elif k in self.options: if self.fixedword is None: return [k] else: return [self.fixedword, k] else: raise Errors.OptionError( 'Illegal option %s="%s"' % (self.argname, k,)) class StringArg(ArgOneParam): """An option taking a quoted string argument.""" def __init__(self, argname, fixedword=None, default=None): ArgOneParam.__init__(self, argname, default) self.fixedword = fixedword def __call__(self, keyw): k = self.get_option(keyw) if k is None: return None elif type(k) is not types.StringType: raise Errors.OptionError( 'Option %s must be a string' % (self.argname,)) else: retval = [] if self.fixedword is not None: retval.append(self.fixedword) retval.append('"%s"' % k) return retval class BareStringArg(ArgOneParam): """An arbitrary argument output without quotes. The argument can be a string or anything with a str() representation, or a tuple of such things. Thus this can be used for strings (which will be output without quotation marks), integers, floating point arguments, or multiple arguments of the above types (which will be output separated by spaces). No checking is done that the argument is sensible. """ def __init__(self, argname, fixedword=None, default=None): ArgOneParam.__init__(self, argname, default) self.fixedword = fixedword def __call__(self, keyw): k = self.get_option(keyw) if k is None: return None else: retval = [] if self.fixedword is not None: retval.append(self.fixedword) if type(k) in (types.TupleType, types.ListType): for i in k: retval.append(str(i)) else: retval.append(str(k)) return retval class BooleanArg(ArgOneParam): """An argument that takes a true/false value. The argument should be 0 or 1. The option is output to gnuplot as 'trueval' if the argument is true or 'falseval' if the argument is false. Either one can be 'None', in which case nothing is output. 'default' should also be 0 or 1. """ def __init__(self, argname, trueval, falseval, fixedword=None, default=None): ArgOneParam.__init__(self, argname, default) self.trueval = trueval self.falseval = falseval self.fixedword = fixedword def __call__(self, keyw): k = self.get_option(keyw) if k is None: return None else: retval = [] if self.fixedword is not None: retval.append(self.fixedword) if k: val = self.trueval else: val = self.falseval if val is not None: retval.append(val) return retval class MutuallyExclusiveArgs(Arg): """A group of args, of which either zero or one may be set, but not more. Members: subargs -- a list [('argname', arg), ...] of Arg instances. 'argname' is used to identify the corresponding arg in error messages. (The name of the corresponding keyword args is determined internally by each arg.) """ def __init__(self, *subargs): self.subargs = list(subargs) def __call__(self, keyw): foundargname = None retval = None for (argname, arg,) in self.subargs: cmd = arg(keyw) if cmd is not None: if foundargname is not None: raise Errors.OptionError( 'Arguments %s and %s cannot both be specified' % (foundargname, argname,) ) else: foundargname = argname retval = cmd return retval # might be None class KeywordOrBooleanArg(Arg): """Allow a keyword arg to be specified either as a keyword or a boolean. This arg type is the most flexible way to allow keyword parameters to be specified. Say there is an option like 'fontsize' that can take the values 'small' or 'large'. This could be represented as 'KeywordOrBooleanArg(options=["small", "large"], argname="fontsize")' In that case, the fontsize could be specified in any of the following ways: 'g.hardcopy(..., fontsize="small", ...)' 'g.hardcopy(..., fontsize="large", ...)' 'g.hardcopy(..., small=1, ...)' 'g.hardcopy(..., large=1, ...)' If 'argname' is set to be 'None', then the first two possibilities are omitted. In the special case that there are exactly two alternatives, one can also use: 'g.hardcopy(..., small=0, ...) # implies fontsize="large"' 'g.hardcopy(..., large=0, ...) # implies fontsize="small"' Obviously care must be taken to ensure that none of the implied keyword parameter names conflict with one another or with any of the other Args allowed by a function. Members: 'options' -- a list of strings representing allowed keyword values. These options can be used as boolean values in the style 'option=1'. 'argname' -- the name of the argname for the 'arg=value' style of setting the argument. If 'None', then this style is not allowed. 'fixedword' -- a fixed keyword that must precede the option, or 'None'. 'default' -- the default option to set if nothing is set explicitly, or None to leave nothing set in that case. """ def __init__(self, options, argname=None, fixedword=None, default=None): self.options = options self.argname = argname self.fixedword = fixedword self.default = default assert self.default is None or self.default in self.options, \ 'default must be a valid option' def __call__(self, keyw): if self.argname is not None and self.argname in keyw: k = keyw[self.argname] del keyw[self.argname] if k is None: pass elif k in self.options: # Make sure it isn't contradicted by the corresponding boolean: if k in keyw and not keyw[k]: raise Errors.OptionError( 'Arguments %s and %s are contradictory' % (self.argname, k,) ) else: # Store the option into the boolean to be processed below: keyw[k] = 1 else: raise Errors.OptionError( 'Illegal option %s=%s' % (self.argname, k,)) # Now scan the booleans and make sure that at most one is set: option = None for i in range(len(self.options)): k = self.options[i] if k in keyw: newval = keyw[k] del keyw[k] if newval: if option is not None: raise Errors.OptionError( 'Arguments %s and %s cannot both be specified' % (option, k,) ) else: option = k else: # newval was false. This is only legal if this # option only has two possible values: if len(self.options) == 2: option = self.options[1 - i] else: pass if option is None: if self.default is None: return None else: option = self.default retval = [] if self.fixedword is not None: retval.append(self.fixedword) retval.append(option) return retval # Now we define the allowed options for a few terminal types. This # table is used by Gnuplot.hardcopy() to construct the necessary 'set # terminal' command. terminal_opts = {} terminal_opts['postscript'] = [ KeywordOrBooleanArg( options=['landscape', 'portrait', 'eps', 'default'], argname='mode', ), KeywordOrBooleanArg( options=['enhanced', 'noenhanced'], # This default should probably be computed from the *current* # value of GnuplotOpts, not at import time. ### default=(gp.GnuplotOpts.prefer_enhanced_postscript and 'enhanced' or 'noenhanced'), ), KeywordOrBooleanArg(options=['color', 'monochrome']), KeywordOrBooleanArg(options=['solid', 'dashed']), KeywordOrBooleanArg( options=['defaultplex', 'simplex', 'duplex'], argname='duplexing', ), StringArg(argname='fontname'), BareStringArg(argname='fontsize'), ] terminal_opts['pdf'] = [ KeywordOrBooleanArg( options=['landscape', 'portrait', 'eps', 'default'], argname='mode', ), KeywordOrBooleanArg(options=['color', 'monochrome']), KeywordOrBooleanArg(options=['solid', 'dashed']), KeywordOrBooleanArg( options=['defaultplex', 'simplex', 'duplex'], argname='duplexing', ), StringArg(argname='fontname'), BareStringArg(argname='fontsize'), ] terminal_opts['png'] = [ KeywordOrBooleanArg( options=['small', 'medium', 'large'], argname='fontsize', ), KeywordOrBooleanArg(options=['monochrome', 'gray', 'color']), ] terminal_opts['fig'] = [ KeywordOrBooleanArg(options=['monochrome', 'color']), KeywordOrBooleanArg(options=['small', 'big']), BareStringArg(argname='pointsmax', fixedword='pointsmax'), KeywordOrBooleanArg(options=['landscape', 'portrait']), KeywordOrBooleanArg(options=['metric', 'inches']), BareStringArg(argname='fontsize'), BareStringArg(argname='size'), # needs a tuple of two doubles BareStringArg(argname='thickness'), BareStringArg(argname='depth'), ] terminal_opts['cgm'] = [ KeywordOrBooleanArg( options=['landscape', 'portrait', 'default'], argname='mode', ), KeywordOrBooleanArg(options=['color', 'monochrome']), KeywordOrBooleanArg(options=['rotate', 'norotate']), BareStringArg(argname='width', fixedword='width'), BareStringArg(argname='linewidth', fixedword='linewidth'), StringArg(argname='font'), BareStringArg(argname='fontsize'), ] terminal_opts['pict'] = [ KeywordOrBooleanArg( options=['landscape', 'portrait', 'default'], argname='mode', ), KeywordOrBooleanArg(options=['color', 'monochrome']), KeywordOrBooleanArg(options=['dashes', 'nodashes']), # default font, which must be a valid pict font: StringArg(argname='fontname'), # default font size, in points: BareStringArg(argname='fontsize'), # width of plot in pixels: BareStringArg(argname='width'), # height of plot in pixels: BareStringArg(argname='height'), ] terminal_opts['mp'] = [ KeywordOrBooleanArg(options=['color', 'colour', 'monochrome']), KeywordOrBooleanArg(options=['solid', 'dashed']), KeywordOrBooleanArg(options=['notex', 'tex', 'latex']), BareStringArg(argname='magnification'), KeywordOrBooleanArg(options=['psnfss', 'psnfss-version7', 'nopsnfss']), BareStringArg(argname='prologues'), KeywordOrBooleanArg(options=['a4paper']), KeywordOrBooleanArg(options=['amstex']), StringArg(argname='fontname'), BareStringArg(argname='fontsize'), ] terminal_opts['svg'] = [ BareStringArg(argname='size', fixedword='size'), # tuple of two doubles KeywordOrBooleanArg(options=['fixed', 'dynamic']), StringArg(argname='fname', fixedword='fname'), BareStringArg(argname='fsize', fixedword='fsize'), KeywordOrBooleanArg(options=['enhanced', 'noenhanced']), StringArg(argname='fontfile', fixedword='fontfile'), ] gnuplot-py-1.8/Errors.py0000644000076400007640000000103511006462763014642 0ustar alfordalford# $Id: Errors.py 244 2003-04-21 09:44:09Z mhagger $ # Copyright (C) 2001-2003 Michael Haggerty # # This file is licensed under the GNU Lesser General Public License # (LGPL). See LICENSE.txt for details. """Exception types that can be raised by Gnuplot.py.""" class Error(Exception): """All our exceptions are derived from this one.""" pass class OptionError(Error): """Raised for unrecognized option(s)""" pass class DataError(Error): """Raised for data in the wrong format""" pass gnuplot-py-1.8/.happydoc.gp_macosx.py0000644000076400007640000000467211006707250017235 0ustar alfordalford(S'6d2b7c1b77527f76568cdc78bfc54ed5' p1 (ihappydoclib.parseinfo.moduleinfo ModuleInfo p2 (dp3 S'_namespaces' p4 ((dp5 S'GnuplotOpts' p6 (ihappydoclib.parseinfo.classinfo ClassInfo p7 (dp8 g4 ((dp9 (dp10 tp11 sS'_filename' p12 S'Gnuplot/gp_macosx.py' p13 sS'_docstring' p14 S'' sS'_class_member_info' p15 (lp16 sS'_name' p17 g6 sS'_parent' p18 g2 sS'_comment_info' p19 (dp20 sS'_base_class_info' p21 (lp22 sS'_configuration_values' p23 (dp24 sS'_class_info' p25 g9 sS'_function_info' p26 g10 sS'_comments' p27 S'' sbsS'GnuplotProcess' p28 (ihappydoclib.parseinfo.classinfo ClassInfo p29 (dp30 g4 ((dp31 (dp32 S'__del__' p33 (ihappydoclib.parseinfo.functioninfo FunctionInfo p34 (dp35 g4 ((dp36 (dp37 tp38 sS'_exception_info' p39 (dp40 sS'_parameter_names' p41 (S'self' p42 tp43 sS'_parameter_info' p44 (dp45 g42 (NNNtp46 ssg12 g13 sg14 S'' sg17 g33 sg18 g29 sg19 g20 sg23 (dp47 sg25 g36 sg26 g37 sg27 S'' sbsS'close' p48 (ihappydoclib.parseinfo.functioninfo FunctionInfo p49 (dp50 g4 ((dp51 (dp52 tp53 sg39 (dp54 sg41 (S'self' p55 tp56 sg44 (dp57 g55 (NNNtp58 ssg12 g13 sg14 S'' sg17 g48 sg18 g29 sg19 g20 sg23 (dp59 sg25 g51 sg26 g52 sg27 S'' sbsS'__init__' p60 (ihappydoclib.parseinfo.functioninfo FunctionInfo p61 (dp62 g4 ((dp63 (dp64 tp65 sg39 (dp66 S"( '-persist does not seem to be supported ' 'by your version of gnuplot!' )" p67 Nssg41 (S'self' p68 S'persist' p69 tp70 sg44 (dp71 g68 (NNNtp72 sg69 (I1 NNtp73 ssg12 g13 sg14 S'' sg17 g60 sg18 g29 sg19 g20 sg23 (dp74 sg25 g63 sg26 g64 sg27 S'' sbsS'__call__' p75 (ihappydoclib.parseinfo.functioninfo FunctionInfo p76 (dp77 g4 ((dp78 (dp79 tp80 sg39 (dp81 sg41 (S'self' p82 S's' tp83 sg44 (dp84 g82 (NNNtp85 sS's' (NNNtp86 ssg12 g13 sg14 S'' sg17 g75 sg18 g29 sg19 g20 sg23 (dp87 sg25 g78 sg26 g79 sg27 S'' sbstp88 sg12 g13 sg14 S'' sg15 (lp89 sg17 g28 sg18 g2 sg19 g20 sg21 (lp90 sg23 (dp91 sg25 g31 sg26 g32 sg27 S'' sbs(dp92 S'test_persist' p93 (ihappydoclib.parseinfo.functioninfo FunctionInfo p94 (dp95 g4 ((dp96 (dp97 tp98 sg39 (dp99 sg41 (tsg44 (dp100 sg12 g13 sg14 S'' sg17 g93 sg18 g2 sg19 g20 sg23 (dp101 sg25 g96 sg26 g97 sg27 S'' sbstp102 sS'_import_info' p103 (ihappydoclib.parseinfo.imports ImportInfo p104 (dp105 S'_named_imports' p106 (dp107 sS'_straight_imports' p108 (lp109 sbsg12 g13 sg14 S'' sg17 S'gp_macosx' p110 sg18 Nsg19 g20 sg23 (dp111 S'include_comments' p112 I1 sS'cacheFilePrefix' p113 S'.happydoc.' p114 sS'useCache' p115 I1 sS'docStringFormat' p116 S'StructuredText' p117 ssg25 g5 sg26 g92 sg27 S'' sbt.gnuplot-py-1.8/.happydoc.termdefs.py0000644000076400007640000001644611006707250017070 0ustar alfordalford(S'9b7a72edda5daf9638ce534916c2cf21' p1 (ihappydoclib.parseinfo.moduleinfo ModuleInfo p2 (dp3 S'_namespaces' p4 ((dp5 S'ArgOneParam' p6 (ihappydoclib.parseinfo.classinfo ClassInfo p7 (dp8 g4 ((dp9 (dp10 S'get_option' p11 (ihappydoclib.parseinfo.functioninfo FunctionInfo p12 (dp13 g4 ((dp14 (dp15 tp16 sS'_exception_info' p17 (dp18 sS'_parameter_names' p19 (S'self' p20 S'keyw' p21 tp22 sS'_parameter_info' p23 (dp24 g20 (NNNtp25 sg21 (NNNtp26 ssS'_filename' p27 S'Gnuplot/termdefs.py' p28 sS'_docstring' p29 S'' sS'_name' p30 g11 sS'_parent' p31 g7 sS'_comment_info' p32 (dp33 sS'_configuration_values' p34 (dp35 sS'_class_info' p36 g14 sS'_function_info' p37 g15 sS'_comments' p38 S'' sbsS'__init__' p39 (ihappydoclib.parseinfo.functioninfo FunctionInfo p40 (dp41 g4 ((dp42 (dp43 tp44 sg17 (dp45 sg19 (S'self' p46 S'argname' p47 S'default' p48 tp49 sg23 (dp50 g48 (NNNtp51 sg46 (NNNtp52 sg47 (NNNtp53 ssg27 g28 sg29 S'' sg30 g39 sg31 g7 sg32 g33 sg34 (dp54 sg36 g42 sg37 g43 sg38 S'' sbstp55 sg27 g28 sg29 S'' sS'_class_member_info' p56 (lp57 sg30 g6 sg31 g2 sg32 g33 sS'_base_class_info' p58 (lp59 sg34 (dp60 sg36 g9 sg37 g10 sg38 S'' sbsS'BooleanArg' p61 (ihappydoclib.parseinfo.classinfo ClassInfo p62 (dp63 g4 ((dp64 (dp65 S'__call__' p66 (ihappydoclib.parseinfo.functioninfo FunctionInfo p67 (dp68 g4 ((dp69 (dp70 tp71 sg17 (dp72 sg19 (S'self' p73 S'keyw' p74 tp75 sg23 (dp76 g73 (NNNtp77 sg74 (NNNtp78 ssg27 g28 sg29 S'' sg30 g66 sg31 g62 sg32 g33 sg34 (dp79 sg36 g69 sg37 g70 sg38 S'' sbsS'__init__' p80 (ihappydoclib.parseinfo.functioninfo FunctionInfo p81 (dp82 g4 ((dp83 (dp84 tp85 sg17 (dp86 sg19 (S'self' p87 S'argname' p88 S'trueval' p89 S'falseval' p90 S'fixedword' p91 S'default' p92 tp93 sg23 (dp94 g92 (I1 NNtp95 sg87 (NNNtp96 sg91 (I1 NNtp97 sg89 (NNNtp98 sg88 (NNNtp99 sg90 (NNNtp100 ssg27 g28 sg29 S'' sg30 g80 sg31 g62 sg32 g33 sg34 (dp101 sg36 g83 sg37 g84 sg38 S'' sbstp102 sg27 g28 sg29 S'' sg56 (lp103 sg30 g61 sg31 g2 sg32 g33 sg58 (lp104 sg34 (dp105 sg36 g64 sg37 g65 sg38 S'' sbsS'BareStringArg' p106 (ihappydoclib.parseinfo.classinfo ClassInfo p107 (dp108 g4 ((dp109 (dp110 S'__call__' p111 (ihappydoclib.parseinfo.functioninfo FunctionInfo p112 (dp113 g4 ((dp114 (dp115 tp116 sg17 (dp117 sg19 (S'self' p118 S'keyw' p119 tp120 sg23 (dp121 g118 (NNNtp122 sg119 (NNNtp123 ssg27 g28 sg29 S'' sg30 g111 sg31 g107 sg32 g33 sg34 (dp124 sg36 g114 sg37 g115 sg38 S'' sbsS'__init__' p125 (ihappydoclib.parseinfo.functioninfo FunctionInfo p126 (dp127 g4 ((dp128 (dp129 tp130 sg17 (dp131 sg19 (S'self' p132 S'argname' p133 S'fixedword' p134 S'default' p135 tp136 sg23 (dp137 g135 (I1 NNtp138 sg132 (NNNtp139 sg134 (I1 NNtp140 sg133 (NNNtp141 ssg27 g28 sg29 S'' sg30 g125 sg31 g107 sg32 g33 sg34 (dp142 sg36 g128 sg37 g129 sg38 S'' sbstp143 sg27 g28 sg29 S'' sg56 (lp144 sg30 g106 sg31 g2 sg32 g33 sg58 (lp145 sg34 (dp146 sg36 g109 sg37 g110 sg38 S'' sbsS'KeywordOrBooleanArg' p147 (ihappydoclib.parseinfo.classinfo ClassInfo p148 (dp149 g4 ((dp150 (dp151 S'__call__' p152 (ihappydoclib.parseinfo.functioninfo FunctionInfo p153 (dp154 g4 ((dp155 (dp156 tp157 sg17 (dp158 S"Errors.OptionError('Arguments %s and %s cannot both be specified' %( option, k, ) )" p159 NsS"Errors.OptionError('Arguments %s and %s are contradictory' %( self.argname, k, ) )" p160 NsS"Errors.OptionError('Illegal option %s=%s' %( self.argname, k, ) )" p161 Nssg19 (S'self' p162 S'keyw' p163 tp164 sg23 (dp165 g162 (NNNtp166 sg163 (NNNtp167 ssg27 g28 sg29 S'' sg30 g152 sg31 g148 sg32 g33 sg34 (dp168 sg36 g155 sg37 g156 sg38 S'' sbsS'__init__' p169 (ihappydoclib.parseinfo.functioninfo FunctionInfo p170 (dp171 g4 ((dp172 (dp173 tp174 sg17 (dp175 sg19 (S'self' p176 S'options' p177 S'argname' p178 S'fixedword' p179 S'default' p180 tp181 sg23 (dp182 g178 (I1 NNtp183 sg180 (I1 NNtp184 sg176 (NNNtp185 sg179 (I1 NNtp186 sg177 (NNNtp187 ssg27 g28 sg29 S'' sg30 g169 sg31 g148 sg32 g33 sg34 (dp188 sg36 g172 sg37 g173 sg38 S'' sbstp189 sg27 g28 sg29 S'' sg56 (lp190 sg30 g147 sg31 g2 sg32 g33 sg58 (lp191 sg34 (dp192 sg36 g150 sg37 g151 sg38 S'' sbsS'StringArg' p193 (ihappydoclib.parseinfo.classinfo ClassInfo p194 (dp195 g4 ((dp196 (dp197 S'__call__' p198 (ihappydoclib.parseinfo.functioninfo FunctionInfo p199 (dp200 g4 ((dp201 (dp202 tp203 sg17 (dp204 S"Errors.OptionError('Option %s must be a string' %( self.argname, ) )" p205 Nssg19 (S'self' p206 S'keyw' p207 tp208 sg23 (dp209 g206 (NNNtp210 sg207 (NNNtp211 ssg27 g28 sg29 S'' sg30 g198 sg31 g194 sg32 g33 sg34 (dp212 sg36 g201 sg37 g202 sg38 S'' sbsS'__init__' p213 (ihappydoclib.parseinfo.functioninfo FunctionInfo p214 (dp215 g4 ((dp216 (dp217 tp218 sg17 (dp219 sg19 (S'self' p220 S'argname' p221 S'fixedword' p222 S'default' p223 tp224 sg23 (dp225 g223 (I1 NNtp226 sg220 (NNNtp227 sg222 (I1 NNtp228 sg221 (NNNtp229 ssg27 g28 sg29 S'' sg30 g213 sg31 g194 sg32 g33 sg34 (dp230 sg36 g216 sg37 g217 sg38 S'' sbstp231 sg27 g28 sg29 S'' sg56 (lp232 sg30 g193 sg31 g2 sg32 g33 sg58 (lp233 sg34 (dp234 sg36 g196 sg37 g197 sg38 S'' sbsS'KeywordArg' p235 (ihappydoclib.parseinfo.classinfo ClassInfo p236 (dp237 g4 ((dp238 (dp239 S'__call__' p240 (ihappydoclib.parseinfo.functioninfo FunctionInfo p241 (dp242 g4 ((dp243 (dp244 tp245 sg17 (dp246 S'Errors.OptionError(\'Illegal option %s="%s"\' %( self.argname, k, ) )' p247 Nssg19 (S'self' p248 S'keyw' p249 tp250 sg23 (dp251 g248 (NNNtp252 sg249 (NNNtp253 ssg27 g28 sg29 S'' sg30 g240 sg31 g236 sg32 g33 sg34 (dp254 sg36 g243 sg37 g244 sg38 S'' sbsS'__init__' p255 (ihappydoclib.parseinfo.functioninfo FunctionInfo p256 (dp257 g4 ((dp258 (dp259 tp260 sg17 (dp261 sg19 (S'self' p262 S'argname' p263 S'options' p264 S'fixedword' p265 S'default' p266 tp267 sg23 (dp268 g266 (I1 NNtp269 sg262 (NNNtp270 sg265 (I1 NNtp271 sg263 (NNNtp272 sg264 (NNNtp273 ssg27 g28 sg29 S'' sg30 g255 sg31 g236 sg32 g33 sg34 (dp274 sg36 g258 sg37 g259 sg38 S'' sbstp275 sg27 g28 sg29 S'' sg56 (lp276 sg30 g235 sg31 g2 sg32 g33 sg58 (lp277 sg34 (dp278 sg36 g238 sg37 g239 sg38 S'' sbsS'Arg' p279 (ihappydoclib.parseinfo.classinfo ClassInfo p280 (dp281 g4 ((dp282 (dp283 tp284 sg27 g28 sg29 S'' sg56 (lp285 sg30 g279 sg31 g2 sg32 g33 sg58 (lp286 sg34 (dp287 sg36 g282 sg37 g283 sg38 S'' sbsS'MutuallyExclusiveArgs' p288 (ihappydoclib.parseinfo.classinfo ClassInfo p289 (dp290 g4 ((dp291 (dp292 S'__call__' p293 (ihappydoclib.parseinfo.functioninfo FunctionInfo p294 (dp295 g4 ((dp296 (dp297 tp298 sg17 (dp299 S"Errors.OptionError('Arguments %s and %s cannot both be specified' %( foundargname, argname, ) )" p300 Nssg19 (S'self' p301 S'keyw' p302 tp303 sg23 (dp304 g301 (NNNtp305 sg302 (NNNtp306 ssg27 g28 sg29 S'' sg30 g293 sg31 g289 sg32 g33 sg34 (dp307 sg36 g296 sg37 g297 sg38 S'' sbsS'__init__' p308 (ihappydoclib.parseinfo.functioninfo FunctionInfo p309 (dp310 g4 ((dp311 (dp312 tp313 sg17 (dp314 sg19 (S'self' p315 S'*subargs' p316 tp317 sg23 (dp318 g315 (NNNtp319 sg316 (NNNtp320 ssg27 g28 sg29 S'' sg30 g308 sg31 g289 sg32 g33 sg34 (dp321 sg36 g311 sg37 g312 sg38 S'' sbstp322 sg27 g28 sg29 S'' sg56 (lp323 sg30 g288 sg31 g2 sg32 g33 sg58 (lp324 sg34 (dp325 sg36 g291 sg37 g292 sg38 S'' sbs(dp326 tp327 sS'_import_info' p328 (ihappydoclib.parseinfo.imports ImportInfo p329 (dp330 S'_named_imports' p331 (dp332 sS'_straight_imports' p333 (lp334 sbsg27 g28 sg29 S'' sg30 S'termdefs' p335 sg31 Nsg32 g33 sg34 (dp336 S'include_comments' p337 I1 sS'cacheFilePrefix' p338 S'.happydoc.' p339 sS'useCache' p340 I1 sS'docStringFormat' p341 S'StructuredText' p342 ssg36 g5 sg37 g326 sg38 S'' sbt.gnuplot-py-1.8/ANNOUNCE.txt0000644000076400007640000000654411006462763014775 0ustar alfordalfordThis is to announce the release of version 1.8 of Gnuplot.py. Gnuplot.py is a Python [1] package that allows you to create graphs from within Python using the gnuplot [2] plotting program. Gnuplot.py can be obtained from http://gnuplot-py.sourceforge.net/ Prerequisites (see footnotes): the Python interpreter [1] the Python numpy module [3] the gnuplot program [2] or, to use it under Java (experimental): a Java interpreter the Jython interpreter [4] the Jython version of the Numeric module [5] the gnuplot program [2] Some ways this package can be used: 1. Interactive data processing: Use Python's excellent numpy package to create and manipulate arrays of numbers, and use Gnuplot.py to visualize the results. 2. Web graphics: write CGI scripts in Python that use gnuplot to output plots in (for example) PNG format and return them to the client. 3. Glue for numerical applications (this is my favorite): wrap your C++/C/Fortran subroutines so that they are callable from Python, then you can perform numerical computations interactively from scripts or from the command line and use Gnuplot.py to plot the output on the fly. 4. Compute a series of datasets in Python and plot them one after the other using Gnuplot.py to produce a crude animation. New features in this version: + Various bug fixes + an option "filename" to Data and GridDat This allows saving the data to a permanent, rather than temporary + pdf terminal definition Features already present in older versions: + Two and three-dimensional plots. + Plot data from memory, from a file, or from an expression. + Support for multiple simultaneous gnuplot sessions. + Can pass arbitrary commands to the gnuplot program. + Object oriented, extensible design with several built-in types of plot items. + Portable and easy to install (nothing to compile except on Windows). + Support for Unix (including Linux and Mac OS X), MS Windows, and Mac OS. The platform-dependent layer is fairly well abstracted out, so it shouldn't be too difficult to add support for other platforms. + Support for sending data to gnuplot as `inline' or `binary' data. These are optimizations that also remove the need for temporary files. + Partly table-driven to make it easy to extend. New terminal types can be supported easily by adding data to a table. + Install via distutils. + LGPL license . + Support for sending data to gnuplot via FIFOs (named pipes, linux only). + Preliminary support for running Gnuplot.py under Jython Footnotes: ---------- [1] Python is an excellent object-oriented scripting/rapid development language that is also especially good at gluing programs together. [2] gnuplot is a free, popular, very portable plotting program with a command-line interface. It can make 2-d and 3-d plots and can output to myriad printers and graphics terminals. [3] The numpy Python extension is a Python module that adds fast and convenient array manipulations to the Python language. [4] Jython is a Python interpreter that runs within a Java virtual machine. [5] JNumeric is a version of the Numeric module that runs under Java/Jython. gnuplot-py-1.8/MANIFEST.in0000644000076400007640000000020711006462763014552 0ustar alfordalfordinclude Gnuplot.html include *.txt include *.py include MANIFEST include MANIFEST.in exclude RELEASES.txt recursive-include doc *.html gnuplot-py-1.8/.happydoc.gp.py0000644000076400007640000000165611006707251015663 0ustar alfordalford(S'4733d7cf7d36fdb554422508981cb272' p1 (ihappydoclib.parseinfo.moduleinfo ModuleInfo p2 (dp3 S'_namespaces' p4 ((dp5 (dp6 S'double_quote_string' p7 (ihappydoclib.parseinfo.functioninfo FunctionInfo p8 (dp9 g4 ((dp10 (dp11 tp12 sS'_exception_info' p13 (dp14 sS'_parameter_names' p15 (S's' tp16 sS'_parameter_info' p17 (dp18 S's' (NNNtp19 ssS'_filename' p20 S'Gnuplot/gp.py' p21 sS'_docstring' p22 S'' sS'_name' p23 g7 sS'_parent' p24 g2 sS'_comment_info' p25 (dp26 sS'_configuration_values' p27 (dp28 sS'_class_info' p29 g10 sS'_function_info' p30 g11 sS'_comments' p31 S'' sbstp32 sS'_import_info' p33 (ihappydoclib.parseinfo.imports ImportInfo p34 (dp35 S'_named_imports' p36 (dp37 sS'_straight_imports' p38 (lp39 sbsg20 g21 sg22 S'' sg23 S'gp' p40 sg24 Nsg25 g26 sg27 (dp41 S'include_comments' p42 I1 sS'cacheFilePrefix' p43 S'.happydoc.' p44 sS'useCache' p45 I1 sS'docStringFormat' p46 S'StructuredText' p47 ssg29 g5 sg30 g6 sg31 S'' sbt.gnuplot-py-1.8/__init__.py0000755000076400007640000001417411006464662015140 0ustar alfordalford#! /usr/bin/env python # $Id: __init__.py 306 2008-05-02 01:09:02Z alford $ # Copyright (C) 1998-2003 Michael Haggerty # # This file is licensed under the GNU Lesser General Public License # (LGPL). See LICENSE.txt for details. """Gnuplot -- A pipe-based interface to the gnuplot plotting program. This is the main module of the Gnuplot package. Written by "Michael Haggerty", mailto:mhagger@alum.mit.edu. Inspired by and partly derived from an earlier version by "Konrad Hinsen", mailto:hinsen@ibs.ibs.fr. If you find a problem or have a suggestion, please "let me know", mailto:mhagger@alum.mit.edu. Other feedback would also be appreciated. The Gnuplot.py home page is at "Gnuplot.py", http://gnuplot-py.sourceforge.net For information about how to use this module: 1. Check the README file. 2. Look at the example code in demo.py and try running it by typing 'python demo.py' or 'python __init__.py'. 3. For more details see the extensive documentation strings throughout the python source files, especially this file, _Gnuplot.py, PlotItems.py, and gp_unix.py. 4. The docstrings have also been turned into html which can be read "here", http://gnuplot-py.sourceforge.net/doc. However, the formatting is not perfect; when in doubt, double-check the docstrings. You should import this file with 'import Gnuplot', not with 'from Gnuplot import *', because the module and the main class have the same name, `Gnuplot'. To obtain the gnuplot plotting program itself, see "the gnuplot FAQ", ftp://ftp.gnuplot.vt.edu/pub/gnuplot/faq/index.html. Obviously you need to have gnuplot installed if you want to use Gnuplot.py. The old command-based interface to gnuplot (previously supported as 'oldplot.py') has been removed from the package. Features: o Allows the creation of two or three dimensional plots from python. o A gnuplot session is an instance of class 'Gnuplot'. Multiple sessions can be open at once. For example:: g1 = Gnuplot.Gnuplot() g2 = Gnuplot.Gnuplot() Note that due to limitations on those platforms, opening multiple simultaneous sessions on Windows or Macintosh may not work correctly. (Feedback?) o The implicitly-generated gnuplot commands can be stored to a file instead of executed immediately:: g = Gnuplot.Gnuplot('commands.txt') The 'commands.txt' file can then be run later with gnuplot's 'load' command. Beware, however: the plot commands may depend on the existence of temporary files, which will probably be deleted before you use the command file. o Can pass arbitrary commands to the gnuplot command interpreter:: g('set pointsize 2') (If this is all you want to do, you might consider using the lightweight GnuplotProcess class defined in gp.py.) o A Gnuplot object knows how to plot objects of type 'PlotItem'. Any PlotItem can have optional 'title' and/or 'with' suboptions. Builtin PlotItem types: * 'Data(array1)' -- data from a Python list or NumPy array (permits additional option 'cols' ) * 'File('filename')' -- data from an existing data file (permits additional option 'using' ) * 'Func('exp(4.0 * sin(x))')' -- functions (passed as a string, evaluated by gnuplot) * 'GridData(m, x, y)' -- data tabulated on a grid of (x,y) values (usually to be plotted in 3-D) See the documentation strings for those classes for more details. o PlotItems are implemented as objects that can be assigned to variables and plotted repeatedly. Most of their plot options can also be changed with the new 'set_option()' member functions then they can be replotted with their new options. o Communication of commands to gnuplot is via a one-way pipe. Communication of data from python to gnuplot is via inline data (through the command pipe) or via temporary files. Temp files are deleted automatically when their associated 'PlotItem' is deleted. The PlotItems in use by a Gnuplot object at any given time are stored in an internal list so that they won't be deleted prematurely. o Can use 'replot' method to add datasets to an existing plot. o Can make persistent gnuplot windows by using the constructor option 'persist=1'. Such windows stay around even after the gnuplot program is exited. Note that only newer version of gnuplot support this option. o Can plot either directly to a postscript printer or to a postscript file via the 'hardcopy' method. o Grid data for the splot command can be sent to gnuplot in binary format, saving time and disk space. o Should work under Unix, Macintosh, and Windows. Restrictions: - Relies on the numpy Python extension. This can be obtained from the Scipy group at . If you're interested in gnuplot, you would probably also want numpy anyway. - Only a small fraction of gnuplot functionality is implemented as explicit method functions. However, you can give arbitrary commands to gnuplot manually:: g = Gnuplot.Gnuplot() g('set data style linespoints') g('set pointsize 5') - There is no provision for missing data points in array data (which gnuplot allows via the 'set missing' command). Bugs: - No attempt is made to check for errors reported by gnuplot. On unix any gnuplot error messages simply appear on stderr. (I don't know what happens under Windows.) - All of these classes perform their resource deallocation when '__del__' is called. Normally this works fine, but there are well-known cases when Python's automatic resource deallocation fails, which can leave temporary files around. """ __version__ = '1.8' # Other modules that should be loaded for 'from Gnuplot import *': __all__ = ['utils', 'funcutils', ] from gp import GnuplotOpts, GnuplotProcess, test_persist from Errors import Error, OptionError, DataError from PlotItems import PlotItem, Func, File, Data, GridData from _Gnuplot import Gnuplot if __name__ == '__main__': import demo demo.demo() gnuplot-py-1.8/gnuplot_Suites.py0000644000076400007640000004220611006462763016417 0ustar alfordalford# $Id: gnuplot_Suites.py 292 2006-03-03 09:49:04Z mhagger $ # This file is provided as part of the Gnuplot.py package for the # convenience of Mac users. It was generated primarily using gensuitemodule # with Mac gnuplot 3.7.1a. Thanks to Anthony M. Ingraldi and Noboru Yamamoto # for helping with this. # file contains # # class gnuplot_Suite # class odds_and_ends # class Standard_Suite # class Miscellaneous_Events # """Suite gnuplot Suite: Events supplied by gnuplot Level 1, version 1 Generated from Alpha:Desktop Folder:gnuplot.1:gnuplot 3.7.1a AETE/AEUT resource version 1/0, language 0, script 0 """ import aetools import MacOS _code = 'GPSE' class gnuplot_Suite: def gnuexec(self, _object=None, _attributes={}, **_arguments): """exec: execute a gnuplot command Required argument: gnuplot command Keyword argument _attributes: AppleEvent attribute dictionary """ _code = 'GPSE' _subcode = 'exec' if _arguments: raise TypeError, 'No optional args expected' _arguments['----'] = _object _reply, _arguments, _attributes = self.send(_code, _subcode, _arguments, _attributes) if _arguments.has_key('errn'): raise aetools.Error, aetools.decodeerror(_arguments) # XXXX Optionally decode result if _arguments.has_key('----'): return _arguments['----'] def plot(self, _object=None, _attributes={}, **_arguments): """plot: create a 2-D plot Required argument: data to be plotted Keyword argument _attributes: AppleEvent attribute dictionary """ _code = 'GPLT' _subcode = 'plot' if _arguments: raise TypeError, 'No optional args expected' _arguments['----'] = _object _reply, _arguments, _attributes = self.send(_code, _subcode, _arguments, _attributes) if _arguments.has_key('errn'): raise aetools.Error, aetools.decodeerror(_arguments) # XXXX Optionally decode result if _arguments.has_key('----'): return _arguments['----'] def splot(self, _object=None, _attributes={}, **_arguments): """splot: create a 3-D plot Required argument: data to be plotted Keyword argument _attributes: AppleEvent attribute dictionary """ _code = 'GPLT' _subcode = 'splt' if _arguments: raise TypeError, 'No optional args expected' _arguments['----'] = _object _reply, _arguments, _attributes = self.send(_code, _subcode, _arguments, _attributes) if _arguments.has_key('errn'): raise aetools.Error, aetools.decodeerror(_arguments) # XXXX Optionally decode result if _arguments.has_key('----'): return _arguments['----'] class graph(aetools.ComponentItem): """graph - graph - a subclass of window""" want = 'cGRF' class picture(aetools.NProperty): """picture - gnuplot graph in "PICT" format""" which = 'PICT' want = 'PICT' graph._propdict = { 'picture' : picture, } graph._elemdict = { } _Enum_lyty = { 'line' : 'typ1', # line 'points' : 'typ2', # points 'impulses' : 'typ3', # impulses 'linespoints' : 'typ4', # linespoints 'dots' : 'typ5', # dots 'steps' : 'typ6', # steps 'fsteps' : 'typ7', # fsteps 'errorbars' : 'typ8', # errorbars 'xerrorbars' : 'typ9', # xerrorbars 'yerrorbars' : 'ty10', # yerrorbars 'xyerrorbars' : 'ty11', # xyerrorbars 'boxes' : 'ty12', # boxes 'boxerrorbars' : 'ty13', # boxerrorbars 'boxxyerrorbars' : 'ty14', # boxxyerrorbars 'vector' : 'ty19', # vector } # # Indices of types declared in this module # _classdeclarations = { 'cGRF' : graph, } _propdeclarations = { 'PICT' : picture, } _compdeclarations = { } _enumdeclarations = { 'lyty' : _Enum_lyty, } """Suite odds and ends: Things that should be in some standard suite, but arenÕt Level 1, version 1 Generated from Alpha:Desktop Folder:gnuplot.1:gnuplot 3.7.1a AETE/AEUT resource version 1/0, language 0, script 0 """ import aetools import MacOS _code = 'Odds' class odds_and_ends: def select(self, _object=None, _attributes={}, **_arguments): """select: Select the specified object Required argument: the object to select Keyword argument _attributes: AppleEvent attribute dictionary """ _code = 'misc' _subcode = 'slct' if _arguments: raise TypeError, 'No optional args expected' _arguments['----'] = _object _reply, _arguments, _attributes = self.send(_code, _subcode, _arguments, _attributes) if _arguments.has_key('errn'): raise aetools.Error, aetools.decodeerror(_arguments) # XXXX Optionally decode result if _arguments.has_key('----'): return _arguments['----'] # # Indices of types declared in this module # _classdeclarations = { } _propdeclarations = { } _compdeclarations = { } _enumdeclarations = { } """Suite Standard Suite: Common terms for most applications Level 1, version 1 Generated from Alpha:Desktop Folder:gnuplot.1:gnuplot 3.7.1a AETE/AEUT resource version 1/0, language 0, script 0 """ import aetools import MacOS _code = 'CoRe' class Standard_Suite: _argmap_close = { 'saving' : 'savo', '_in' : 'kfil', } def close(self, _object, _attributes={}, **_arguments): """close: Close an object Required argument: the objects to close Keyword argument saving: specifies whether or not changes should be saved before closing Keyword argument _in: the file in which to save the object Keyword argument _attributes: AppleEvent attribute dictionary """ _code = 'core' _subcode = 'clos' aetools.keysubst(_arguments, self._argmap_close) _arguments['----'] = _object aetools.enumsubst(_arguments, 'savo', _Enum_savo) _reply, _arguments, _attributes = self.send(_code, _subcode, _arguments, _attributes) if _arguments.has_key('errn'): raise aetools.Error, aetools.decodeerror(_arguments) # XXXX Optionally decode result if _arguments.has_key('----'): return _arguments['----'] def data_size(self, _object, _attributes={}, **_arguments): """data size: Return the size in bytes of an object Required argument: the object whose data size is to be returned Keyword argument _attributes: AppleEvent attribute dictionary Returns: the size of the object in bytes """ _code = 'core' _subcode = 'dsiz' if _arguments: raise TypeError, 'No optional args expected' _arguments['----'] = _object _reply, _arguments, _attributes = self.send(_code, _subcode, _arguments, _attributes) if _arguments.has_key('errn'): raise aetools.Error, aetools.decodeerror(_arguments) # XXXX Optionally decode result if _arguments.has_key('----'): return _arguments['----'] def get(self, _object, _attributes={}, **_arguments): """get: Get the data for an object Required argument: the object whose data is to be returned Keyword argument _attributes: AppleEvent attribute dictionary Returns: The data from the object """ _code = 'core' _subcode = 'getd' if _arguments: raise TypeError, 'No optional args expected' _arguments['----'] = _object _reply, _arguments, _attributes = self.send(_code, _subcode, _arguments, _attributes) if _arguments.has_key('errn'): raise aetools.Error, aetools.decodeerror(_arguments) # XXXX Optionally decode result if _arguments.has_key('----'): return _arguments['----'] _argmap_make = { 'new' : 'kocl', 'at' : 'insh', 'with_data' : 'data', 'with_properties' : 'prdt', } def make(self, _no_object=None, _attributes={}, **_arguments): """make: Make a new element Keyword argument new: the class of the new element Keyword argument at: the location at which to insert the element Keyword argument with_data: the initial data for the element Keyword argument with_properties: the initial values for the properties of the element Keyword argument _attributes: AppleEvent attribute dictionary Returns: Object specifier for the new element """ _code = 'core' _subcode = 'crel' aetools.keysubst(_arguments, self._argmap_make) if _no_object != None: raise TypeError, 'No direct arg expected' _reply, _arguments, _attributes = self.send(_code, _subcode, _arguments, _attributes) if _arguments.has_key('errn'): raise aetools.Error, aetools.decodeerror(_arguments) # XXXX Optionally decode result if _arguments.has_key('----'): return _arguments['----'] def open(self, _object, _attributes={}, **_arguments): """open: Open the specified object(s) Required argument: Objects to open. Can be a list of files or an object specifier. Keyword argument _attributes: AppleEvent attribute dictionary """ _code = 'aevt' _subcode = 'odoc' if _arguments: raise TypeError, 'No optional args expected' _arguments['----'] = _object _reply, _arguments, _attributes = self.send(_code, _subcode, _arguments, _attributes) if _arguments.has_key('errn'): raise aetools.Error, aetools.decodeerror(_arguments) # XXXX Optionally decode result if _arguments.has_key('----'): return _arguments['----'] def _print(self, _object, _attributes={}, **_arguments): """print: Print the specified object(s) Required argument: Objects to print. Can be a list of files or an object specifier. Keyword argument _attributes: AppleEvent attribute dictionary """ _code = 'aevt' _subcode = 'pdoc' if _arguments: raise TypeError, 'No optional args expected' _arguments['----'] = _object _reply, _arguments, _attributes = self.send(_code, _subcode, _arguments, _attributes) if _arguments.has_key('errn'): raise aetools.Error, aetools.decodeerror(_arguments) # XXXX Optionally decode result if _arguments.has_key('----'): return _arguments['----'] _argmap_save = { '_in' : 'kfil', 'as' : 'fltp', } def save(self, _object, _attributes={}, **_arguments): """save: save a set of objects Required argument: Objects to save. Keyword argument _in: the file in which to save the object(s) Keyword argument as: the file type of the document in which to save the data Keyword argument _attributes: AppleEvent attribute dictionary """ _code = 'core' _subcode = 'save' aetools.keysubst(_arguments, self._argmap_save) _arguments['----'] = _object _reply, _arguments, _attributes = self.send(_code, _subcode, _arguments, _attributes) if _arguments.has_key('errn'): raise aetools.Error, aetools.decodeerror(_arguments) # XXXX Optionally decode result if _arguments.has_key('----'): return _arguments['----'] _argmap_set = { 'to' : 'data', } def set(self, _object, _attributes={}, **_arguments): """set: Set an objectÕs data Required argument: the object to change Keyword argument to: the new value Keyword argument _attributes: AppleEvent attribute dictionary """ _code = 'core' _subcode = 'setd' aetools.keysubst(_arguments, self._argmap_set) _arguments['----'] = _object _reply, _arguments, _attributes = self.send(_code, _subcode, _arguments, _attributes) if _arguments.has_key('errn'): raise aetools.Error, aetools.decodeerror(_arguments) # XXXX Optionally decode result if _arguments.has_key('----'): return _arguments['----'] class application(aetools.ComponentItem): """application - An application program""" want = 'capp' # element 'cwin' as ['indx', 'name', 'rele'] # element 'docu' as ['name'] class window(aetools.ComponentItem): """window - A Window""" want = 'cwin' class bounds(aetools.NProperty): """bounds - the boundary rectangle for the window""" which = 'pbnd' want = 'qdrt' class closeable(aetools.NProperty): """closeable - Does the window have a close box?""" which = 'hclb' want = 'bool' class titled(aetools.NProperty): """titled - Does the window have a title bar?""" which = 'ptit' want = 'bool' class index(aetools.NProperty): """index - the number of the window""" which = 'pidx' want = 'long' class floating(aetools.NProperty): """floating - Does the window float?""" which = 'isfl' want = 'bool' class modal(aetools.NProperty): """modal - Is the window modal?""" which = 'pmod' want = 'bool' class resizable(aetools.NProperty): """resizable - Is the window resizable?""" which = 'prsz' want = 'bool' class zoomable(aetools.NProperty): """zoomable - Is the window zoomable?""" which = 'iszm' want = 'bool' class zoomed(aetools.NProperty): """zoomed - Is the window zoomed?""" which = 'pzum' want = 'bool' class name(aetools.NProperty): """name - the title of the window""" which = 'pnam' want = 'itxt' class visible(aetools.NProperty): """visible - is the window visible?""" which = 'pvis' want = 'bool' class position(aetools.NProperty): """position - upper left coordinates of window""" which = 'ppos' want = 'QDpt' class document(aetools.ComponentItem): """document - A Document""" want = 'docu' # repeated property name the title of the document class modified(aetools.NProperty): """modified - Has the document been modified since the last save?""" which = 'imod' want = 'bool' application._propdict = { } application._elemdict = { 'window' : window, 'document' : document, } window._propdict = { 'bounds' : bounds, 'closeable' : closeable, 'titled' : titled, 'index' : index, 'floating' : floating, 'modal' : modal, 'resizable' : resizable, 'zoomable' : zoomable, 'zoomed' : zoomed, 'name' : name, 'visible' : visible, 'position' : position, } window._elemdict = { } document._propdict = { 'name' : name, 'modified' : modified, } document._elemdict = { } _Enum_savo = { 'yes' : 'yes ', # Save objects now 'no' : 'no ', # Do not save objects 'ask' : 'ask ', # Ask the user whether to save } # # Indices of types declared in this module # _classdeclarations = { 'cwin' : window, 'docu' : document, 'capp' : application, } _propdeclarations = { 'ptit' : titled, 'pidx' : index, 'ppos' : position, 'pnam' : name, 'pbnd' : bounds, 'imod' : modified, 'isfl' : floating, 'hclb' : closeable, 'iszm' : zoomable, 'pmod' : modal, 'pzum' : zoomed, 'pvis' : visible, 'prsz' : resizable, } _compdeclarations = { } _enumdeclarations = { 'savo' : _Enum_savo, } """Suite Miscellaneous Events: Useful events that arenÕt in any other suite Level 1, version 1 Generated from Alpha:Desktop Folder:gnuplot.1:gnuplot 3.7.1a AETE/AEUT resource version 1/0, language 0, script 0 """ import aetools import MacOS _code = 'misc' class Miscellaneous_Events: def revert(self, _object, _attributes={}, **_arguments): """revert: Revert an object to the most recently saved version Required argument: object to revert Keyword argument _attributes: AppleEvent attribute dictionary """ _code = 'misc' _subcode = 'rvrt' if _arguments: raise TypeError, 'No optional args expected' _arguments['----'] = _object _reply, _arguments, _attributes = self.send(_code, _subcode, _arguments, _attributes) if _arguments.has_key('errn'): raise aetools.Error, aetools.decodeerror(_arguments) # XXXX Optionally decode result if _arguments.has_key('----'): return _arguments['----'] def do_script(self, _object=None, _attributes={}, **_arguments): """do script: execute a gnuplot script Required argument: a gnuplot script Keyword argument _attributes: AppleEvent attribute dictionary """ _code = 'misc' _subcode = 'dosc' if _arguments: raise TypeError, 'No optional args expected' _arguments['----'] = _object _reply, _arguments, _attributes = self.send(_code, _subcode, _arguments, _attributes) if _arguments.has_key('errn'): raise aetools.Error, aetools.decodeerror(_arguments) # XXXX Optionally decode result if _arguments.has_key('----'): return _arguments['----'] # # Indices of types declared in this module # _classdeclarations = { } _propdeclarations = { } _compdeclarations = { } _enumdeclarations = { } gnuplot-py-1.8/gp_mac.py0000644000076400007640000000663111006462763014623 0ustar alfordalford# $Id: gp_mac.py 292 2006-03-03 09:49:04Z mhagger $ # Copyright (C) 1999-2003 Michael Haggerty # Thanks to Tony Ingraldi and Noboru Yamamoto for their contributions. # # This file is licensed under the GNU Lesser General Public License # (LGPL). See LICENSE.txt for details. """gp_mac -- an interface to gnuplot for the Macintosh. """ import os, string import Errors # ############ Configuration variables: ################################ class GnuplotOpts: """The configuration options for gnuplot on the Macintosh. See gp.py for details about the meaning of these options. Please let me know if you know better choices for these settings.""" # The '-persist' option is not supported on the Mac: recognizes_persist = 0 # Apparently the Mac can use binary data: recognizes_binary_splot = 1 # Apparently the Mac can not use inline data: prefer_inline_data = 0 # os.mkfifo is not supported on the Mac. support_fifo = 0 prefer_fifo_data = 0 # The default choice for the 'set term' command (to display on screen). # Terminal types are different in Gnuplot 3.7.1c. # For earlier versions, this was default_term = 'macintosh' default_term = 'pict' # I don't know how to print directly to a printer on the Mac: default_lpr = '| lpr' # Used the 'enhanced' option of postscript by default? Set to # None (*not* 0!) if your version of gnuplot doesn't support # enhanced postscript. prefer_enhanced_postscript = 1 # ############ End of configuration options ############################ # The Macintosh doesn't support pipes so communication is via # AppleEvents. import gnuplot_Suites import Required_Suite import aetools # Mac doesn't recognize persist. def test_persist(): return 0 class _GNUPLOT(aetools.TalkTo, Required_Suite.Required_Suite, gnuplot_Suites.gnuplot_Suite, gnuplot_Suites.odds_and_ends, gnuplot_Suites.Standard_Suite, gnuplot_Suites.Miscellaneous_Events): """Start a gnuplot program and emulate a pipe to it.""" def __init__(self): aetools.TalkTo.__init__(self, '{GP}', start=1) class GnuplotProcess: """Unsophisticated interface to a running gnuplot program. See gp_unix.GnuplotProcess for usage information. """ def __init__(self, persist=0): """Start a gnuplot process. Create a 'GnuplotProcess' object. This starts a gnuplot program and prepares to write commands to it. Keyword arguments: 'persist' -- the '-persist' option is not supported on the Macintosh so this argument must be zero. """ if persist: raise Errors.OptionError( '-persist is not supported on the Macintosh!') self.gnuplot = _GNUPLOT() def close(self): if self.gnuplot is not None: self.gnuplot.quit() self.gnuplot = None def __del__(self): self.close() def write(self, s): """Mac gnuplot apparently requires '\r' to end statements.""" self.gnuplot.gnuexec(string.replace(s, '\n', os.linesep)) def flush(self): pass def __call__(self, s): """Send a command string to gnuplot, for immediate execution.""" # Apple Script doesn't seem to need the trailing '\n'. self.write(s) self.flush() gnuplot-py-1.8/gp_macosx.py0000644000076400007640000001072711006462763015356 0ustar alfordalford# $Id: gp_macosx.py 291 2006-03-03 08:58:48Z mhagger $ # Copyright (C) 1998-2003 Michael Haggerty # # This file is licensed under the GNU Lesser General Public License # (LGPL). See LICENSE.txt for details. """gp_macosx -- an interface to the command line version of gnuplot used under Mac OS X. The only difference between this interface and gp_unix is that default_term is 'aqua'. This file implements a low-level interface to gnuplot. This file should be imported through gp.py, which in turn should be imported via 'import Gnuplot' rather than using these low-level interfaces directly. """ # ############ Configuration variables: ################################ class GnuplotOpts: """The configuration options for gnuplot on Mac OS X. See the gp_unix.py for documentation on all of the parameters. """ gnuplot_command = 'gnuplot' recognizes_persist = None # test automatically on first use prefer_persist = 0 recognizes_binary_splot = 1 prefer_inline_data = 0 # os.mkfifo should be supported on Mac OS X. Let me know if I'm # wrong. support_fifo = 1 prefer_fifo_data = 1 default_term = 'aqua' default_lpr = '| lpr' prefer_enhanced_postscript = 1 # ############ End of configuration options ############################ from os import popen def test_persist(): """Determine whether gnuplot recognizes the option '-persist'. If the configuration variable 'recognizes_persist' is set (i.e., to something other than 'None'), return that value. Otherwise, try to determine whether the installed version of gnuplot recognizes the -persist option. (If it doesn't, it should emit an error message with '-persist' in the first line.) Then set 'recognizes_persist' accordingly for future reference. """ if GnuplotOpts.recognizes_persist is None: import string g = popen('echo | %s -persist 2>&1' % GnuplotOpts.gnuplot_command, 'r') response = g.readlines() g.close() GnuplotOpts.recognizes_persist = ( (not response) or (string.find(response[0], '-persist') == -1)) return GnuplotOpts.recognizes_persist class GnuplotProcess: """Unsophisticated interface to a running gnuplot program. This represents a running gnuplot program and the means to communicate with it at a primitive level (i.e., pass it commands or data). When the object is destroyed, the gnuplot program exits (unless the 'persist' option was set). The communication is one-way; gnuplot's text output just goes to stdout with no attempt to check it for error messages. Members: 'gnuplot' -- the pipe to the gnuplot command. Methods: '__init__' -- start up the program. '__call__' -- pass an arbitrary string to the gnuplot program, followed by a newline. 'write' -- pass an arbitrary string to the gnuplot program. 'flush' -- cause pending output to be written immediately. 'close' -- close the connection to gnuplot. """ def __init__(self, persist=None): """Start a gnuplot process. Create a 'GnuplotProcess' object. This starts a gnuplot program and prepares to write commands to it. Keyword arguments: 'persist=1' -- start gnuplot with the '-persist' option, (which leaves the plot window on the screen even after the gnuplot program ends, and creates a new plot window each time the terminal type is set to 'x11'). This option is not available on older versions of gnuplot. """ if persist is None: persist = GnuplotOpts.prefer_persist if persist: if not test_persist(): raise ('-persist does not seem to be supported ' 'by your version of gnuplot!') self.gnuplot = popen('%s -persist' % GnuplotOpts.gnuplot_command, 'w') else: self.gnuplot = popen(GnuplotOpts.gnuplot_command, 'w') # forward write and flush methods: self.write = self.gnuplot.write self.flush = self.gnuplot.flush def close(self): if self.gnuplot is not None: self.gnuplot.close() self.gnuplot = None def __del__(self): self.close() def __call__(self, s): """Send a command string to gnuplot, followed by newline.""" self.write(s + '\n') self.flush() gnuplot-py-1.8/.happydoc.utils.py0000644000076400007640000000247111006707251016411 0ustar alfordalford(S'd07b7bd90a798b2024e1f84c66405c0a' p1 (ihappydoclib.parseinfo.moduleinfo ModuleInfo p2 (dp3 S'_namespaces' p4 ((dp5 (dp6 S'write_array' p7 (ihappydoclib.parseinfo.functioninfo FunctionInfo p8 (dp9 g4 ((dp10 (dp11 tp12 sS'_exception_info' p13 (dp14 sS'_parameter_names' p15 (S'f' S'set' p16 S'item_sep' p17 S'nest_prefix' p18 S'nest_suffix' p19 S'nest_sep' p20 tp21 sS'_parameter_info' p22 (dp23 g16 (NNNtp24 sS'f' (NNNtp25 sg17 (I1 NNtp26 sg19 (I1 NNtp27 sg18 (I1 NNtp28 sg20 (I1 NNtp29 ssS'_filename' p30 S'Gnuplot/utils.py' p31 sS'_docstring' p32 S'' sS'_name' p33 g7 sS'_parent' p34 g2 sS'_comment_info' p35 (dp36 sS'_configuration_values' p37 (dp38 sS'_class_info' p39 g10 sS'_function_info' p40 g11 sS'_comments' p41 S'' sbsS'float_array' p42 (ihappydoclib.parseinfo.functioninfo FunctionInfo p43 (dp44 g4 ((dp45 (dp46 tp47 sg13 (dp48 sg15 (S'm' tp49 sg22 (dp50 S'm' (NNNtp51 ssg30 g31 sg32 S'' sg33 g42 sg34 g2 sg35 g36 sg37 (dp52 sg39 g45 sg40 g46 sg41 S'' sbstp53 sS'_import_info' p54 (ihappydoclib.parseinfo.imports ImportInfo p55 (dp56 S'_named_imports' p57 (dp58 sS'_straight_imports' p59 (lp60 sbsg30 g31 sg32 S'' sg33 S'utils' p61 sg34 Nsg35 g36 sg37 (dp62 S'include_comments' p63 I1 sS'cacheFilePrefix' p64 S'.happydoc.' p65 sS'useCache' p66 I1 sS'docStringFormat' p67 S'StructuredText' p68 ssg39 g5 sg40 g6 sg41 S'' sbt.gnuplot-py-1.8/.happydoc.Errors.py0000644000076400007640000000240311006707250016517 0ustar alfordalford(S'461bbf48748094829e6baf2c7582e86d' p1 (ihappydoclib.parseinfo.moduleinfo ModuleInfo p2 (dp3 S'_namespaces' p4 ((dp5 S'DataError' p6 (ihappydoclib.parseinfo.classinfo ClassInfo p7 (dp8 g4 ((dp9 (dp10 tp11 sS'_filename' p12 S'Gnuplot/Errors.py' p13 sS'_docstring' p14 S'' sS'_class_member_info' p15 (lp16 sS'_name' p17 g6 sS'_parent' p18 g2 sS'_comment_info' p19 (dp20 sS'_base_class_info' p21 (lp22 sS'_configuration_values' p23 (dp24 sS'_class_info' p25 g9 sS'_function_info' p26 g10 sS'_comments' p27 S'' sbsS'OptionError' p28 (ihappydoclib.parseinfo.classinfo ClassInfo p29 (dp30 g4 ((dp31 (dp32 tp33 sg12 g13 sg14 S'' sg15 (lp34 sg17 g28 sg18 g2 sg19 g20 sg21 (lp35 sg23 (dp36 sg25 g31 sg26 g32 sg27 S'' sbsS'Error' p37 (ihappydoclib.parseinfo.classinfo ClassInfo p38 (dp39 g4 ((dp40 (dp41 tp42 sg12 g13 sg14 S'' sg15 (lp43 sg17 g37 sg18 g2 sg19 g20 sg21 (lp44 sg23 (dp45 sg25 g40 sg26 g41 sg27 S'' sbs(dp46 tp47 sS'_import_info' p48 (ihappydoclib.parseinfo.imports ImportInfo p49 (dp50 S'_named_imports' p51 (dp52 sS'_straight_imports' p53 (lp54 sbsg12 g13 sg14 S'' sg17 S'Errors' p55 sg18 Nsg19 g20 sg23 (dp56 S'include_comments' p57 I1 sS'cacheFilePrefix' p58 S'.happydoc.' p59 sS'useCache' p60 I1 sS'docStringFormat' p61 S'StructuredText' p62 ssg25 g5 sg26 g46 sg27 S'' sbt.gnuplot-py-1.8/_Gnuplot.py0000644000076400007640000005005711006462763015165 0ustar alfordalford# $Id: _Gnuplot.py 305 2008-01-17 20:10:44Z bmcage $ # Copyright (C) 1998-2003 Michael Haggerty # # This file is licensed under the GNU Lesser General Public License # (LGPL). See LICENSE.txt for details. """_Gnuplot.py -- An object that represents a running gnuplot process. This file implements the Gnuplot plotter object, which is an abstract interface to a running gnuplot process. """ import sys, string, types import gp, PlotItems, termdefs, Errors class _GnuplotFile: """A file to which gnuplot commands can be written. Sometimes it is convenient to write gnuplot commands to a command file for later evaluation. In that case, one of these objects is used as a mock gnuplot process. Note that temporary files may be deleted before you have time to execute the file! Members: 'gnuplot' -- the file object gathering the commands. Methods: '__init__' -- open the file. '__call__' -- write a gnuplot command to the file, followed by a newline. 'write' -- write an arbitrary string to the file. 'flush' -- cause pending output to be written immediately. """ def __init__(self, filename): """Open the file for writing.""" self.gnuplot = open(filename, 'w') # forward write and flush methods: self.write = self.gnuplot.write self.flush = self.gnuplot.flush def __call__(self, s): """Write a command string to the file, followed by newline.""" self.write(s + '\n') self.flush() class Gnuplot: """Interface to a gnuplot program. A Gnuplot represents a higher-level interface to a gnuplot program. It can plot 'PlotItem's, which represent each thing to be plotted on the current graph. It keeps a reference to each of the 'PlotItems' used in the current plot, so that they (and their associated temporary files) are not deleted prematurely. Members: 'itemlist' -- a list of the PlotItems that are associated with the current plot. These are deleted whenever a new plot command is issued via the 'plot' method. 'plotcmd' -- 'plot' or 'splot', depending on what was the last plot command. Methods: '__init__' -- if a filename argument is specified, the commands will be written to that file instead of being piped to gnuplot. 'plot' -- clear the old plot and old 'PlotItems', then plot the arguments in a fresh plot command. Arguments can be: a 'PlotItem', which is plotted along with its internal options; a string, which is plotted as a 'Func'; or anything else, which is plotted as a 'Data'. 'splot' -- like 'plot', except for 3-d plots. 'hardcopy' -- replot the plot to a postscript file (if filename argument is specified) or pipe it to the printer as postscript othewise. If the option 'color' is set to true, then output color postscript. 'replot' -- replot the old items, adding any arguments as additional items as in the plot method. 'refresh' -- issue (or reissue) the plot command using the current 'PlotItems'. '__call__' -- pass an arbitrary string to the gnuplot process, followed by a newline. 'xlabel', 'ylabel', 'zlabel', 'title' -- set corresponding plot attribute. 'interact' -- read lines from stdin and send them, one by one, to the gnuplot interpreter. Basically you can type commands directly to the gnuplot command processor. 'load' -- load a file (using the gnuplot 'load' command). 'save' -- save gnuplot commands to a file (using gnuplot 'save' command) If any of the 'PlotItem's is a temporary file, it will be deleted at the usual time and the save file will be pretty useless :-). 'clear' -- clear the plot window (but not the itemlist). 'reset' -- reset all gnuplot settings to their defaults and clear the current itemlist. 'set_string' -- set or unset a gnuplot option whose value is a string. '_clear_queue' -- clear the current 'PlotItem' list. '_add_to_queue' -- add the specified items to the current 'PlotItem' list. """ # optiontypes tells how to set parameters. Specifically, the # parameter will be set using self.set_(option, value), # where is a string looked up in the following table. optiontypes = { 'title' : 'string', 'xlabel' : 'string', 'ylabel' : 'string', 'zlabel' : 'string', 'xrange' : 'range', 'yrange' : 'range', 'zrange' : 'range', 'trange' : 'range', 'urange' : 'range', 'vrange' : 'range', 'parametric' : 'boolean', 'polar' : 'boolean', 'output' : 'string', } def __init__(self, filename=None, persist=None, debug=0): """Create a Gnuplot object. Create a 'Gnuplot' object. By default, this starts a gnuplot process and prepares to write commands to it. Keyword arguments: 'filename=' -- if a filename is specified, the commands are instead written to that file (e.g., for later use using 'load'). 'persist=1' -- start gnuplot with the '-persist' option (which creates a new plot window for each plot command). (This option is not available on older versions of gnuplot.) 'debug=1' -- echo the gnuplot commands to stderr as well as sending them to gnuplot. """ if filename is None: self.gnuplot = gp.GnuplotProcess(persist=persist) else: if persist is not None: raise Errors.OptionError( 'Gnuplot with output to file does not allow ' 'persist option.') self.gnuplot = _GnuplotFile(filename) self._clear_queue() self.debug = debug self.plotcmd = 'plot' self('set terminal %s' % (gp.GnuplotOpts.default_term,)) def close(self): # This may cause a wait for the gnuplot process to finish # working, which is generally a good thing because it delays # the deletion of temporary files. if self.gnuplot is not None: self.gnuplot.close() self.gnuplot = None def __del__(self): self.close() self._clear_queue() def __call__(self, s): """Send a command string to gnuplot. Send the string s as a command to gnuplot, followed by a newline. All communication with the gnuplot process (except for inline data) is through this method. """ self.gnuplot(s) if self.debug: # also echo to stderr for user to see: sys.stderr.write('gnuplot> %s\n' % (s,)) def refresh(self): """Refresh the plot, using the current 'PlotItem's. Refresh the current plot by reissuing the gnuplot plot command corresponding to the current itemlist. """ plotcmds = [] for item in self.itemlist: plotcmds.append(item.command()) self(self.plotcmd + ' ' + string.join(plotcmds, ', ')) for item in self.itemlist: # Uses self.gnuplot.write(): item.pipein(self.gnuplot) self.gnuplot.flush() def _clear_queue(self): """Clear the 'PlotItems' from the queue.""" self.itemlist = [] def _add_to_queue(self, items): """Add a list of items to the itemlist (but don't plot them). 'items' is a sequence of items, each of which should be a 'PlotItem' of some kind, a string (interpreted as a function string for gnuplot to evaluate), or a numpy array (or something that can be converted to a numpy array). """ for item in items: if isinstance(item, PlotItems.PlotItem): self.itemlist.append(item) elif type(item) is types.StringType: self.itemlist.append(PlotItems.Func(item)) else: # assume data is an array: self.itemlist.append(PlotItems.Data(item)) def plot(self, *items, **keyw): """Draw a new plot. Clear the current plot and create a new 2-d plot containing the specified items. Each arguments should be of the following types: 'PlotItem' (e.g., 'Data', 'File', 'Func') -- This is the most flexible way to call plot because the PlotItems can contain suboptions. Moreover, PlotItems can be saved to variables so that their lifetime is longer than one plot command; thus they can be replotted with minimal overhead. 'string' (e.g., 'sin(x)') -- The string is interpreted as 'Func(string)' (a function that is computed by gnuplot). Anything else -- The object, which should be convertible to an array, is passed to the 'Data' constructor, and thus plotted as data. If the conversion fails, an exception is raised. """ if keyw: self.set(**keyw) self.plotcmd = 'plot' self._clear_queue() self._add_to_queue(items) self.refresh() def splot(self, *items, **keyw): """Draw a new three-dimensional plot. Clear the current plot and create a new 3-d plot containing the specified items. Arguments can be of the following types: 'PlotItem' (e.g., 'Data', 'File', 'Func', 'GridData' ) -- This is the most flexible way to call plot because the PlotItems can contain suboptions. Moreover, PlotItems can be saved to variables so that their lifetime is longer than one plot command--thus they can be replotted with minimal overhead. 'string' (e.g., 'sin(x*y)') -- The string is interpreted as a 'Func()' (a function that is computed by gnuplot). Anything else -- The object is converted to a Data() item, and thus plotted as data. Note that each data point should normally have at least three values associated with it (i.e., x, y, and z). If the conversion fails, an exception is raised. """ if keyw: self.set(**keyw) self.plotcmd = 'splot' self._clear_queue() self._add_to_queue(items) self.refresh() def replot(self, *items, **keyw): """Replot the data, possibly adding new 'PlotItem's. Replot the existing graph, using the items in the current itemlist. If arguments are specified, they are interpreted as additional items to be plotted alongside the existing items on the same graph. See 'plot' for details. """ if keyw: self.set(**keyw) self._add_to_queue(items) self.refresh() def interact(self): """Allow user to type arbitrary commands to gnuplot. Read stdin, line by line, and send each line as a command to gnuplot. End by typing C-d. """ import time if sys.platform == 'win32': sys.stderr.write('Press Ctrl-z twice to end interactive input\n') else: # What should this be for the Macintosh? sys.stderr.write('Press C-d to end interactive input\n') while 1: try: line = raw_input('gnuplot>>> ') except EOFError: break self(line) time.sleep(0.2) # give a little time for errors to be written sys.stderr.write('\n') def clear(self): """Clear the plot window (without affecting the current itemlist).""" self('clear') def reset(self): """Reset all gnuplot settings to their defaults and clear itemlist.""" self('reset') self.itemlist = [] def load(self, filename): """Load a file using gnuplot's 'load' command.""" self("load '%s'" % (filename,)) def save(self, filename): """Save the current plot commands using gnuplot's 'save' command.""" self("save '%s'" % (filename,)) def set_string(self, option, s=None): """Set a string option, or if s is omitted, unset the option.""" if s is None: self('set %s' % (option,)) else: self('set %s "%s"' % (option, s)) def set_label(self, option, s=None, offset=None, font=None): """Set or clear a label option, which can include an offset or font. If offset is specified, it should be a tuple of two integers or floats. If font is specified, it is appended to the command as a string in double quotes. Its interpretation is terminal-dependent; for example, for postscript it might be 'Helvetica,14' for 14 point Helvetica. """ cmd = ['set', option] if s is not None: cmd.append('"%s"' % (s,)) if offset is not None: cmd.append('%s,%s' % offset) if font is not None: cmd.append('"%s"' % (font,)) self(string.join(cmd)) def set_boolean(self, option, value): """Set an on/off option. It is assumed that the way to turn the option on is to type `set