PLplot: plplot_octave.h Source File

PLplot 5.10.0

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
plplot_octave.h
Go to the documentation of this file.
1 // $Id: plplot_octave.h.in 12372 2013-06-06 21:44:33Z andrewross $
2 // jc: this is a massaged plplot.h
3 //
4 // Copyright (C) 2004 Joao Cardoso
5 //
6 // This file is part of PLplot_Octave.
7 //
8 // PLplot_Octave is free software; you can redistribute it and/or modify
9 // it under the terms of the GNU General Public License as published
10 // by the Free Software Foundation; either version 2 of the License, or
11 // (at your option) any later version.
12 //
13 // PLplot_Octave is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU General Public License for more details.
17 //
18 // You should have received a copy of the GNU General Public License
19 // along with PLplot_Octave; if not, write to the Free Software
20 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 //
22
23 //
24 // Copyright (C) 1992 by
25 // Maurice J. LeBrun, Geoff Furnish, Tony Richardson.
26 //
27 // Macros and prototypes for the PLplot package. This header file must
28 // be included by all user codes.
29 //
30 // This software may be freely copied, modified and redistributed
31 // without fee provided that this copyright notice is preserved intact
32 // on all copies and modified copies.
33 //
34 // There is no warranty or other guarantee of fitness of this software.
35 // It is provided solely "as is". The author(s) disclaim(s) all
36 // responsibility and liability with respect to this software's usage
37 // or its effect upon hardware or computer systems.
38 //
39 // Note: some systems allow the Fortran & C namespaces to clobber each
40 // other. So for PLplot to work from Fortran, we do some rather nasty
41 // things to the externally callable C function names. This shouldn't
42 // affect any user programs in C as long as this file is included.
43 //
44
45 #ifndef __PLPLOT_H__
46 #define __PLPLOT_H__
47
48 //--------------------------------------------------------------------------
49 // USING PLplot
50 //
51 // To use PLplot from C or C++, it is only necessary to
52 //
53 // #include "plplot.h"
54 //
55 // This file does all the necessary setup to make PLplot accessible to
56 // your program as documented in the manual. Additionally, this file
57 // allows you to request certain behavior by defining certain symbols
58 // before inclusion. At the moment the only one is:
59 //
60 // #define DOUBLE or..
61 // #define PL_DOUBLE
62 //
63 // This causes PLplot to use doubles instead of floats. Use the type
64 // PLFLT everywhere in your code, and it will always be the right thing.
65 //
66 // Note: most of the functions visible here begin with "pl", while all
67 // of the data types and switches begin with "PL". Eventually everything
68 // will conform to this rule in order to keep namespace pollution of the
69 // user code to a minimum. All the PLplot source files actually include
70 // "plplotP.h", which includes this file as well as all the internally-
71 // visible declarations, etc.
72 //--------------------------------------------------------------------------
73
74 // The majority of PLplot source files require these, so..
75 // Under ANSI C, they can be included any number of times.
76
77 #include <stdio.h>
78 #include <stdlib.h>
79
80 //--------------------------------------------------------------------------
81 // SYSTEM IDENTIFICATION
82 //
83 // Several systems are supported directly by PLplot. In order to avoid
84 // confusion, one id macro per system is used. Since different compilers
85 // may predefine different system id macros, we need to check all the
86 // possibilities, and then set the one we will be referencing. These are:
87 //
88 // __cplusplus Any C++ compiler
89 // __unix Any Unix-like system
90 // __hpux Any HP/UX system
91 // __aix Any AIX system
92 // __linux Linux for i386
93 // (others...)
94 //
95 //--------------------------------------------------------------------------
96
97 #ifdef unix // the old way
98 #ifndef __unix
99 #define __unix
100 #endif
101 #endif
102
103 // Make sure Unix systems define "__unix"
104
105 #if defined ( SX ) || /* NEC Super-UX */ \
106 ( defined ( _IBMR2 ) && defined ( _AIX ) ) || /* AIX */ \
107 defined ( __hpux ) || /* HP/UX */ \
108 defined ( sun ) || /* SUN */ \
109 defined ( CRAY ) || /* Cray */ \
110 defined ( __convexc__ ) || /* CONVEX */ \
111 ( defined ( __alpha ) && defined ( __osf__ ) ) // DEC Alpha AXP/OSF
112
113 #ifndef __unix
114 #define __unix
115 #endif
116 #endif
117
118 // A wrapper used in some header files so they can be compiled with cc
119
120 #define PLARGS( a ) a
121
122 //--------------------------------------------------------------------------
123 // Base types for PLplot
124 //
125 // Only those that are necessary for function prototypes are defined here.
126 // Notes:
127 //
128 // PLINT is typedef'd to an int by default. This is a change from some
129 // previous versions, where a long was used. Under MSDOS, a PLINT is
130 // typedef'd to a long, since 16 bits is too inaccurate for some PLplot
131 // functions. So under MSDOS you must use type PLINT for integer array
132 // arguments to PLplot functions, but on other systems you can just use
133 // an int.
134 //
135 // short is currently used for device page coordinates, so they are
136 // bounded by (-32767, 32767). This gives a max resolution of about 3000
137 // dpi, and improves performance in some areas over using a PLINT.
138 //--------------------------------------------------------------------------
139
140 #define PL_DOUBLE
141
142 #if defined ( PL_DOUBLE ) || defined ( DOUBLE )
143 typedef double PLFLT;
144 #else
145 typedef float PLFLT;
146 #endif
147
148 #if defined ( MSDOS )
149 typedef long PLINT;
150 typedef unsigned long PLUNICODE;
151 #else
152 typedef int PLINT;
153 typedef unsigned PLUNICODE;
154 #endif
155
156 // For identifying logical (boolean) arguments
157 typedef PLINT PLBOOL;
158
159 // For passing user data, as with X's XtPointer
160
161 typedef void* PLPointer;
162
163 //--------------------------------------------------------------------------
164 // Complex data types and other good stuff
165 //--------------------------------------------------------------------------
166
167 // Switches for escape function call.
168 // Some of these are obsolete but are retained in order to process
169 // old metafiles
170
171 #define PLESC_SET_RGB 1 // obsolete
172 #define PLESC_ALLOC_NCOL 2 // obsolete
173 #define PLESC_SET_LPB 3 // obsolete
174 #define PLESC_EXPOSE 4 // handle window expose
175 #define PLESC_RESIZE 5 // handle window resize
176 #define PLESC_REDRAW 6 // handle window redraw
177 #define PLESC_TEXT 7 // switch to text screen
178 #define PLESC_GRAPH 8 // switch to graphics screen
179 #define PLESC_FILL 9 // fill polygon
180 #define PLESC_DI 10 // handle DI command
181 #define PLESC_FLUSH 11 // flush output
182 #define PLESC_EH 12 // handle Window events
183 #define PLESC_GETC 13 // get cursor position
184 #define PLESC_SWIN 14 // set window parameters
185 #define PLESC_DOUBLEBUFFERING 15 // configure double buffering
186 #define PLESC_XORMOD 16 // jc: set xor mode
187 #define PLESC_SET_COMPRESSION 17 // AFR: set compression
188 #define PLESC_CLEAR 18 // RL: clear graphics region
189 #define PLESC_DASH 19 // RL: draw dashed line
190
191 // Window parameter tags
192
193 #define PLSWIN_DEVICE 1 // device coordinates
194 #define PLSWIN_WORLD 2 // world coordinates
195
196 // PLplot Option table & support constants
197
198 // Option-specific settings
199
200 #define PL_OPT_ENABLED 0x0001 // Obsolete
201 #define PL_OPT_ARG 0x0002 // Option has an argment
202 #define PL_OPT_NODELETE 0x0004 // Don't delete after processing
203 #define PL_OPT_INVISIBLE 0x0008 // Make invisible
204 #define PL_OPT_DISABLED 0x0010 // Processing is disabled
205
206 // Option-processing settings -- mutually exclusive
207
208 #define PL_OPT_FUNC 0x0100 // Call handler function
209 #define PL_OPT_BOOL 0x0200 // Set *var = 1
210 #define PL_OPT_INT 0x0400 // Set *var = atoi(optarg)
211 #define PL_OPT_FLOAT 0x0800 // Set *var = atof(optarg)
212 #define PL_OPT_STRING 0x1000 // Set var = optarg
213
214 // Global mode settings
215 // These override per-option settings
216
217 #define PL_PARSE_PARTIAL 0x0000 // For backward compatibility
218 #define PL_PARSE_FULL 0x0001 // Process fully & exit if error
219 #define PL_PARSE_QUIET 0x0002 // Don't issue messages
220 #define PL_PARSE_NODELETE 0x0004 // Don't delete options after
221 // processing
222 #define PL_PARSE_SHOWALL 0x0008 // Show invisible options
223 #define PL_PARSE_OVERRIDE 0x0010 // Obsolete
224 #define PL_PARSE_NOPROGRAM 0x0020 // Program name NOT in *argv[0]..
225 #define PL_PARSE_NODASH 0x0040 // Set if leading dash NOT required
226 #define PL_PARSE_SKIP 0x0080 // Skip over unrecognized args
227
228 // Obsolete names
229
230 #define plParseInternalOpts( a, b, c ) plparseopts( a, b, c )
231 #define plSetInternalOpt( a, b ) plSetOpt( a, b )
232
233 // Option table definition
234
235 typedef struct
236 {
237 char *opt;
238 int ( *handler )( char *, char *, void * );
239 void *client_data;
240 void *var;
241 long mode;
242 char *syntax;
243 char *desc;
244 } PLOptionTable;
245
246 // PLplot Graphics Input structure
247
248 #define PL_MAXKEY 16
249
250 typedef struct
251 {
252 int type; // of event (CURRENTLY UNUSED)
253 unsigned int state; // key or button mask
254 unsigned int keysym; // key selected
255 unsigned int button; // mouse button selected
256 PLINT subwindow; // subwindow (alias subpage, alias subplot) number
257 char string[PL_MAXKEY]; // translated string
258 int pX, pY; // absolute device coordinates of pointer
259 PLFLT dX, dY; // relative device coordinates of pointer
260 PLFLT wX, wY; // world coordinates of pointer
261 } PLGraphicsIn;
262
263 // Structure for describing the plot window
264
265 #define PL_MAXWINDOWS 64 // Max number of windows/page tracked
266
267 typedef struct
268 {
269 PLFLT dxmi, dxma, dymi, dyma; // min, max window rel dev coords
270 PLFLT wxmi, wxma, wymi, wyma; // min, max window world coords
271 } PLWindow;
272
273 // Structure for doing display-oriented operations via escape commands
274 // May add other attributes in time
275
276 typedef struct
277 {
278 unsigned int x, y; // upper left hand corner
279 unsigned int width, height; // window dimensions
280 } PLDisplay;
281
282 // Macro used (in some cases) to ignore value of argument
283 // I don't plan on changing the value so you can hard-code it
284
285 #define PL_NOTSET ( -42 )
286
287 // See plcont.c for examples of the following
288
289 //
290 // PLfGrid is for passing (as a pointer to the first element) an arbitrarily
291 // dimensioned array. The grid dimensions MUST be stored, with a maximum of 3
292 // dimensions assumed for now.
293 //
294
295 typedef struct
296 {
297 PLFLT *f;
298 PLINT nx, ny, nz;
299 } PLfGrid;
300
301 //
302 // PLfGrid2 is for passing (as an array of pointers) a 2d function array. The
303 // grid dimensions are passed for possible bounds checking.
304 //
305
306 typedef struct
307 {
308 PLFLT **f;
309 PLINT nx, ny;
310 } PLfGrid2;
311
312 //
313 // NOTE: a PLfGrid3 is a good idea here but there is no way to exploit it yet
314 // so I'll leave it out for now.
315 //
316
317 //
318 // PLcGrid is for passing (as a pointer to the first element) arbitrarily
319 // dimensioned coordinate transformation arrays. The grid dimensions MUST be
320 // stored, with a maximum of 3 dimensions assumed for now.
321 //
322
323 typedef struct
324 {
325 PLFLT *xg, *yg, *zg;
326 PLINT nx, ny, nz;
327 } PLcGrid;
328
329 //
330 // PLcGrid2 is for passing (as arrays of pointers) 2d coordinate
331 // transformation arrays. The grid dimensions are passed for possible bounds
332 // checking.
333 //
334
335 typedef struct
336 {
337 PLFLT **xg, **yg, **zg;
338 PLINT nx, ny;
339 } PLcGrid2;
340
341 //
342 // NOTE: a PLcGrid3 is a good idea here but there is no way to exploit it yet
343 // so I'll leave it out for now.
344 //
345
346 // PLColor is the usual way to pass an rgb color value.
347
348 typedef struct
349 {
350 unsigned char r; // red
351 unsigned char g; // green
352 unsigned char b; // blue
353 char *name;
354 } PLColor;
355
356 // PLControlPt is how cmap1 control points are represented.
357
358 typedef struct
359 {
360 PLFLT h; // hue
361 PLFLT l; // lightness
362 PLFLT s; // saturation
363 PLFLT p; // position
364 int alt_hue_path; // if set, interpolate through h=0
365 } PLControlPt;
366
367 // A PLBufferingCB is a control block for interacting with devices
368 // that support double buffering.
369
370 typedef struct
371 {
372 PLINT cmd;
373 PLINT result;
374 } PLBufferingCB;
375
376 #define PLESC_DOUBLEBUFFERING_ENABLE 1
377 #define PLESC_DOUBLEBUFFERING_DISABLE 2
378 #define PLESC_DOUBLEBUFFERING_QUERY 3
379
380
381 //--------------------------------------------------------------------------
382 // BRAINDEAD-ness
383 //
384 // Some systems allow the Fortran & C namespaces to clobber each other.
385 // For PLplot to work from Fortran on these systems, we must name the the
386 // externally callable C functions something other than their Fortran entry
387 // names. In order to make this as easy as possible for the casual user,
388 // yet reversible to those who abhor my solution, I have done the
389 // following:
390 //
391 // The C-language bindings are actually different from those
392 // described in the manual. Macros are used to convert the
393 // documented names to the names used in this package. The
394 // user MUST include plplot.h in order to get the name
395 // redefinition correct.
396 //
397 // Sorry to have to resort to such an ugly kludge, but it is really the
398 // best way to handle the situation at present. If all available
399 // compilers offer a way to correct this stupidity, then perhaps we can
400 // eventually reverse it.
401 //
402 // If you feel like screaming at someone (I sure do), please
403 // direct it at your nearest system vendor who has a braindead shared
404 // C/Fortran namespace. Some vendors do offer compiler switches that
405 // change the object names, but then everybody who wants to use the
406 // package must throw these same switches, leading to no end of trouble.
407 //
408 // Note that this definition should not cause any noticable effects except
409 // when debugging PLplot calls, in which case you will need to remember
410 // the real function names (same as before but with a 'c_' prepended).
411 //
412 // Also, to avoid macro conflicts, the BRAINDEAD part must not be expanded
413 // in the stub routines.
414 //
415 // Aside: the reason why a shared Fortran/C namespace is deserving of the
416 // BRAINDEAD characterization is that it completely precludes the the kind
417 // of universal API that is attempted (more or less) with PLplot, without
418 // Herculean efforts (e.g. remapping all of the C bindings by macros as
419 // done here). The vendors of such a scheme, in order to allow a SINGLE
420 // type of argument to be passed transparently between C and Fortran,
421 // namely, a pointer to a conformable data type, have slammed the door on
422 // insertion of stub routines to handle the conversions needed for other
423 // data types. Intelligent linkers could solve this problem, but these are
424 // not anywhere close to becoming universal. So meanwhile, one must live
425 // with either stub routines for the inevitable data conversions, or a
426 // different API. The former is what is used here, but is made far more
427 // difficult in a braindead shared Fortran/C namespace.
428 //--------------------------------------------------------------------------
429
430 #ifndef BRAINDEAD
431 #define BRAINDEAD
432 #endif
433
434 #ifdef BRAINDEAD
435
436 #ifndef __PLSTUBS_H__ // i.e. do not expand this in the stubs
437
438 #define pl_setcontlabelformat c_pl_setcontlabelformat
439 #define pl_setcontlabelparam c_pl_setcontlabelparam
440 #define pladv c_pladv
441 #define plarc c_plarc
442 #define plaxes c_plaxes
443 #define plbin c_plbin
444 #define plbop c_plbop
445 #define plbox c_plbox
446 #define plbox3 c_plbox3
447 #define plbtime c_plbtime
448 #define plcalc_world c_plcalc_world
449 #define plclear c_plclear
450 #define plcol0 c_plcol0
451 #define plcol1 c_plcol1
452 #define plconfigtime c_plconfigtime
453 #define plcont c_plcont
454 #define plcpstrm c_plcpstrm
455 #define plctime c_plctime
456 #define plend c_plend
457 #define plend1 c_plend1
458 #define plenv c_plenv
459 #define plenv0 c_plenv0
460 #define pleop c_pleop
461 #define plerrx c_plerrx
462 #define plerry c_plerry
463 #define plfamadv c_plfamadv
464 #define plfill c_plfill
465 #define plfill3 c_plfill3
466 #define plflush c_plflush
467 #define plfont c_plfont
468 #define plfontld c_plfontld
469 #define plgchr c_plgchr
470 #define plgcol0 c_plgcol0
471 #define plgcol0a c_plgcol0a
472 #define plgcolbg c_plgcolbg
473 #define plgcolbga c_plgcolbga
474 #define plgcompression c_plgcompression
475 #define plgdev c_plgdev
476 #define plgdidev c_plgdidev
477 #define plgdiori c_plgdiori
478 #define plgdiplt c_plgdiplt
479 #define plgfam c_plgfam
480 #define plgfci c_plgfci
481 #define plgfnam c_plgfnam
482 #define plgfont c_plgfont
483 #define plglevel c_plglevel
484 #define plgpage c_plgpage
485 #define plgra c_plgra
486 #define plgradient c_plgradient
487 #define plgriddata c_plgriddata
488 #define plgspa c_plgspa
489 #define plgstrm c_plgstrm
490 #define plgver c_plgver
491 #define plgvpd c_plgvpd
492 #define plgvpw c_plgvpw
493 #define plgxax c_plgxax
494 #define plgyax c_plgyax
495 #define plgzax c_plgzax
496 #define plhist c_plhist
497 #define plhls c_plhls
498 #define plhlsrgb c_plhlsrgb
499 #define plimage c_plimage
500 #define plimagefr c_plimagefr
501 #define plinit c_plinit
502 #define pljoin c_pljoin
503 #define pllab c_pllab
504 #define pllightsource c_pllightsource
505 #define plline c_plline
506 #define plline3 c_plline3
507 #define pllsty c_pllsty
508 #define plmesh c_plmesh
509 #define plmeshc c_plmeshc
510 #define plmkstrm c_plmkstrm
511 #define plmtex c_plmtex
512 #define plmtex3 c_plmtex3
513 #define plot3d c_plot3d
514 #define plot3dc c_plot3dc
515 #define plparseopts c_plparseopts
516 #define plpat c_plpat
517 #define plpoin c_plpoin
518 #define plpoin3 c_plpoin3
519 #define plpoly3 c_plpoly3
520 #define plprec c_plprec
521 #define plpsty c_plpsty
522 #define plptex c_plptex
523 #define plptex3 c_plptex3
524 #define plrandd c_plrandd
525 #define plreplot c_plreplot
526 #define plrgb c_plrgb
527 #define plrgb1 c_plrgb1
528 #define plrgbhls c_plrgbhls
529 #define plschr c_plschr
530 #define plscmap0 c_plscmap0
531 #define plscmap0a c_plscmap0a
532 #define plscmap0n c_plscmap0n
533 #define plscmap1 c_plscmap1
534 #define plscmap1a c_plscmap1a
535 #define plscmap1l c_plscmap1l
536 #define plscmap1la c_plscmap1la
537 #define plscmap1n c_plscmap1n
538 #define plscol0 c_plscol0
539 #define plscol0a c_plscol0a
540 #define plscolbg c_plscolbg
541 #define plscolbga c_plscolbga
542 #define plscolor c_plscolor
543 #define plscompression c_plscompression
544 #define plsdev c_plsdev
545 #define plsdidev c_plsdidev
546 #define plsdimap c_plsdimap
547 #define plsdiori c_plsdiori
548 #define plsdiplt c_plsdiplt
549 #define plsdiplz c_plsdiplz
550 #define plseed c_plseed
551 #define plsesc c_plsesc
552 #define plsfam c_plsfam
553 #define plsfci c_plsfci
554 #define plsfnam c_plsfnam
555 #define plsfont c_plsfont
556 #define plshades c_plshades
557 #define plshade c_plshade
558 #define plshade1 c_plshade1
559 #define plslabelfunc c_plslabelfunc
560 #define plsmaj c_plsmaj
561 #define plsmin c_plsmin
562 #define plsori c_plsori
563 #define plspage c_plspage
564 #define plspal0 c_plspal0
565 #define plspal1 c_plspal1
566 #define plspause c_plspause
567 #define plsstrm c_plsstrm
568 #define plssub c_plssub
569 #define plssym c_plssym
570 #define plstar c_plstar
571 #define plstart c_plstart
572 #define plstripa c_plstripa
573 #define plstripc c_plstripc
574 #define plstripd c_plstripd
575 #define plstyl c_plstyl
576 #define plsurf3d c_plsurf3d
577 #define plsvect c_plsvect
578 #define plsvpa c_plsvpa
579 #define plsxax c_plsxax
580 #define plsyax c_plsyax
581 #define plsym c_plsym
582 #define plszax c_plszax
583 #define pltext c_pltext
584 #define pltimefmt c_pltimefmt
585 #define plvasp c_plvasp
586 #define plvect c_plvect
587 #define plvpas c_plvpas
588 #define plvpor c_plvpor
589 #define plvsta c_plvsta
590 #define plw3d c_plw3d
591 #define plwidth c_plwidth
592 #define plwind c_plwind
593 #define plxormod c_plxormod
594
595 #endif // __PLSTUBS_H__
596
597 #endif // BRAINDEAD
598
599 // Redefine some old function names for backward compatibility
600
601 #ifndef __PLSTUBS_H__ // i.e. do not expand this in the stubs
602
603 #define plclr pleop
604 #define plpage plbop
605 #define plcol plcol0
606 #define plcontf plfcont
607 #define Alloc2dGrid plAlloc2dGrid
608 #define Free2dGrid plFree2dGrid
609
610 #endif // __PLSTUBS_H__
611
612 //--------------------------------------------------------------------------
613 // Function Prototypes
614 //--------------------------------------------------------------------------
615
616 #ifdef __cplusplus
617 extern "C" {
618 #endif
619
620 #include "plplot_octave_rej.h"
621
622 // All void types
623
624 // C routines callable from stub routines come first
625
626 // Advance to subpage "page", or to the next one if "page" = 0.
627
628 void c_pladv( PLINT page ); //%name pladv
629
630 // Plot an arc
631
632 void c_plarc( PLFLT x, PLFLT y, PLFLT a, PLFLT b, PLFLT angle1, PLFLT angle2,
633 PLFLT rotate, PLBOOL fill ); //%name plarc
634
635 // This functions similarly to plbox() except that the origin of the axes
636 // is placed at the user-specified point (x0, y0).
637
638 void c_plaxes( PLFLT x0, PLFLT y0, const char *xopt, PLFLT xtick, PLINT nxsub,
639 const char *yopt, PLFLT ytick, PLINT nysub ); //%name plaxes
640
641 // Plot a histogram using x to store data values and y to store frequencies
642
643 void c_plbin( PLINT nbin, PLFLT *x, PLFLT *y, PLINT center ); //%name plbin //%input x(nbin), y(nbin)
644
645 // Start new page. Should only be used with pleop().
646
647 void c_plbop( void ); //%name plbop
648
649 // This draws a box around the current viewport.
650
651 void c_plbox( const char *xopt, PLFLT xtick, PLINT nxsub,
652 const char *yopt, PLFLT ytick, PLINT nysub ); //%name plbox
653
654 // This is the 3-d analogue of plbox().
655
656 void c_plbox3( const char *xopt, const char *xlabel, PLFLT xtick, PLINT nsubx,
657 const char *yopt, const char *ylabel, PLFLT ytick, PLINT nsuby,
658 const char *zopt, const char *zlabel, PLFLT ztick, PLINT nsubz ); //%name plbox3
659
660 // Calculate broken-down time from continuous time for current stream.
661 void c_plbtime( PLINT *year, PLINT *month, PLINT *day, PLINT *hour, PLINT *min, PLFLT *sec, PLFLT ctime ); //%name plbtime //%output year, month, day, hour, min, sec
662
663 // Start new page. Should only be used with pleop().
664
665
666 // Set xor mode; 1-enter, 0-leave
667
668 void c_plxormod( PLINT mode, PLINT *status ); //%name plxormod //%output status
669
670 // Calculate world coordinates and subpage from relative device coordinates.
671
672 void c_plcalc_world( PLFLT rx, PLFLT ry, PLFLT *wx, PLFLT *wy, PLINT *window ); //%name plcalc_world //%output wx, wy, window
673
674 // Clear current subpage.
675
676 void c_plclear( void ); //%name plclear
677
678 // Set color, map 0. Argument is integer between 0 and 15.
679
680 void c_plcol0( PLINT icol0 ); //%name plcol0
681
682 inline void my_plcol( PLINT icol0 )
683 {
684 c_plcol0( icol0 );
685 } //%name plcol
686
687 // Set color, map 1. Argument is a float between 0. and 1.
688
689 void c_plcol1( PLFLT col1 ); //%name plcol1
690
691 // Configure transformation between continuous and broken-down time (and
692 // vice versa) for current stream.
693 void c_plconfigtime( PLFLT scale, PLFLT offset1, PLFLT offset2, PLINT ccontrol, PLBOOL ifbtime_offset, PLINT year, PLINT month, PLINT day, PLINT hour, PLINT min, PLFLT sec ); //%name plconfigtime
694
695 // Identity transformation.
696
697 void pltr0( PLFLT x, PLFLT y, PLFLT *tx, PLFLT *ty, PLPointer pltr_data ); //%nowrap
698
699 // Does linear interpolation from singly dimensioned coord arrays.
700
701 void pltr1( PLFLT x, PLFLT y, PLFLT *tx, PLFLT *ty, PLPointer pltr_data ); //%nowrap
702
703 // Does linear interpolation from doubly dimensioned coord arrays
704 // (column dominant, as per normal C 2d arrays).
705
706 void pltr2( PLFLT x, PLFLT y, PLFLT *tx, PLFLT *ty, PLPointer pltr_data ); //%nowrap
707
708 // Just like pltr2() but uses pointer arithmetic to get coordinates from
709 // 2d grid tables.
710
711 void pltr2p( PLFLT x, PLFLT y, PLFLT *tx, PLFLT *ty, PLPointer pltr_data ); //%nowrap
712
713 // One more hack. As it is not possible (and would not be desirable) to pass
714 // an Octave function to plcont(), I have defined three plcont():
715 // plcont uses a defined here xform()
716 // plcont0 uses pltr0()
717 // plcont1 uses pltr1()
718 // plcont2 uses pltr2()
719 // plcont2p uses pltr2p()
720 //
721 // Also, as plplot expect vectorized bidimensional arrays, I provided a
722 // f2c, which is a #define that does the necessary conversion.
723 //
724
725 void xform( PLFLT x, PLFLT y, PLFLT *tx, PLFLT *ty, PLPointer pltr_data )
726 {
727 *tx = *( (PLFLT *) pltr_data + 0 ) * x + *( (PLFLT *) pltr_data + 1 ) * y + *( (PLFLT *) pltr_data + 2 );
728 *ty = *( (PLFLT *) pltr_data + 3 ) * x + *( (PLFLT *) pltr_data + 4 ) * y + *( (PLFLT *) pltr_data + 5 );
729 } //%nowrap
730
731 // convert from Fortran like arrays (one vector), to C like 2D arrays
732
733 #define f2c( f, ff, nx, ny ) \
734 PLFLT * *ff; \
735 ff = (PLFLT **) alloca( nx * sizeof ( PLFLT * ) ); \
736 for ( int i = 0; i < nx; i++ ) { \
737 ff[i] = (PLFLT *) alloca( ny * sizeof ( PLFLT ) ); \
738 for ( int j = 0; j < ny; j++ ) \
739 *( ff[i] + j ) = *( f + nx * j + i );}
740
741 // simpler plcont() for use with xform()
742
743 void my_plcont( PLFLT *f, PLINT nx, PLINT ny, PLINT kx, PLINT lx, PLINT ky,
744 PLINT ly, PLFLT *clevel, PLINT nlevel, PLFLT *tr )
745 {
746 f2c( f, ff, nx, ny );
747 c_plcont( ff, nx, ny, kx, lx, ky, ly, clevel, nlevel, xform, tr );
748 } //%name plcont //%input f(nx,ny), clevel(nlevel), tr(6)
749
750 // plcont() for use with pltr0() NOT TESTED
751
752 void my_plcont0( PLFLT *f, PLINT nx, PLINT ny, PLINT kx, PLINT lx, PLINT ky,
753 PLINT ly, PLFLT *clevel, PLINT nlevel )
754 {
755 f2c( f, ff, nx, ny );
756 c_plcont( ff, nx, ny, kx, lx, ky, ly, clevel, nlevel, pltr0, NULL );
757 } //%name plcont0 //%input f(nx,ny), clevel(nlevel)
758
759 // plcont() for use with pltr1()
760
761 void my_plcont1( PLFLT *f, PLINT nx, PLINT ny, PLINT kx, PLINT lx, PLINT ky,
762 PLINT ly, PLFLT *clevel, PLINT nlevel, PLFLT *xg, PLFLT *yg )
763 {
764 PLcGrid grid1;
765 grid1.nx = nx; grid1.ny = ny;
766 grid1.xg = xg; grid1.yg = yg;
767 f2c( f, ff, nx, ny );
768 c_plcont( ff, nx, ny, kx, lx, ky, ly, clevel, nlevel, pltr1, &grid1 );
769 } //%name plcont1 //%input f(nx,ny), clevel(nlevel), xg(nx), yg(ny)
770
771 // plcont() for use with pltr2()
772
773 void my_plcont2( PLFLT *f, PLINT nx, PLINT ny, PLINT kx, PLINT lx, PLINT ky,
774 PLINT ly, PLFLT *clevel, PLINT nlevel, PLFLT *xg, PLFLT *yg )
775 {
776 PLcGrid2 grid2;
777 f2c( xg, xgg, nx, ny ); f2c( yg, ygg, nx, ny );
778 grid2.nx = nx; grid2.ny = ny;
779 grid2.xg = xgg; grid2.yg = ygg;
780 f2c( f, ff, nx, ny );
781 c_plcont( ff, nx, ny, kx, lx, ky, ly, clevel, nlevel, pltr2, &grid2 );
782 } //%name plcont2 //%input f(nx,ny), clevel(nlevel), xg(nx,ny), yg(nx,ny)
783
784 // plcont() for use with pltr2p()
785
786 void my_plcont2p( PLFLT *f, PLINT nx, PLINT ny, PLINT kx, PLINT lx, PLINT ky,
787 PLINT ly, PLFLT *clevel, PLINT nlevel, PLFLT *xg, PLFLT *yg )
788 {
789 PLcGrid2 grid2;
790 f2c( xg, xgg, nx, ny ); f2c( yg, ygg, nx, ny );
791 grid2.nx = nx; grid2.ny = ny;
792 grid2.xg = xgg; grid2.yg = ygg;
793 f2c( f, ff, nx, ny );
794 c_plcont( ff, nx, ny, kx, lx, ky, ly, clevel, nlevel, pltr2, &grid2 );
795 } //%name plcont2p //%input f(nx,ny), clevel(nlevel), xg(nx,ny), yg(nx,ny)
796
797 // Copies state parameters from the reference stream to the current stream.
798
799 void c_plcpstrm( PLINT iplsr, PLINT flags ); //%name plcpstrm
800
801 // Calculate continuous time from broken-down time for current stream.
802 void c_plctime( PLINT year, PLINT month, PLINT day, PLINT hour, PLINT min, PLFLT sec, PLFLT *ctime ); //%name plctime //%output ctime
803
804 // Converts input values from relative device coordinates to relative plot
805 // coordinates.
806
807 void pldid2pc( PLFLT *xmin, PLFLT *ymin, PLFLT *xmax, PLFLT *ymax );
808
809 // Converts input values from relative plot coordinates to relative
810 // device coordinates.
811
812 void pldip2dc( PLFLT *xmin, PLFLT *ymin, PLFLT *xmax, PLFLT *ymax );
813
814 // End a plotting session for all open streams.
815
816 void c_plend( void ); //%name plend
817
818 // End a plotting session for the current stream only.
819
820 void c_plend1( void ); //%name plend1
821
822 // Simple interface for defining viewport and window.
823
824 void c_plenv( PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax,
825 PLINT just, PLINT axis ); //%name plenv
826
827
828 void c_plenv0( PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax,
829 PLINT just, PLINT axis ); //%name plenv0
830
831 // End current page. Should only be used with plbop().
832
833 void c_pleop( void ); //%name pleop
834
835 // Plot horizontal error bars (xmin(i),y(i)) to (xmax(i),y(i))
836
837 void c_plerrx( PLINT n, PLFLT *xmin, PLFLT *xmax, PLFLT *y ); //%name plerrx //%input xmin(n), xmax(n), y(n)
838
839 // Plot vertical error bars (x,ymin(i)) to (x(i),ymax(i))
840
841 void c_plerry( PLINT n, PLFLT *x, PLFLT *ymin, PLFLT *ymax ); //%name plerry //%input ymin(n), ymax(n), x(n)
842
843 // Advance to the next family file on the next new page
844
845 void c_plfamadv( void ); //%name plfamadv
846
847 // Pattern fills the polygon bounded by the input points.
848
849 void c_plfill( PLINT n, PLFLT *x, PLFLT *y ); //%name plfill //%input x(n), y(n)
850
851 // Pattern fills the 3d polygon bounded by the input points.
852
853 void c_plfill3( PLINT n, PLFLT *x, PLFLT *y, PLFLT *z ); //%name plfill3 //%input x(n), y(n), z(n)
854
855 // Flushes the output stream. Use sparingly, if at all.
856
857 void c_plflush( void ); //%name plflush
858
859 // Sets the global font flag to 'ifont'.
860
861 void c_plfont( PLINT ifont ); //%name plfont
862
863 // Load specified font set.
864
865 void c_plfontld( PLINT fnt ); //%name plfontld
866
867 // Get character default height and current (scaled) height
868
869 void c_plgchr( PLFLT *p_def, PLFLT *p_ht ); //%name plgchr //%output p_def, p_ht
870
871 // Returns 8 bit RGB values for given color from color map 0
872
873 void c_plgcol0( PLINT icol0, PLINT *r, PLINT *g, PLINT *b ); //%name plgcol0 //%output r, g, b
874
875 // Returns 8 bit RGB + alpha values for given color from color map 0
876
877 void c_plgcol0a( PLINT icol0, PLINT *r, PLINT *g, PLINT *b, PLFLT *a ); //%name plgcol0a //%output r, g, b, a
878
879 // Returns the background color by 8 bit RGB value
880
881 void c_plgcolbg( PLINT *r, PLINT *g, PLINT *b ); //%name plgcolbg //%output r, g, b
882
883 // Returns the background color by 8 bit RGB + alpha values
884
885 void c_plgcolbga( PLINT *r, PLINT *g, PLINT *b, PLFLT *a ); //%name plgcolbga //%output r, g, b, a
886
887 // Returns the current compression setting
888
889 void c_plgcompression( PLINT *compression ); //%name plgcompression //%output compression
890
891 // Get the current device (keyword) name
892
893 void c_plgdev( char *p_dev ); //%name plgdev //%output p_dev(80)
894
895 // Retrieve current window into device space
896
897 void c_plgdidev( PLFLT *p_mar, PLFLT *p_aspect, PLFLT *p_jx, PLFLT *p_jy ); //%name plgdidev //%output p_mar, p_aspect, p_jx, p_jy
898
899 // Get plot orientation
900
901 void c_plgdiori( PLFLT *p_rot ); //%name plgdiori //%output p_rot
902
903 // Retrieve current window into plot space
904
905 void c_plgdiplt( PLFLT *p_xmin, PLFLT *p_ymin, PLFLT *p_xmax, PLFLT *p_ymax ); //%name plgdiplt //%output p_xmin, p_ymin, p_xmax, p_ymax
906
907 // Get FCI (font characterization integer)
908
909 void c_plgfci( PLUNICODE *pfci ); //%name plgfci //%output pfci
910
911 // Get family file parameters
912
913 void c_plgfam( PLINT *p_fam, PLINT *p_num, PLINT *p_bmax ); //%name plgfam //%output p_fam, p_num, p_bmax
914
915 // Get the (current) output file name. Must be preallocated to >80 bytes
916
917 void c_plgfnam( char *fnam ); //%name plgfnam //%output fnam(80)
918
919 // Get the current font family, style and weight
920
921 void c_plgfont( PLINT *p_family, PLINT *p_style, PLINT *p_weight ); //%name plgfont //%output p_family, p_style, p_weight
922
923 // Get the (current) run level.
924
925 void c_plglevel( PLINT *p_level ); //%name plglevel //%output p_level
926
927 // Get output device parameters.
928
929 void c_plgpage( PLFLT *p_xp, PLFLT *p_yp, PLINT *p_xleng, PLINT *p_yleng,
930 PLINT *p_xoff, PLINT *p_yoff ); //%name plgpage //%output p_xp, p_yp, p_xleng, p_yleng, p_xoff, p_yoff
931
932 // Switches to graphics screen.
933
934 void c_plgra( void ); //%name plgra
935
936 // Draw gradient in polygon.
937
938 void c_plgradient( PLINT n, PLFLT *x, PLFLT *y, PLFLT angle ); //%name plgradient //%input x(n), y(n)
939
940 void plgriddata( PLFLT *x, PLFLT *y, PLFLT *z, int npts,
941 PLFLT *xg, int nptsx, PLFLT *yg, int nptsy,
942 PLFLT **zg, int type, PLFLT data ); //%nowrap
943
944 void my_plgriddata( PLFLT *x, PLFLT *y, PLFLT *z, int npts,
945 PLFLT *xg, int nptsx, PLFLT *yg, int nptsy,
946 PLFLT *zg, int type, PLFLT data )
947 {
948 f2c( zg, zgg, nptsx, nptsy );
949 plgriddata( x, y, z, npts, xg, nptsx, yg, nptsy, zgg, type, data );
950 for ( int i = 0; i < nptsx; i++ )
951 for ( int j = 0; j < nptsy; j++ )
952 *( zg + nptsx * j + i ) = zgg[i][j];
953 } //%name plgriddata //%input x(npts), y(npts), z(npts), xg(nptsx), yg(nptsy) //%output zg(nptsx, nptsy)
954
955 // type of gridding algorithm for plgriddata()
956
957 #define GRID_CSA 1 // Bivariate Cubic Spline approximation
958 #define GRID_DTLI 2 // Delaunay Triangulation Linear Interpolation
959 #define GRID_NNI 3 // Natural Neighbors Interpolation
960 #define GRID_NNIDW 4 // Nearest Neighbors Inverse Distance Weighted
961 #define GRID_NNLI 5 // Nearest Neighbors Linear Interpolation
962 #define GRID_NNAIDW 6 // Nearest Neighbors Around Inverse Distance Weighted
963
964 // Get subpage boundaries in absolute coordinates
965
966 void c_plgspa( PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax ); //%name plgspa //%output xmin, xmax, ymin, ymax
967
968 // Get current stream number.
969
970 void c_plgstrm( PLINT *p_strm ); //%name plgstrm //%output p_strm
971
972 // Get the current library version number
973
974 void c_plgver( char *p_ver ); //%output p_ver(20) //%name plgver
975
976 // Get viewport boundaries in normalized device coordinates
977
978 void c_plgvpd( PLFLT *p_xmin, PLFLT *p_xmax, PLFLT *p_ymin, PLFLT *p_ymax ); //%name plgvpd //%output p_xmin, p_xmax, p_ymin, p_ymax
979
980 // Get viewport boundaries in world coordinates
981
982 void c_plgvpw( PLFLT *p_xmin, PLFLT *p_xmax, PLFLT *p_ymin, PLFLT *p_ymax ); //%name plgvpw //%output p_xmin, p_xmax, p_ymin, p_ymax
983
984 // Get x axis labeling parameters
985
986 void c_plgxax( PLINT *p_digmax, PLINT *p_digits ); //%name plgxax //%output p_digmax, p_digits
987
988 // Get y axis labeling parameters
989
990 void c_plgyax( PLINT *p_digmax, PLINT *p_digits ); //%name plgyax //%output p_digmax, p_digits
991
992 // Get z axis labeling parameters
993
994 void c_plgzax( PLINT *p_digmax, PLINT *p_digits ); //%name plgzax //%output p_digmax, p_digits
995
996 // Draws a histogram of n values of a variable in array data[0..n-1]
997
998 void c_plhist( PLINT n, PLFLT *data, PLFLT datmin, PLFLT datmax,
999 PLINT nbin, PLINT oldwin ); //%name plhist //%input data(n)
1000
1001 // Set current color (map 0) by hue, lightness, and saturation.
1002
1003 void c_plhls( PLFLT h, PLFLT l, PLFLT s ); //%name plhls
1004
1005 // Function for converting between HLS and RGB color space
1006
1007 void c_plhlsrgb( PLFLT h, PLFLT l, PLFLT s, PLFLT *p_r, PLFLT *p_g, PLFLT *p_b ); //%name plhlsrgb //%output p_r, p_g, p_b
1008
1009 // Initializes PLplot, using preset or default options
1010
1011 void c_plinit( void ); //%name plinit
1012
1013 // Draws a line segment from (x1, y1) to (x2, y2).
1014
1015 void c_pljoin( PLFLT x1, PLFLT y1, PLFLT x2, PLFLT y2 ); //%name pljoin
1016
1017 // Simple routine for labelling graphs.
1018
1019 void c_pllab( const char *xlabel, const char *ylabel, const char *tlabel ); //%name pllab
1020
1021 // Sets position of the light source
1022
1023 void c_pllightsource( PLFLT x, PLFLT y, PLFLT z ); //%name pllightsource
1024
1025 // Draws line segments connecting a series of points.
1026
1027 void c_plline( PLINT n, PLFLT *x, PLFLT *y ); //%input x(n), y(n) //%name plline
1028
1029 // Draws a line in 3 space.
1030
1031 void c_plline3( PLINT n, PLFLT *x, PLFLT *y, PLFLT *z ); //%name plline3 //%input x(n), y(n), z(n)
1032
1033 // Set line style.
1034
1035 void c_pllsty( PLINT lin ); //%name pllsty
1036
1037 // Plots a mesh representation of the function z[x][y].
1038
1039 void c_plmesh( PLFLT *x, PLFLT *y, PLFLT **z, PLINT nx, PLINT ny, PLINT opt ); //%nowrap
1040
1041 void my_plmesh( PLFLT *x, PLFLT *y, PLFLT *z, PLINT nx, PLINT ny, PLINT opt )
1042 {
1043 f2c( z, zz, nx, ny );
1044 c_plmesh( x, y, zz, nx, ny, opt );
1045 } //%name plmesh //%input x(nx), y(ny), z(nx,ny)
1046
1047 // Plots a mesh representation of the function z[x][y] with contour
1048
1049 void c_plmeshc( PLFLT *x, PLFLT *y, PLFLT **z, PLINT nx, PLINT ny, PLINT opt, PLFLT *clevel, PLINT nlevel ); //%nowrap
1050
1051 void my_plmeshc( PLFLT *x, PLFLT *y, PLFLT *z, PLINT nx, PLINT ny, PLINT opt, PLFLT *clevel, PLINT nlevel )
1052 {
1053 f2c( z, zz, nx, ny );
1054 c_plmeshc( x, y, zz, nx, ny, opt, clevel, nlevel );
1055 } //%name plmeshc //%input x(nx), y(ny), z(nx,ny), clevel(nlevel)
1056
1057 // Creates a new stream and makes it the default.
1058
1059 void c_plmkstrm( PLINT *p_strm ); //%name plmkstrm //%output p_strm
1060
1061 // Prints out "text" at specified position relative to viewport
1062
1063 void c_plmtex( const char *side, PLFLT disp, PLFLT pos, PLFLT just,
1064 const char *text ); //%name plmtex
1065
1066 // Prints out "text" at specified position relative to viewport (3D)
1067
1068 void c_plmtex3( const char *side, PLFLT disp, PLFLT pos, PLFLT just,
1069 const char *text ); //%name plmtex3
1070
1071 // Plots a 3-d representation of the function z[x][y].
1072
1073 void c_plot3d( PLFLT *x, PLFLT *y, PLFLT **z,
1074 PLINT nx, PLINT ny, PLINT opt, PLINT side ); //%nowrap
1075
1076 void my_plot3d( PLFLT *x, PLFLT *y, PLFLT *z,
1077 PLINT nx, PLINT ny, PLINT opt, PLINT side )
1078 {
1079 f2c( z, zz, nx, ny )
1080 c_plot3d( x, y, zz, nx, ny, opt, side );
1081 } //%name plot3d //%input x(nx), y(ny), z(nx,ny)
1082
1083 // Plots a 3-d representation of the function z[x][y] with contour
1084
1085 void c_plot3dc( PLFLT *x, PLFLT *y, PLFLT **z,
1086 PLINT nx, PLINT ny, PLINT opt,
1087 PLFLT *clevel, PLINT nlevel ); //%nowrap
1088
1089 void my_plot3dc( PLFLT *x, PLFLT *y, PLFLT *z,
1090 PLINT nx, PLINT ny, PLINT opt,
1091 PLFLT *clevel, PLINT nlevel )
1092 {
1093 f2c( z, zz, nx, ny )
1094 c_plot3dc( x, y, zz, nx, ny, opt, clevel, nlevel );
1095 } //%name plot3dc //%input x(nx), y(ny), z(nx,ny), clevel(nlevel)
1096
1097 // Plots the 3-d surface representation of the function z[x][y].
1098
1099 void c_plsurf3d( PLFLT *x, PLFLT *y, PLFLT **z,
1100 PLINT nx, PLINT ny, PLINT opt, PLFLT *clevel, PLINT nlevel ); //%nowrap
1101
1102 void my_plsurf3d( PLFLT *x, PLFLT *y, PLFLT *z,
1103 PLINT nx, PLINT ny, PLINT opt, PLFLT *clevel, PLINT nlevel )
1104 {
1105 f2c( z, zz, nx, ny )
1106 c_plsurf3d( x, y, zz, nx, ny, opt, clevel, nlevel );
1107 } //%name plsurf3d //%input x(nx), y(ny), z(nx,ny), clevel(nlevel)
1108
1109 // Set fill pattern directly.
1110
1111 void c_plpat( PLINT nlin, PLINT *inc, PLINT *del ); //%name plpat //%input inc(nlin), del(nlin)
1112
1113 // Plots array y against x for n points using ASCII code "code".
1114
1115 void c_plpoin( PLINT n, PLFLT *x, PLFLT *y, PLINT code ); //%input x(n), y(n) //%name plpoin
1116
1117 // Draws a series of points in 3 space.
1118
1119 void c_plpoin3( PLINT n, PLFLT *x, PLFLT *y, PLFLT *z, PLINT code ); //%name plpoin3 //%input x(n), y(n), z(n)
1120
1121 // Draws a polygon in 3 space.
1122
1123 void c_plpoly3( PLINT n, PLFLT *x, PLFLT *y, PLFLT *z, PLINT *draw, PLINT ifcc ); //%nowrap
1124
1125 void my_plpoly3( PLINT n, PLFLT *x, PLFLT *y, PLFLT *z, PLINT *draw, PLINT clockwise )
1126 {
1127 c_plpoly3( n, x, y, z, draw, ( 1 - clockwise ) / 2 );
1128 } //%name plpoly3 //%input x(n), y(n), z(n), draw(4)
1129
1130 // Set the floating point precision (in number of places) in numeric labels.
1131
1132 void c_plprec( PLINT setp, PLINT prec ); //%name plprec
1133
1134 // Set fill pattern, using one of the predefined patterns.
1135
1136 void c_plpsty( PLINT patt ); //%name plpsty
1137
1138 // Prints out "text" at world cooordinate (x,y).
1139
1140 void c_plptex( PLFLT x, PLFLT y, PLFLT dx, PLFLT dy, PLFLT just, const char *text ); //%name plptex
1141
1142 // Prints out "text" at world cooordinate (x,y,z).
1143
1144 void c_plptex3( PLFLT wx, PLFLT wy, PLFLT wz, PLFLT dx, PLFLT dy, PLFLT dz, PLFLT sx, PLFLT sy, PLFLT sz, PLFLT just, const char *text ); //%name plptex3
1145
1146 // Random number generator based on Mersenne Twister.
1147 // Obtain real random number in range [0,1].
1148
1149 PLFLT c_plrandd( void ); //%name plrandd
1150
1151 // Replays contents of plot buffer to current device/file.
1152
1153 void c_plreplot( void ); //%name plreplot
1154
1155 // Set line color by red, green, blue from 0. to 1.
1156
1157 void c_plrgb( PLFLT r, PLFLT g, PLFLT b ); //%name plrgb
1158
1159 // Set line color by 8 bit RGB values.
1160
1161 void c_plrgb1( PLINT r, PLINT g, PLINT b ); //%name plrgb1
1162
1163 // Function for converting between HLS and RGB color space
1164
1165 void c_plrgbhls( PLFLT r, PLFLT g, PLFLT b, PLFLT *p_h, PLFLT *p_l, PLFLT *p_s ); //%name plrgbhls //%output p_h, p_l, p_s
1166
1167 // Set character height.
1168
1169 void c_plschr( PLFLT def, PLFLT scale ); //%name plschr
1170
1171 // Set number of colors in cmap 0
1172
1173 void c_plscmap0n( PLINT ncol0 ); //%name plscmap0n
1174
1175 // Set number of colors in cmap 1
1176
1177 void c_plscmap1n( PLINT ncol1 ); //%name plscmap1n
1178
1179 // Set color map 0 colors by 8 bit RGB values
1180
1181 void c_plscmap0( PLINT *r, PLINT *g, PLINT *b, PLINT ncol0 ); //%name plscmap0 //%input r(ncol0), g(ncol0), b(ncol0)
1182
1183 // Set color map 1 colors by 8 bit RGB values
1184
1185 void c_plscmap1( PLINT *r, PLINT *g, PLINT *b, PLINT ncol1 ); //%name plscmap1 //%input r(ncol1), g(ncol1), b(ncol1)
1186
1187 // Set color map 1 colors using a piece-wise linear relationship between
1188 // intensity [0,1] (cmap 1 index) and position in HLS or RGB color space.
1189
1190 void c_plscmap1l( PLINT itype, PLINT npts, PLFLT *intensity,
1191 PLFLT *coord1, PLFLT *coord2, PLFLT *coord3, PLINT *alt_hue_path );
1192 //%name plscmap1l //%input intensity(npts), coord1(npts), coord2(npts), coord3(npts), alt_hue_path(npts)
1193
1194 // Set a given color from color map 0 by 8 bit RGB value
1195
1196 void c_plscol0( PLINT icol0, PLINT r, PLINT g, PLINT b ); //%name plscol0
1197
1198 // Set the background color by 8 bit RGB value
1199
1200 void c_plscolbg( PLINT r, PLINT g, PLINT b ); //%name plscolbg
1201
1202 // Set color map 0 colors by 8 bit RGB + alpha values
1203
1204 void c_plscmap0a( PLINT *r, PLINT *g, PLINT *b, PLFLT *a, PLINT ncol0 ); //%name plscmap0a //%input r(ncol0), g(ncol0), b(ncol0), a(ncol0)
1205
1206 // Set color map 1 colors by 8 bit RGB + alpha values
1207
1208 void c_plscmap1a( PLINT *r, PLINT *g, PLINT *b, PLFLT *a, PLINT ncol1 ); //%name plscmap1a //%input r(ncol1), g(ncol1), b(ncol1), a(ncol1)
1209
1210 // Set color map 1 colors using a piece-wise linear relationship between
1211 // intensity [0,1] (cmap 1 index) and position in HLS or RGB color space
1212 // and alpha transparency value.
1213
1214 void c_plscmap1la( PLINT itype, PLINT npts, PLFLT *intensity,
1215 PLFLT *coord1, PLFLT *coord2, PLFLT *coord3, PLFLT *a, PLINT *alt_hue_path );
1216 //%name plscmap1la //%input intensity(npts), coord1(npts), coord2(npts), coord3(npts), a(npts), alt_hue_path(npts)
1217
1218 // Set a given color from color map 0 by 8 bit RGB + alpha value
1219
1220 void c_plscol0a( PLINT icol0, PLINT r, PLINT g, PLINT b, PLFLT a ); //%name plscol0a
1221
1222 // Set the background color by 8 bit RGB + alpha value
1223
1224 void c_plscolbga( PLINT r, PLINT g, PLINT b, PLFLT a ); //%name plscolbga
1225
1226 // Used to globally turn color output on/off
1227
1228 void c_plscolor( PLINT color ); //%name plscolor
1229
1230 // Set the compression level
1231
1232 void c_plscompression( PLINT compression ); //%name plscompression
1233
1234 // Set the device (keyword) name
1235
1236 void c_plsdev( const char *devname ); //%name plsdev
1237
1238 // Set window into device space using margin, aspect ratio, and
1239 // justification
1240
1241 void c_plsdidev( PLFLT mar, PLFLT aspect, PLFLT jx, PLFLT jy ); //%name plsdidev
1242
1243 // Set up transformation from metafile coordinates.
1244
1245 void c_plsdimap( PLINT dimxmin, PLINT dimxmax, PLINT dimymin, PLINT dimymax,
1246 PLFLT dimxpmm, PLFLT dimypmm ); //%name plsdimap
1247
1248 // Set plot orientation, specifying rotation in units of pi/2.
1249
1250 void c_plsdiori( PLFLT rot ); //%name plsdiori
1251
1252 // Set window into plot space
1253
1254 void c_plsdiplt( PLFLT xmin, PLFLT ymin, PLFLT xmax, PLFLT ymax ); //%name plsdiplt
1255
1256 // Set window into plot space incrementally (zoom)
1257
1258 void c_plsdiplz( PLFLT xmin, PLFLT ymin, PLFLT xmax, PLFLT ymax ); //%name plsdiplz
1259
1260 // Set seed for internal random number generator
1261
1262 void c_plseed( unsigned s ); //%name plseed
1263
1264 // Set the escape character for text strings.
1265
1266 void c_plsesc( char esc ); //%name plsesc
1267
1268 // set offset and spacing of contour labels
1269
1270 void c_pl_setcontlabelparam( PLFLT offset, PLFLT size, PLFLT spacing, PLINT active ); //%name pl_setcontlabelparam
1271
1272 // set the format of the contour labels
1273
1274 void c_pl_setcontlabelformat( PLINT lexp, PLINT sigdig ); //%name pl_setcontlabelformat
1275
1276 // Set family file parameters
1277
1278 void c_plsfam( PLINT fam, PLINT num, PLINT bmax ); //%name plsfam
1279
1280 // Set FCI (font characterization integer)
1281
1282 void c_plsfci( PLUNICODE fci ); //%name plsfci
1283
1284 // Set the current font family, style and weight
1285
1286 void c_plsfont( PLINT family, PLINT style, PLINT weight ); //%name plsfont
1287
1288
1289 // Set the output file name.
1290
1291 void c_plsfnam( const char *fnam ); //%name plsfnam
1292
1293 // The same as in plcont. I have hardcoded the first function pointer
1294 // to plfill(). The second function pointer will use the same convention
1295 // as in plcont().
1296 //
1297
1298 // the simpler plshade()
1299
1300 void my_plshade( PLFLT *a, PLINT nx, PLINT ny, PLFLT *defined,
1301 PLFLT left, PLFLT right, PLFLT bottom, PLFLT top,
1302 PLFLT shade_min, PLFLT shade_max,
1303 PLINT sh_cmap, PLFLT sh_color, PLINT sh_width,
1304 PLINT min_color, PLINT min_width,
1305 PLINT max_color, PLINT max_width,
1306 PLINT rectangular, PLFLT *tr )
1307 {
1308 f2c( a, aa, nx, ny );
1309 c_plshade( aa, nx, ny, NULL, left, right, bottom, top,
1310 shade_min, shade_max, sh_cmap, sh_color, sh_width,
1311 min_color, min_width, max_color, max_width,
1312 plfill, rectangular, xform, tr );
1313 } //%name plshade //%input a(nx, ny), tr(6)
1314
1315 // plshade() for use with pltr1
1316
1317 void my_plshade1( PLFLT *a, PLINT nx, PLINT ny, const char *defined,
1318 PLFLT left, PLFLT right, PLFLT bottom, PLFLT top,
1319 PLFLT shade_min, PLFLT shade_max,
1320 PLINT sh_cmap, PLFLT sh_color, PLINT sh_width,
1321 PLINT min_color, PLINT min_width,
1322 PLINT max_color, PLINT max_width,
1323 PLINT rectangular, PLFLT *xg, PLFLT *yg )
1324 {
1325 PLcGrid grid1;
1326 grid1.nx = nx; grid1.ny = ny;
1327 grid1.xg = xg; grid1.yg = yg;
1328 f2c( a, aa, nx, ny );
1329 c_plshade( aa, nx, ny, NULL, left, right, bottom, top,
1330 shade_min, shade_max, sh_cmap, sh_color, sh_width,
1331 min_color, min_width, max_color, max_width,
1332 plfill, rectangular, pltr1, &grid1 );
1333 } //%name plshade1 //%input a(nx, ny), xg(nx), yg(ny)
1334
1335 // plshade() for use with pltr2
1336
1337 void my_plshade2( PLFLT *a, PLINT nx, PLINT ny, const char *defined,
1338 PLFLT left, PLFLT right, PLFLT bottom, PLFLT top,
1339 PLFLT shade_min, PLFLT shade_max,
1340 PLINT sh_cmap, PLFLT sh_color, PLINT sh_width,
1341 PLINT min_color, PLINT min_width,
1342 PLINT max_color, PLINT max_width,
1343 PLINT rectangular, PLFLT *xg, PLFLT *yg )
1344 {
1345 PLcGrid2 grid2;
1346 f2c( xg, xgg, nx, ny ); f2c( yg, ygg, nx, ny );
1347 grid2.nx = nx; grid2.ny = ny;
1348 grid2.xg = xgg; grid2.yg = ygg;
1349 f2c( a, aa, nx, ny );
1350 c_plshade( aa, nx, ny, NULL, left, right, bottom, top,
1351 shade_min, shade_max, sh_cmap, sh_color, sh_width,
1352 min_color, min_width, max_color, max_width,
1353 plfill, rectangular, pltr2, &grid2 );
1354 } //%name plshade2 //%input a(nx, ny), xg(nx,ny), yg(nx,ny)
1355
1356 void my_plshades( PLFLT *a, PLINT nx, PLINT ny,
1357 PLFLT left, PLFLT right, PLFLT bottom, PLFLT top,
1358 PLFLT *clevel, PLINT nlevel, PLINT fill_width,
1359 PLINT cont_color, PLINT cont_width,
1360 PLINT rectangular )
1361 {
1362 f2c( a, aa, nx, ny );
1363 c_plshades( aa, nx, ny, NULL, left, right, bottom, top,
1364 clevel, nlevel, fill_width, cont_color, cont_width,
1365 plfill, rectangular, NULL, NULL );
1366 } //%name plshades //%input a(nx, ny), clevel(nlevel)
1367
1368 void my_plshadesx( PLFLT *a, PLINT nx, PLINT ny,
1369 PLFLT left, PLFLT right, PLFLT bottom, PLFLT top,
1370 PLFLT *clevel, PLINT nlevel, PLINT fill_width,
1371 PLINT cont_color, PLINT cont_width,
1372 PLINT rectangular, PLFLT *tr )
1373 {
1374 f2c( a, aa, nx, ny );
1375 c_plshades( aa, nx, ny, NULL, left, right, bottom, top,
1376 clevel, nlevel, fill_width, cont_color, cont_width,
1377 plfill, rectangular, xform, tr );
1378 } //%name plshadesx //%input a(nx, ny), clevel(nlevel), tr(6)
1379
1380 void my_plshades1( PLFLT *a, PLINT nx, PLINT ny,
1381 PLFLT left, PLFLT right, PLFLT bottom, PLFLT top,
1382 PLFLT *clevel, PLINT nlevel, PLINT fill_width,
1383 PLINT cont_color, PLINT cont_width,
1384 PLINT rectangular, PLFLT *xg, PLFLT *yg )
1385 {
1386 PLcGrid grid1;
1387 grid1.nx = nx; grid1.ny = ny;
1388 grid1.xg = xg; grid1.yg = yg;
1389
1390 f2c( a, aa, nx, ny );
1391 c_plshades( aa, nx, ny, NULL, left, right, bottom, top,
1392 clevel, nlevel, fill_width, cont_color, cont_width,
1393 plfill, rectangular, pltr1, &grid1 );
1394 } //%name plshades1 //%input a(nx, ny), clevel(nlevel), xg(nx), yg(ny)
1395
1396
1397 void my_plshades2( PLFLT *a, PLINT nx, PLINT ny,
1398 PLFLT left, PLFLT right, PLFLT bottom, PLFLT top,
1399 PLFLT *clevel, PLINT nlevel, PLINT fill_width,
1400 PLINT cont_color, PLINT cont_width,
1401 PLINT rectangular, PLFLT *xg, PLFLT *yg )
1402 {
1403 PLcGrid2 grid2;
1404 f2c( xg, xgg, nx, ny ); f2c( yg, ygg, nx, ny );
1405 grid2.nx = nx; grid2.ny = ny;
1406 grid2.xg = xgg; grid2.yg = ygg;
1407 f2c( a, aa, nx, ny );
1408 c_plshades( aa, nx, ny, NULL, left, right, bottom, top,
1409 clevel, nlevel, fill_width, cont_color, cont_width,
1410 plfill, rectangular, pltr2, &grid2 );
1411 } //%name plshades2 //%input a(nx, ny), clevel(nlevel), xg(nx,ny), yg(nx,ny)
1412
1413 // Set up lengths of major tick marks.
1414
1415 void c_plsmaj( PLFLT def, PLFLT scale ); //%name plsmaj
1416
1417 // Set up lengths of minor tick marks.
1418
1419 void c_plsmin( PLFLT def, PLFLT scale ); //%name plsmin
1420
1421 // Set orientation. Must be done before calling plinit.
1422
1423 void c_plsori( PLINT ori ); //%name plsori
1424
1425 // Set output device parameters. Usually ignored by the driver.
1426
1427 void c_plspage( PLFLT xp, PLFLT yp, PLINT xleng, PLINT yleng,
1428 PLINT xoff, PLINT yoff ); //%name plspage
1429
1430 // Set the colors for color table 0 from a cmap0 file
1431
1432 void c_plspal0( const char *filename ); //%name plspal0
1433
1434 // Set the colors for color table 1 from a cmap1 file
1435
1436 void c_plspal1( const char *filename, PLINT interpolate ); //%name plspal1
1437
1438 // Set the pause (on end-of-page) status
1439
1440 void c_plspause( PLINT pause ); //%name plspause
1441
1442 // Set stream number.
1443
1444 void c_plsstrm( PLINT strm ); //%name plsstrm
1445
1446 // Set the number of subwindows in x and y
1447
1448 void c_plssub( PLINT nx, PLINT ny ); //%name plssub
1449
1450 // Set symbol height.
1451
1452 void c_plssym( PLFLT def, PLFLT scale ); //%name plssym
1453
1454 // Initialize PLplot, passing in the windows/page settings.
1455
1456 void c_plstar( PLINT nx, PLINT ny ); //%name plstar
1457
1458 // Initialize PLplot, passing the device name and windows/page settings.
1459
1460 void c_plstart( const char *devname, PLINT nx, PLINT ny ); //%name plstart
1461
1462 // Create 1d stripchart
1463
1464 void my_plstripc( int *id, char *xspec, char *yspec,
1465 PLFLT xmin, PLFLT xmax, PLFLT xjump, PLFLT ymin, PLFLT ymax,
1466 PLFLT xlpos, PLFLT ylpos,
1467 PLINT y_ascl, PLINT acc,
1468 PLINT colbox, PLINT collab,
1469 PLINT *colline, PLINT *styline,
1470 char *legline1, char *legline2, char *legline3, char *legline4,
1471 char *labx, char *laby, char *labtop )
1472 {
1473 char *legline[4];
1474 legline[0] = legline1; legline[1] = legline2;
1475 legline[2] = legline3; legline[3] = legline4;
1476 c_plstripc( id, xspec, yspec, xmin, xmax, xjump, ymin, ymax,
1477 xlpos, ylpos, y_ascl, acc, colbox, collab, colline, styline, legline,
1478 labx, laby, labtop );
1479 } //%novectorize //%name plstripc //%output id //%input colline(4), styline(4)
1480
1481 // Add a point to a stripchart.
1482
1483 void c_plstripa( PLINT id, PLINT pen, PLFLT x, PLFLT y ); //%name plstripa
1484
1485 // Deletes and releases memory used by a stripchart.
1486
1487 void c_plstripd( PLINT id ); //%name plstripd
1488
1489 // Set up a new line style
1490
1491 void c_plstyl( PLINT nms, PLINT *mark, PLINT *space ); //%name plstyl //%input mark(nms), space(nms)
1492
1493 // Set the vector style
1494
1495 void c_plsvect( PLFLT *arrowx, PLFLT *arrowy, PLINT npts, PLBOOL fill ); //%name plsvect //%input arrowx(npts), arrowy(npts)
1496
1497 // Sets the edges of the viewport to the specified absolute coordinates
1498
1499 void c_plsvpa( PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax ); //%name plsvpa
1500
1501 // Set x axis labeling parameters
1502
1503 void c_plsxax( PLINT digmax, PLINT digits ); //%name plsxax
1504
1505 // Set inferior X window
1506
1507 void plsxwin( PLINT window_id );
1508
1509 // Set y axis labeling parameters
1510
1511 void c_plsyax( PLINT digmax, PLINT digits ); //%name plsyax
1512
1513 // Plots array y against x for n points using Hershey symbol "code"
1514
1515 void c_plsym( PLINT n, PLFLT *x, PLFLT *y, PLINT code ); //%name plsym //%input x(n), y(n)
1516
1517 // Set z axis labeling parameters
1518
1519 void c_plszax( PLINT digmax, PLINT digits ); //%name plszax
1520
1521 // Switches to text screen.
1522
1523 void c_pltext( void ); //%name pltext
1524
1525 // Set the format for date / time labels.
1526
1527 void c_pltimefmt( const char *fmt ); //%name pltimefmt
1528
1529 // Sets the edges of the viewport with the given aspect ratio, leaving
1530 // room for labels.
1531
1532 void c_plvasp( PLFLT aspect ); //%name plvasp
1533
1534 // Plot an array of vector arrows - uses the same function pointer
1535 // convention as plcont
1536
1537 void my_plvect( PLFLT *u, PLFLT *v, PLINT nx, PLINT ny, PLFLT scale, PLFLT *tr )
1538 {
1539 f2c( u, uu, nx, ny );
1540 f2c( v, vv, nx, ny );
1541 c_plvect( uu, vv, nx, ny, scale, xform, tr );
1542 } //%name plvect //%input u(nx,ny), v(nx,ny), tr(6)
1543
1544 // plvect() for use with pltr1
1545 void my_plvect1( PLFLT *u, PLFLT *v, PLINT nx, PLINT ny, PLFLT scale, PLFLT *xg, PLFLT *yg )
1546 {
1547 PLcGrid grid1;
1548 grid1.nx = nx; grid1.ny = ny;
1549 grid1.xg = xg; grid1.yg = yg;
1550 f2c( u, uu, nx, ny );
1551 f2c( v, vv, nx, ny );
1552 c_plvect( uu, vv, nx, ny, scale, pltr1, &grid1 );
1553 } //%name plvect1 //%input u(nx,ny), v(nx,ny), xg(nx), yg(ny)
1554
1555 // plvect() for use with pltr2
1556 void my_plvect2( PLFLT *u, PLFLT *v, PLINT nx, PLINT ny, PLFLT scale, PLFLT *xg, PLFLT *yg )
1557 {
1558 PLcGrid2 grid2;
1559 f2c( xg, xgg, nx, ny ); f2c( yg, ygg, nx, ny );
1560 grid2.nx = nx; grid2.ny = ny;
1561 grid2.xg = xgg; grid2.yg = ygg;
1562 f2c( u, uu, nx, ny );
1563 f2c( v, vv, nx, ny );
1564 c_plvect( uu, vv, nx, ny, scale, pltr2, &grid2 );
1565 } //%name plvect2 //%input u(nx,ny), v(nx,ny), xg(nx,ny), yg(nx,ny)
1566
1567
1568 // Creates the largest viewport of the specified aspect ratio that fits
1569 // within the specified normalized subpage coordinates.
1570
1571 void c_plvpas( PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax, PLFLT aspect ); //%name plvpas
1572
1573 // Creates a viewport with the specified normalized subpage coordinates.
1574
1575 void c_plvpor( PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax ); //%name plvpor
1576
1577 // Defines a "standard" viewport with seven character heights for
1578 // the left margin and four character heights everywhere else.
1579
1580 void c_plvsta( void ); //%name plvsta
1581
1582 // Set up a window for three-dimensional plotting.
1583
1584 void c_plw3d( PLFLT basex, PLFLT basey, PLFLT height, PLFLT xmin0,
1585 PLFLT xmax0, PLFLT ymin0, PLFLT ymax0, PLFLT zmin0,
1586 PLFLT zmax0, PLFLT alt, PLFLT az ); //%name plw3d
1587
1588 // Set pen width.
1589
1590 void c_plwidth( PLFLT width ); //%name plwidth
1591
1592 // Set up world coordinates of the viewport boundaries (2d plots).
1593
1594 void c_plwind( PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax ); //%name plwind
1595
1596 //--------------------------------------------------------------------------
1597 // Functions for use from C or C++ only
1598 //--------------------------------------------------------------------------
1599
1600 // Returns a list of file-oriented device names and their menu strings
1601
1602 void plgFileDevs( char ***p_menustr, char ***p_devname, int *p_ndev ); //%nowrap
1603
1604 // Returns a list of all device names and their menu strings
1605
1606 void plgDevs( char ***p_menustr, char ***p_devname, int *p_ndev ); //%nowrap
1607
1608 // Set the variables to be used for storing error info
1609
1610 void plsError( PLINT *errcode, char *errmsg );
1611
1612 // Transformation routines
1613
1614 // Identity transformation for plots from Fortran.
1615
1616 void pltr0f( PLFLT x, PLFLT y, PLFLT *tx, PLFLT *ty, void *pltr_data ); //%nowrap
1617
1618 // Does linear interpolation from doubly dimensioned coord arrays
1619 // (row dominant, i.e. Fortran ordering).
1620
1621 void pltr2f( PLFLT x, PLFLT y, PLFLT *tx, PLFLT *ty, void *pltr_data ); //%nowrap
1622
1623 // Example linear transformation function for contour plotter.
1624
1625 // jc: defined above. void xform(PLFLT x, PLFLT y, PLFLT * tx, PLFLT * ty);
1626
1627 // Function evaluators
1628
1629 // Does a lookup from a 2d function array. Array is of type (PLFLT **),
1630 // and is column dominant (normal C ordering).
1631
1632 PLFLT plf2eval2( PLINT ix, PLINT iy, PLPointer plf2eval_data ); //%nowrap
1633
1634 // Does a lookup from a 2d function array. Array is of type (PLFLT *),
1635 // and is column dominant (normal C ordering).
1636
1637 PLFLT plf2eval( PLINT ix, PLINT iy, PLPointer plf2eval_data ); //%nowrap
1638
1639 // Does a lookup from a 2d function array. Array is of type (PLFLT *),
1640 // and is row dominant (Fortran ordering).
1641
1642 PLFLT plf2evalr( PLINT ix, PLINT iy, PLPointer plf2eval_data ); //%nowrap
1643
1644 // Command line parsing utilities
1645
1646 // Clear internal option table info structure.
1647
1648 void plClearOpts( void );
1649
1650 // Reset internal option table info structure.
1651
1652 void plResetOpts( void );
1653
1654 // Merge user option table into internal info structure.
1655
1656 int plMergeOpts( PLOptionTable *options, char *name, char **notes ); //%nowrap
1657
1658 // Set the strings used in usage and syntax messages.
1659
1660 void plSetUsage( char *program_string, char *usage_string );
1661
1662 // Process input strings, treating them as an option and argument pair.
1663
1664 int plSetOpt( char *opt, char *optarg );
1665
1666 // Process options list using current options info.
1667
1668 int plparseopts( int *p_argc, char **argv, PLINT mode ); //%novectorize
1669
1670 // Print usage & syntax message.
1671
1672 void plOptUsage( void );
1673
1674 // Miscellaneous
1675
1676 // Set the output file pointer
1677
1678 void plgfile( FILE **p_file ); //%nowrap
1679
1680 // Get the output file pointer
1681
1682 void plsfile( FILE *file ); //%nowrap
1683
1684 // Get the escape character for text strings.
1685
1686 void plgesc( char *p_esc ); //%nowrap
1687
1688 // Front-end to driver escape function.
1689
1690 void pl_cmd( PLINT op, void *ptr ); //%nowrap
1691
1692 // Return full pathname for given file if executable
1693
1694 int plFindName( char *p ); //%nowrap
1695
1696 // Looks for the specified executable file according to usual search path.
1697
1698 char *plFindCommand( char *fn ); //%nowrap
1699
1700 // Gets search name for file by concatenating the dir, subdir, and file
1701 // name, allocating memory as needed.
1702
1703 void plGetName( char *dir, char *subdir, char *filename, char **filespec ); //%nowrap
1704
1705 // Prompts human to input an integer in response to given message.
1706
1707 PLINT plGetInt( char *s );
1708
1709 // Prompts human to input a float in response to given message.
1710
1711 PLFLT plGetFlt( char *s );
1712
1713 // Nice way to allocate space for a vectored 2d grid
1714
1715 // Allocates a block of memory for use as a 2-d grid of PLFLT's.
1716
1717 void plAlloc2dGrid( PLFLT ***f, PLINT nx, PLINT ny ); //%nowrap
1718
1719 // Frees a block of memory allocated with plAlloc2dGrid().
1720
1721 void plFree2dGrid( PLFLT **f, PLINT nx, PLINT ny ); //%nowrap
1722
1723 // Wait for graphics input event and translate to world coordinates
1724
1725 int plGetCursor( PLGraphicsIn *gin ); //%nowrap
1726
1727 int my_plGetCursor( int *state, int *keysym, int *button, char *string, int *pX, int *pY, PLFLT *dX, PLFLT *dY, PLFLT *wX, PLFLT *wY, int *subwin )
1728 {
1729 PLGraphicsIn gin;
1730 int status; status = plGetCursor( &gin );
1731 *subwin = gin.subwindow; *state = gin.state; *keysym = gin.keysym; *button = gin.button; *string = gin.string[0];
1732 *pX = gin.pX; *pY = gin.pY; *dX = gin.dX; *dY = gin.dY; *wX = gin.wX; *wY = gin.wY;
1733 return status;
1734 } //%name plGetCursor //%output subwin, state, keysym, button, string(1), pX, pY, dX, dY, wX, wY
1735
1736 // Translates relative device coordinates to world coordinates.
1737
1738 int plTranslateCursor( PLGraphicsIn *gin ); //%nowrap
1739
1740 int my_plTranslateCursor( PLFLT *x, PLFLT *y, PLFLT x_in, PLFLT y_in )
1741 {
1742 PLGraphicsIn gin;
1743 int st;
1744 gin.dX = x_in; gin.dY = y_in;
1745 st = plTranslateCursor( &gin );
1746 *x = gin.wX; *y = gin.wY;
1747 return st;
1748 } //%name plTranslateCursor //%output x, y
1749
1750 void plimage( PLFLT **data, PLINT nx, PLINT ny,
1751 PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax,
1752 PLFLT zmin, PLFLT zmax,
1753 PLFLT Dxmin, PLFLT Dxmax, PLFLT Dymin, PLFLT Dymax ); //%nowrap
1754
1755 void my_plimage( PLFLT *a, PLINT nx, PLINT ny,
1756 PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax,
1757 PLFLT zmin, PLFLT zmax,
1758 PLFLT dxmin, PLFLT dxmax, PLFLT dymin, PLFLT dymax )
1759 {
1760 f2c( a, aa, nx, ny );
1761 plimage( aa, nx, ny, xmin, xmax, ymin, ymax, zmin, zmax, dxmin, dxmax, dymin, dymax );
1762 } //%name pplimage //%input a(nx, ny)
1763
1764 // Plot an image with distortion - uses the same function pointer
1765 // convention as plcont
1766
1767 void my_plimagefr( PLFLT *a, PLINT nx, PLINT ny,
1768 PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax,
1769 PLFLT zmin, PLFLT zmax,
1770 PLFLT valuemin, PLFLT valuemax )
1771 {
1772 f2c( a, aa, nx, ny );
1773 plimagefr( aa, nx, ny, xmin, xmax, ymin, ymax, zmin, zmax, valuemin, valuemax, NULL, NULL );
1774 } //%name plimagefr //%input a(nx,ny)
1775
1776 void my_plimagefrx( PLFLT *a, PLINT nx, PLINT ny,
1777 PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax,
1778 PLFLT zmin, PLFLT zmax,
1779 PLFLT valuemin, PLFLT valuemax, PLFLT *tr )
1780 {
1781 f2c( a, aa, nx, ny );
1782 plimagefr( aa, nx, ny, xmin, xmax, ymin, ymax, zmin, zmax, valuemin, valuemax, xform, tr );
1783 } //%name plimagefrx //%input a(nx,ny), tr(6)
1784
1785 // plimagefr() for use with pltr1
1786 void my_plimagefr1( PLFLT *a, PLINT nx, PLINT ny,
1787 PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax,
1788 PLFLT zmin, PLFLT zmax,
1789 PLFLT valuemin, PLFLT valuemax, PLFLT *xg, PLFLT *yg )
1790 {
1791 PLcGrid grid1;
1792 grid1.nx = nx + 1; grid1.ny = ny + 1;
1793 grid1.xg = xg; grid1.yg = yg;
1794 f2c( a, aa, nx, ny );
1795 c_plimagefr( aa, nx, ny, xmin, xmax, ymin, ymax, zmin, zmax, valuemin, valuemax, pltr1, &grid1 );
1796 } //%name plimagefr1 //%input a(nx,ny), xg(nx+1), yg(ny+1)
1797
1798 // plimagefr() for use with pltr2
1799 void my_plimagefr2( PLFLT *a, PLINT nx, PLINT ny,
1800 PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax,
1801 PLFLT zmin, PLFLT zmax,
1802 PLFLT valuemin, PLFLT valuemax, PLFLT *xg, PLFLT *yg )
1803 {
1804 PLcGrid2 grid2;
1805 f2c( xg, xgg, ( nx + 1 ), ( ny + 1 ) ); f2c( yg, ygg, ( nx + 1 ), ( ny + 1 ) );
1806 grid2.nx = nx + 1; grid2.ny = ny + 1;
1807 grid2.xg = xgg; grid2.yg = ygg;
1808 f2c( a, aa, nx, ny );
1809 c_plimagefr( aa, nx, ny, xmin, xmax, ymin, ymax, zmin, zmax, valuemin, valuemax, pltr2, &grid2 );
1810 } //%name plimagefr2 //%input a(nx,ny), xg(nx+1,ny+1), yg(nx+1,ny+1)
1811
1812 void plcolorbar( PLFLT *p_colorbar_width, PLFLT *p_colorbar_height,
1813 PLINT opt, PLINT position, PLFLT x, PLFLT y,
1814 PLFLT x_length, PLFLT y_length,
1815 PLINT bg_color, PLINT bb_color, PLINT bb_style,
1816 PLFLT low_cap_color, PLFLT high_cap_color,
1817 PLINT cont_color, PLFLT cont_width,
1818 PLINT n_labels, const PLINT *label_opts, const char * const *label,
1819 PLINT n_axes, const char * const * axis_opts,
1820 const PLFLT *ticks, const PLINT *sub_ticks,
1821 const PLINT *n_values, const PLFLT * const *values ) // %nowrap
1822
1823 void my_plcolorbar( PLFLT *p_colorbar_width, PLFLT *p_colorbar_height,
1824 PLINT opt, PLINT position, PLFLT x, PLFLT y,
1825 PLFLT x_length, PLFLT y_length,
1826 PLINT bg_color, PLINT bb_color, PLINT bb_style,
1827 PLFLT low_cap_color, PLFLT high_cap_color,
1828 PLINT cont_color, PLFLT cont_width,
1829 PLINT n_labels, const PLINT *label_opts, const char * const *label,
1830 PLINT nx, const char * const * axis_opts,
1831 const PLFLT *ticks, const PLINT *sub_ticks,
1832 const PLINT *n_values, const PLFLT *a )
1833 {
1834 PLINT ny, i;
1835 ny = -1;
1836 for ( i = 0; i < nx; i++ )
1837 if ( n_values[i] < ny )
1838 ny = n_values[i];
1839 f2c( a, aa, nx, ny );
1840 c_plcolorbar( p_colorbar_width, p_colorbar_height,
1841 opt, position, x, y,
1842 x_length, y_length,
1843 bg_color, bb_color, bb_style,
1844 low_cap_color, high_cap_color,
1845 cont_color, cont_width,
1846 n_labels, label_opts, label,
1847 nx, axis_opts,
1848 ticks, sub_ticks,
1849 n_values, aa );
1850 } //%name plcolorbar //%input a(nx,ny)
1851
1852 #ifdef __cplusplus
1853 }
1854 #endif
1855
1856 #endif // __PLPLOT_H__
1857