1PGPLOT(3) User Contributed Perl Documentation PGPLOT(3)
2
3
4
6 PDL::Graphics::PGPLOT - PGPLOT enhanced interface for PDL
7
9 perldl> $a = pdl [1..100]
10 perldl> $b = sqrt($a)
11 perldl> line $b
12 perldl> hold
13 Graphics on HOLD
14 perldl> $c = sin($a/10)*2 + 4
15 perldl> line $c
16
18 "PDL::Graphics::PGPLOT" is a convenience interface to the PGPLOT com‐
19 mands, implemented using the object oriented PGPLOT plotting package in
20 PDL::Graphics::PGPLOT::Window. See the documentation for that package
21 for in-depth information about the usage of these commands and the
22 options they accept.
23
24 The list of currently availably commands:
25
26 imag - Display an image (uses pgimag()/pggray() as appropriate)
27 im - Shorthand to display an image with aspect ratio of 1
28 fits_imag - Display a FITS image with appropriate transforms & labels
29 cont - Display image as contour map
30 fits_cont - Display a FITS image in scientific coordinates as a contour map
31 vect - Display 2 images as a vector field
32 fits_vect - Display 2 FITS images in sci. coordinates as a vector field
33 ctab - Load an image colour table
34 ctab_info - Get information about currently loaded colour table
35 line - Plot vector as connected points
36 points - Plot vector as points
37 errb - Plot error bars
38 bin - Plot vector as histogram (e.g. bin(hist($data)) )
39 hi2d - Plot image as 2d histogram (not very good IMHO...)
40 poly - Draw a polygon
41 text - Write text in the plot area
42 label_axes - Print axis titles
43 legend - Create a legend with different texts, linestyles etc.
44 cursor - Interactively read cursor positions.
45 circle - Draw a circle
46 ellipse - Draw an ellipse.
47
48 Device manipulation commands:
49
50 hold - Hold current plot window range - allows overlays etc.
51 release - Release back to autoscaling of new plot window for each
52 command
53 rel - short alias for 'release'
54 env - Define a plot window, put on 'hold'
55 dev - Explicitly set a new PGPLOT graphics device
56 new_window - Create a new plot window (use of dev is recommended)
57 focus_window - Change focus to a new window
58 window_list - Get a list of currently exisiting plot windows
59 close_window - Close an open window
60
62 The following is a list of the functions that are private to this pack‐
63 age, for the other functions please read the PDL::Graph‐
64 ics::PGPLOT::Window documentation.
65
66 dev
67
68 Open PGPLOT graphics device
69
70 Usage: dev $device, [$nx,$ny, $opt];
71
72 $device is a PGPLOT graphics device such as "/xserve" or "/ps", if
73 omitted defaults to last used device (or value of env var "PGPLOT_DEV"
74 if first time). $nx, $ny specify sub-panelling. The function returns
75 the id of the newly created window - this can subsequently be used as
76 argument to "focus_window" to select the window.
77
78 The result of this command can be modified using options. The options
79 recognised are the same as for "new_window" - which primarily and in
80 addition it is possible to set the default values for a window that are
81 defined in PDL::PGPLOTOptions, see this for details but see below for a
82 synopsis.
83
84 In addition "dev" recognises the option "NewWindow" which allows the
85 user to specify that a "dev" command is to create a new window rather
86 than closing the previous. This allows a large number of output desti‐
87 nations to be open at the same time, which occasionally can be conve‐
88 nient.
89
90 Here is a quick summary of the most useful additional options that can
91 be given:
92
93 Device
94 Alternative to $device.
95
96 AspectRatio
97 The aspect ratio of the output window
98
99 WindowWidth
100 The width of the plot window in inches
101
102 AxisColour
103 The axis colour to be used as default for plots in this window. In
104 the same way it is possible to set the default character size
105 ("CharSize") and axis and box styles. See PDL::Graphics::PGPLOTOp‐
106 tions for details.
107
108 WindowName
109 The name of a window. This name can subsequently be used to refer
110 to the window instead of its ID, making interactive use somewhat
111 more intuitive.
112
113 To open a X-window output that will stay on screen:
114
115 $win = dev('/xs');
116
117 To open two windows, one small and square, one large and wide:
118
119 $win1 = dev('/xs', {Aspect => 1, WindowWidth => 4});
120 $win2 = dev('/xs', {Aspect => 0.5, WindowWidth => 10});
121
122 new_window
123
124 Open a PGPLOT graphics device
125
126 $win = new_window($dev, $nx, $ny, $opt);
127
128 This function is identical to dev except that it always creates a new
129 window. This means that the user is required to close all windows
130 explicitly using close_window. All functionality is otherwise like
131 "dev" so see the documentation for dev for details of use.
132
133 close_window
134
135 Close a PGPLOT output device
136
137 Usage: close_window($id)
138
139 This function closes a PGPLOT output device created with "dev" or
140 "new_window". It requires the id of the window to close. If $id is left
141 undefined, the currently focussed window is deleted and focus is trans‐
142 ferred to the lowest numbered window in existence. If many windows have
143 been created and deleted this might not be what you expect, so it is
144 recommended to make an explicit call to focus_window after any call to
145 "close_window".
146
147 _get_windownumber
148
149 Internal function to obtain the ID of a window. This allows the user to
150 refer to a window with its name.
151
152 focus_window
153
154 Switch to another output window.
155
156 Usage: focus_window($id);
157
158 This command is used to switch output focus to another window created
159 by dev or new_window. The window can be referred to either by its ID or
160 by its name.
161
162 $win1 = dev('/xs', {WindowName => 'X-output'});
163 $win2 = dev('test.ps/ps', {WindowName => 'PS-output'});
164
165 focus_window('X-output'); # Or focus_window($win1);
166 <.. Commands ..>
167 focus_window($win2); # Or focus_window('PS-output');
168 <.. Commands ..>
169
170 window_list
171
172 Return a list of ID numbers and names of the windows currently opened
173 using dev or "new_window".
174
175 Usage: ($numbers, $names)=window_list();
176
177 $numbers and $names are anonymous arrays giving the ID numbers and
178 names of the open windows respectively.
179
180
181
182perl v5.8.8 2004-03-16 PGPLOT(3)