~ubuntu-branches/ubuntu/trusty/python-gnuplot/trusty

« back to all changes in this revision

Viewing changes to doc/Gnuplot.html

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2005-01-23 00:42:37 UTC
  • mfrom: (2.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20050123004237-0rfjkhe4ii7ky637
Tags: 1.7-5
Fix mouse control in generated plot windows (closes: #291294).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<html>
2
 
 
3
 
        <head>
4
 
        <title>Module: __init__</title>
5
 
        </head>
6
 
 
7
 
        <body bgcolor="#ffffff">
8
 
 
9
 
        <p><i><a href="index.html">Table of Contents</a></i></p>
10
 
        
11
 
        <table border="0" cellpadding="5" cellspacing="0" width="100%">
12
 
        <tr bgcolor="#88bbee">
13
 
            <th rowspan="2"
14
 
                valign="top"
15
 
                align="left"
16
 
                width="10%"><font color="#000000">Module: __init__</font>
17
 
            </th>
18
 
            <th align="right"><font color="#000000">Gnuplot</font></th>
19
 
        </tr>
20
 
        <tr>
21
 
        <td>
22
 
        <dl><dt>Gnuplot</dt><dd><p>A pipe-based interface to the gnuplot plotting program.</p>
23
 
 
24
 
</dd></dl>
25
 
<p>This is the main module of the Gnuplot package.</p>
26
 
 
27
 
<p>Written by <a href="mailto:mhagger@alum.mit.edu">Michael Haggerty</a>.  Inspired
28
 
by and partly derived from an earlier version by <a href="mailto:hinsen@ibs.ibs.fr">Konrad Hinsen</a>.  If you find a problem or have a suggestion,
29
 
please <a href="mailto:mhagger@alum.mit.edu">let me know</a>.  Other feedback
30
 
would also be appreciated.</p>
31
 
 
32
 
<p>The Gnuplot.py home page is at</p>
33
 
 
34
 
<p><a href="http://gnuplot-py.sourceforge.net">Gnuplot.py</a></p>
35
 
 
36
 
<p>For information about how to use this module:</p>
37
 
 
38
 
<ol><li><p>Check the README file.</p>
39
 
 
40
 
</li>
41
 
<li><p>Look at the example code in demo.py and try running it by typing
42
 
   <code>python demo.py</code> or <code>python __init__.py</code>.</p>
43
 
 
44
 
</li>
45
 
<li><p>For more details see the extensive documentation strings
46
 
   throughout the python source files, especially this file,
47
 
   _Gnuplot.py, PlotItems.py, and gp_unix.py.</p>
48
 
 
49
 
</li>
50
 
<li><p>The docstrings have also been turned into html which can be read
51
 
   <a href="http://gnuplot-py.sourceforge.net/doc">here</a>.  However, the
52
 
   formatting is not perfect; when in doubt, double-check the
53
 
   docstrings.</p>
54
 
 
55
 
</li></ol>
56
 
<p>You should import this file with <code>import Gnuplot</code>, not with <code>from
57
 
Gnuplot import *</code>, because the module and the main class have the same
58
 
name, `Gnuplot'.</p>
59
 
 
60
 
<p>To obtain the gnuplot plotting program itself, see <a href="ftp://ftp.gnuplot.vt.edu/pub/gnuplot/faq/index.html">the gnuplot FAQ</a>.  Obviously you
61
 
need to have gnuplot installed if you want to use Gnuplot.py.</p>
62
 
 
63
 
<p>The old command-based interface to gnuplot has been separated out into
64
 
a separate module, oldplot.py.  If you are still using that interface
65
 
you should <code>import Gnuplot.oldplot</code>; otherwise you should stick to the
66
 
more flexible object-oriented interface contained here.</p>
67
 
 
68
 
<p>Features:</p>
69
 
<ul><li><p>Allows the creation of two or three dimensional plots from
70
 
    python.</p>
71
 
 
72
 
</li>
73
 
<li><p>A gnuplot session is an instance of class <code>Gnuplot</code>.  Multiple
74
 
    sessions can be open at once.  For example::</p>
75
 
<PRE>
76
 
        g1 = Gnuplot.Gnuplot()
77
 
        g2 = Gnuplot.Gnuplot()
78
 
 
79
 
    Note that due to limitations on those platforms, opening multiple
80
 
    simultaneous sessions on Windows or Macintosh may not work
81
 
    correctly.  (Feedback?)
82
 
 
83
 
</PRE>
84
 
 
85
 
</li>
86
 
<li><p>The implicitly-generated gnuplot commands can be stored to a file
87
 
    instead of executed immediately::</p>
88
 
<PRE>
89
 
        g = Gnuplot.Gnuplot('commands.txt')
90
 
 
91
 
    The 'commands.txt' file can then be run later with gnuplot's
92
 
    'load' command.  Beware, however: the plot commands may depend on
93
 
    the existence of temporary files, which will probably be deleted
94
 
    before you use the command file.
95
 
 
96
 
</PRE>
97
 
 
98
 
</li>
99
 
<li><p>Can pass arbitrary commands to the gnuplot command interpreter::</p>
100
 
<PRE>
101
 
        g('set pointsize 2')
102
 
 
103
 
    (If this is all you want to do, you might consider using the
104
 
    lightweight GnuplotProcess class defined in gp.py.)
105
 
 
106
 
</PRE>
107
 
 
108
 
</li>
109
 
<li><p>A Gnuplot object knows how to plot objects of type <code>PlotItem</code>.
110
 
    Any PlotItem can have optional <code>title</code> and/or <code>with</code> suboptions.
111
 
    Builtin PlotItem types:</p>
112
 
<ul><li><p><code>Data(array1)</code> -- data from a Python list or NumPy array
113
 
                        (permits additional option <code>cols</code> )</p>
114
 
 
115
 
</li>
116
 
<li><p>'File(<code>filename</code>)' -- data from an existing data file (permits
117
 
                            additional option <code>using</code> )</p>
118
 
 
119
 
</li>
120
 
<li><p>'Func(<code>exp(4.0 * sin(x))</code>)' -- functions (passed as a string,
121
 
                                     evaluated by gnuplot)</p>
122
 
 
123
 
</li>
124
 
<li><p><code>GridData(m, x, y)</code> -- data tabulated on a grid of (x,y) values
125
 
                             (usually to be plotted in 3-D)</p>
126
 
 
127
 
</li></ul>
128
 
<p>    See the documentation strings for those classes for more details.</p>
129
 
 
130
 
 
131
 
</li>
132
 
<li><p>PlotItems are implemented as objects that can be assigned to
133
 
    variables and plotted repeatedly.  Most of their plot options can
134
 
    also be changed with the new <code>set_option()</code> member functions then
135
 
    they can be replotted with their new options.</p>
136
 
 
137
 
</li>
138
 
<li><p>Communication of commands to gnuplot is via a one-way pipe.
139
 
    Communication of data from python to gnuplot is via inline data
140
 
    (through the command pipe) or via temporary files.  Temp files are
141
 
    deleted automatically when their associated <code>PlotItem</code> is deleted.
142
 
    The PlotItems in use by a Gnuplot object at any given time are
143
 
    stored in an internal list so that they won't be deleted
144
 
    prematurely.</p>
145
 
 
146
 
</li>
147
 
<li><p>Can use <code>replot</code> method to add datasets to an existing plot.</p>
148
 
 
149
 
</li>
150
 
<li><p>Can make persistent gnuplot windows by using the constructor option
151
 
    <code>persist=1</code>.  Such windows stay around even after the gnuplot
152
 
    program is exited.  Note that only newer version of gnuplot support
153
 
    this option.</p>
154
 
 
155
 
</li>
156
 
<li><p>Can plot either directly to a postscript printer or to a
157
 
    postscript file via the <code>hardcopy</code> method.</p>
158
 
 
159
 
</li>
160
 
<li><p>Grid data for the splot command can be sent to gnuplot in binary
161
 
    format, saving time and disk space.</p>
162
 
 
163
 
</li>
164
 
<li><p>Should work under Unix, Macintosh, and Windows.</p>
165
 
 
166
 
</li></ul>
167
 
 
168
 
<p>Restrictions:</p>
169
 
<ul><li><p>Relies on the Numeric Python extension.  This can be obtained from
170
 
    <a href="http://sourceforge.net/projects/numpy/">SourceForge</a>.  If you're
171
 
    interested in gnuplot, you would probably also want NumPy anyway.</p>
172
 
 
173
 
</li>
174
 
<li><p>Only a small fraction of gnuplot functionality is implemented as
175
 
    explicit method functions.  However, you can give arbitrary
176
 
    commands to gnuplot manually::</p>
177
 
<PRE>
178
 
        g = Gnuplot.Gnuplot()
179
 
        g('set data style linespoints')
180
 
        g('set pointsize 5')
181
 
 
182
 
</PRE>
183
 
 
184
 
</li>
185
 
<li><p>There is no provision for missing data points in array data (which
186
 
    gnuplot allows via the <code>set missing</code> command).</p>
187
 
 
188
 
</li></ul>
189
 
 
190
 
<p>Bugs:</p>
191
 
<ul><li><p>No attempt is made to check for errors reported by gnuplot.  On
192
 
    unix any gnuplot error messages simply appear on stderr.  (I don't
193
 
    know what happens under Windows.)</p>
194
 
 
195
 
</li>
196
 
<li><p>All of these classes perform their resource deallocation when
197
 
    <code>__del__</code> is called.  Normally this works fine, but there are
198
 
    well-known cases when Python's automatic resource deallocation
199
 
    fails, which can leave temporary files around.</p>
200
 
 
201
 
</li></ul>
202
 
<p>
203
 
<TABLE BORDER=1 CELLPADDING=2>
204
 
</TABLE></p>
205
 
 
206
 
 
207
 
        
208
 
        <table border="0" cellpadding="5" cellspacing="0" width="100%%">
209
 
        
210
 
        </td>
211
 
        </tr>
212
 
        </table>
213
 
        
214
 
        </td>
215
 
        </tr>
216
 
        </table>
217
 
 
218
 
        <hr>
219
 
 
220
 
        <p><i><a href="index.html">Table of Contents</a></i></p>
221
 
 
222
 
        <i>This document was automatically generated on Fri Jan 26 14:06:11 2001
223
 
        by <a href="http://happydoc.sourceforge.net">HappyDoc</a> version r0_9_2</i>
224
 
 
225
 
        </body>
226
 
        </html>
227
 
        
 
 
b'\\ No newline at end of file'