File: plotters.rst

package info (click to toggle)
neuron 8.2.6-2
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 34,760 kB
  • sloc: cpp: 149,571; python: 58,465; ansic: 50,329; sh: 3,510; xml: 213; pascal: 51; makefile: 35; sed: 5
file content (101 lines) | stat: -rwxr-xr-x 2,908 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
Plotter Control (obsolete)
--------------------------


.. function:: lw

         
         

    Name:
        lw - laser writer graphical output (or HP pen plotter) 
         
         

    Syntax:
        ``h.lw(file)``

        ``h.lw(file, device)``

        ``h.lw()``




    Description:
        ``h.lw(file, device)`` opens a file to keep a copy of subsequent 
        plots (*file* is a string variable or a name enclosed in double 
        quotes).  All graphs which are generated on the screen are saved in 
        this file in a format given by the integer value of the *device* argument. 
         


        *device* =1 
            Hewlett Packard pen plotter style. 

        *device* =2 
            Fig style (Fig is a public domain graphics program available 
            on the SUN computer).  The filter ``f2ps`` translates fig to postscript. 

        *device* =3 
            Codraw style. Files in this style can be read into the 
            PC program, ``CODRAW``.  The file should be opened with the extension, 
            ``.DRA``. 

         
        Lw keeps copying every plot to the screen until the file is closed with 
        the command, ``h.lw()``. Note that erasing the screen with ``h.plt(-3)`` or 
        a :kbd:`Control-e` will throw away whatever is in the file and restart the file at the 
        beginning.  Therefore, ``lw`` keeps an accurate representation of the 
        current graphic status of the screen. 
         
        After setting the device once, it remains the same unless changed again 
        by another call with two arguments.  The default device is 2. 
         
         

    Example:
        Suppose an HP plotter is connected to serial port, ``COM1:``.  Then 
        the following procedure will plot whatever graphics information 
        happens to be on the screen (not normal text). 
         

        .. code-block::
            none

            from neuron import h, gui
            import os 

            # function for hp style plotter
            def hp():
                h.plt(-1)  
                h.lw() 
                os.system("cp temp com1:")  
                h.lw("temp")

            h.lw("temp", 1)


         
        Notice that the above procedure closes a file, prints it, and then 
        re-opens :file:`temp`.  The initial direct command makes sure the 
        file is open the first time hp is called. 
         
         

    .. warning::
        It is often necessary to end all the plotting with a ``h.plt(-1)`` 
        command before closing the file to ensure that the last line drawing 
        is properly terminated. 
         
        In our hands the the HP plotter works well at 9600 BAUD and 
        with the line ``\verb+MODE COM1:9600,,,,P+`` in the autoexec.bat file. 
         
         

    .. seealso::
        :func:`plot`, :func:`graph`, :func:`plt`