~ubuntu-branches/debian/jessie/eso-midas/jessie

« back to all changes in this revision

Viewing changes to prim/plot/libsrc/plgra.c

  • Committer: Package Import Robot
  • Author(s): Ole Streicher
  • Date: 2014-04-22 14:44:58 UTC
  • Revision ID: package-import@ubuntu.com-20140422144458-okiwi1assxkkiz39
Tags: upstream-13.09pl1.2+dfsg
ImportĀ upstreamĀ versionĀ 13.09pl1.2+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*===========================================================================
 
2
  Copyright (C) 1993-2009 European Southern Observatory (ESO)
 
3
 
 
4
  This program is free software; you can redistribute it and/or 
 
5
  modify it under the terms of the GNU General Public License as 
 
6
  published by the Free Software Foundation; either version 2 of 
 
7
  the License, or (at your option) any later version.
 
8
 
 
9
  This program is distributed in the hope that it will be useful,
 
10
  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
  GNU General Public License for more details.
 
13
 
 
14
  You should have received a copy of the GNU General Public 
 
15
  License along with this program; if not, write to the Free 
 
16
  Software Foundation, Inc., 675 Massachusetss Ave, Cambridge, 
 
17
  MA 02139, USA.
 
18
 
 
19
  Corresponding concerning ESO-MIDAS should be addressed as follows:
 
20
        Internet e-mail: midas@eso.org
 
21
        Postal address: European Southern Observatory
 
22
                        Data Management Division 
 
23
                        Karl-Schwarzschild-Strasse 2
 
24
                        D 85748 Garching bei Muenchen 
 
25
                        GERMANY
 
26
===========================================================================*/
 
27
 
 
28
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
29
.IDENTifer   module PLGRA
 
30
.AUTHOR      R.M. van Hees IPG-ESO Garching
 
31
.KEYWORDS    plot software, graphics, bulk data fame, gray scale plotting
 
32
.LANGUAGE    C
 
33
.PURPOSE     Grayscale plotting routine for two dimensional data
 
34
.COMMENTS    holds PLGRA, WEDGE and PLGRAI
 
35
.ENVIRONment MIDAS and AGL
 
36
             #include <agl.h>           Prototypes for AGL application programs
 
37
             #include <midas_def.h>     Prototypes for MIDAS interfaces
 
38
             #include <plot_def.h>      Symbols used by the PLT interfaces
 
39
 
 
40
.VERSION     1.1     23-Sep-1993   FORTRAN --> ANSI-C    RvH
 
41
 
 
42
090422          last modif
 
43
------------------------------------------------------------*/
 
44
/*
 
45
 * Define _POSIX_SOURCE to indicate
 
46
 * that this is a POSIX program
 
47
 */
 
48
#define  _POSIX_SOURCE 1
 
49
 
 
50
/*
 
51
 * definition of the used functions in this module
 
52
 */
 
53
#include <stdio.h>
 
54
#include <stdlib.h>
 
55
#include <string.h>
 
56
#include <math.h>
 
57
 
 
58
#include <midas_def.h>
 
59
 
 
60
/*
 
61
 * define some macros and constants
 
62
 */
 
63
#include <plot_def.h>
 
64
 
 
65
#ifndef RAND_MAX
 
66
#define RAND_MAX        32768.0
 
67
#endif
 
68
 
 
69
/*
 
70
 * The array "options" holds TRUE and FALSE values for the following options
 
71
 */
 
72
#define LINS    ( (*options == FALSE) ? TRUE : FALSE )      /*lineair scaling*/
 
73
#define LOGS    ( (*options == TRUE)  ? TRUE : FALSE )         /*log. scaling*/
 
74
#define CONT    ( (*(options+1) == FALSE) ? TRUE : FALSE ) /*cont. gray scale*/
 
75
#define STEP    ( (*(options+1) == TRUE)  ? TRUE : FALSE )    /*stepwise gray*/
 
76
#define FLIP    ( (*(options+2) == TRUE) ? TRUE : FALSE )       /*change sign*/
 
77
#define ABSV    ( (*(options+3) == TRUE) ? TRUE : FALSE )   /*take abs values*/
 
78
#define CUTP    ( (*(options+4) == TRUE) ? TRUE : FALSE ) /*only gray between
 
79
                                                                   cut values*/
 
80
/*++++++++++++++++++++++++++++++
 
81
.IDENTifer   DWLOG
 
82
.PURPOSE     return the "traditional" Dwingeloo/Westerbork log scaling
 
83
     input    double value
 
84
.RETURNS     Dwi/Wbrk log
 
85
.COMMENTS    static function
 
86
--------------------------------*/
 
87
#ifdef __STDC__
 
88
      static double DWLOG( double value )
 
89
#else
 
90
      static double DWLOG( value )
 
91
      double value;
 
92
#endif
 
93
{
 
94
value *= 0.549999 + 0.45 * value;
 
95
return log10( 30 * value + 1 )/ log10( 30.42 ) - 0.007;
 
96
}
 
97
 
 
98
/*++++++++++++++++++++++++++++++
 
99
.IDENTifer   HALFT
 
100
.PURPOSE     Produce halftone plot of a 2-D image
 
101
     input:    double vnom    normalized intensity: 0 <= vnom <= 1.0
 
102
               int    ipx     number of pixels in the X direction
 
103
               int    ipy     number of pixels in the Y direction
 
104
               double pixx    pixel size in world coordinates in X
 
105
               double pixy    pixel size in world coordinates in Y
 
106
               double xstr    position of stip in plotter coordinates
 
107
               double ystr    position of stip in plotter coordinates
 
108
               float  greynes grayness parameter: 0 <= greyness <= 1.0
 
109
 
 
110
.COMMENTS    static function
 
111
--------------------------------*/
 
112
#ifdef __STDC__
 
113
      static void HALFT( double vnom, int ipx, int ipy, double pixx, 
 
114
                         double pixy, double xstr, double ystr, float greynes )
 
115
#else
 
116
      static void HALFT( vnom, ipx, ipy, pixx, pixy, xstr, ystr, greynes )
 
117
      int    ipx, ipy; 
 
118
      float  greynes;
 
119
      double vnom, pixx, pixy, xstr, ystr;
 
120
#endif
 
121
{
 
122
float  xpos, ypos;
 
123
double rrand;
 
124
 
 
125
register int    ix, iy;
 
126
 
 
127
if ( (ipx+1) * pixx < 1.0 ) ipx +=1;
 
128
 
 
129
vnom *= greynes * RAND_MAX;
 
130
for ( ix = 0; ix < ipx; ix++ )
 
131
    { for ( iy = 0; iy < ipy; iy++ )
 
132
          { rrand = fmod( (double) rand(), RAND_MAX );
 
133
            
 
134
            if ( rrand < vnom )
 
135
               { xpos = (float) (xstr + ix * pixx);
 
136
                 ypos = (float) (ystr + iy * pixy);
 
137
                 AG_GPLM( &xpos, &ypos, 1, 0 );
 
138
               }
 
139
          }
 
140
    }
 
141
}
 
142
 
 
143
/*++++++++++++++++++++++++++++++++++++++++++++++++++
 
144
.IDENTifer   PLGRA
 
145
.PURPOSE     Gray scale plotting routine for two dimensional data
 
146
     input:   float  *p_img   pointer to the data of the frame
 
147
              float  *image   image size in pixel coordinates
 
148
              float  *area    image size in world coordinates
 
149
              double *step    distance between pixels in world units
 
150
              float  *glevl   level of the countours
 
151
              int    nlevl    number of countours
 
152
              int    *options holds the following options: 
 
153
                                 LIN - LOG  gray scaling
 
154
                                 STEP - CONTineously increasing gray scale
 
155
                                 POS - NEG  increasing or decreasing gray scale
 
156
                                 ABS        take the absolute values
 
157
                                 CUTS       only gray scaling between the cuts
 
158
              float  greynes  grayness parameter between 0.0 and 1.0,
 
159
                                 1.0 gives the maximum blackness
 
160
                                 0.0 means white
 
161
 
 
162
.COMMENTS    if image[0] > image[1] or image[2] > image[3] then
 
163
             the values are put in the right order
 
164
--------------------------------*/
 
165
#ifdef __STDC__
 
166
void PLGRA(float *p_img, float *image, float *area, double *step, float *glevl, int nlevl, int *options, float greynes)
 
167
#else
 
168
void PLGRA( p_img, image, area, step, glevl, nlevl, options, greynes )
 
169
int    nlevl, *options;
 
170
float  *p_img, *image, *area, *glevl, greynes;
 
171
double *step;
 
172
#endif
 
173
{
 
174
int    ipx, ipy, ipy1, ix, iy, nl, nx, ny, pixnx, pixny;
 
175
 
 
176
float  rres[2], clpl[4], wndl[4];
 
177
 
 
178
double delwx, delwy, delcx, delcy, diff, eps, pixx, pixy, val, vnom, 
 
179
       xnom, xstr, ystr, ynom;
 
180
 
 
181
/*
 
182
 * this functions only works if the number of levels is greater than zero
 
183
 */
 
184
if ( nlevl == 0 ) return;
 
185
 
 
186
/*
 
187
 * get viewport characteristics
 
188
 */
 
189
(void) AG_RGET( "clpl", clpl );
 
190
(void) AG_RGET( "wndl", wndl );
 
191
(void) AG_RGET( "reso", rres );
 
192
AG_SSET( "sydi=0.10" );
 
193
 
 
194
/*
 
195
 * get the start world coordinates and window characteristics
 
196
 */
 
197
nx = (int) fabs( image[1] - image[0] ) + 1;
 
198
ny = (int) fabs( image[3] - image[2] ) + 1;
 
199
 
 
200
if ( *step < 0 )
 
201
   xnom = MYMAX( area[0], area[1] );
 
202
else
 
203
   xnom = MYMIN( area[0], area[1] );
 
204
 
 
205
delwx = wndl[1] - wndl[0];                               /* window size in X */
 
206
delwy = wndl[3] - wndl[2];                               /* window size in Y */
 
207
delcx = fabs( clpl[1] - clpl[0] );                     /* clipping size in X */
 
208
delcy = fabs( clpl[3] - clpl[2] );                     /* clipping size in Y */
 
209
pixnx = NINT( delcx / rres[0] );                       /* number of X pixels */
 
210
pixny = NINT( delcy / rres[1] );                       /* number of Y pixels */
 
211
pixx  = delwx / pixnx;                          /* size of a X pixel in w.c. */
 
212
pixy  = delwy / pixny;                          /* size of a Y pixel in w.c. */
 
213
eps   = fabs( *glevl * 0.0001 );
 
214
 
 
215
/*
 
216
 * start the code
 
217
 */
 
218
ipx = (int) ceil( *step/pixx );
 
219
ipy = (int) ceil( *(step+1)/pixy );
 
220
 
 
221
/*
 
222
 * reverse order of contours and reverse sign
 
223
 */
 
224
if ( FLIP )
 
225
   { for ( nl = 0; nl < NINT( nlevl/2.0 ); nl++ )
 
226
         { register int   nn = nlevl - nl - 1;
 
227
           register float dummy = *(glevl+nl);
 
228
           *(glevl+nl) = - *(glevl+nn);
 
229
           *(glevl+nn) = - dummy;
 
230
         }
 
231
   }
 
232
/*
 
233
 * Begin value in Y of gray - tone
 
234
 * ynom = nominal plot position; ystr = actual starting plot position
 
235
 */
 
236
if ( *(step+1) < 0 )
 
237
   ynom = MYMAX( area[2], area[3] ) - 1.5 * *(step+1);
 
238
else
 
239
   ynom = MYMIN( area[2], area[3] ) - 1.5 * *(step+1);
 
240
ystr = ynom;
 
241
 
 
242
for ( iy = 0; iy < ny - 1; iy++ )
 
243
    { ystr += ipy * pixy;
 
244
      ynom += *(step+1);
 
245
      diff = ystr - ynom;
 
246
      if ( diff < 0 ) ystr += pixy;               /* Does it start too low?  */
 
247
         
 
248
      if ( diff > pixy ) ystr -= pixy;            /* Does it start too high? */
 
249
/*
 
250
 * how many lines within grid-interval 
 
251
 */
 
252
      ipy1 = (int) ceil( (ynom - ystr + *(step+1))/pixy );
 
253
 
 
254
      for ( ix = 0; ix < nx; ix++ )
 
255
          { xstr = xnom + (ix - 0.5) * *step;         /* start position in X */
 
256
 
 
257
            val = *(p_img+ix);
 
258
            if ( fabs( val ) < eps ) val = 0.0;
 
259
 
 
260
            if ( ABSV ) val = fabs( val );
 
261
            if ( FLIP ) val = -val;
 
262
 
 
263
            if ( val > (double) *glevl )
 
264
               { if ( val >= (double) *(glevl+nlevl - 1) )
 
265
                    { val = *(glevl+nlevl-1);
 
266
                      if ( CUTP ) val += eps;
 
267
                    }
 
268
               }
 
269
 
 
270
            vnom = 0.0;
 
271
            if ( STEP )
 
272
               { if ( nlevl > 1 )
 
273
                    { for ( nl = 0; nl < nlevl-1; nl++ )
 
274
                          { if ( val >= (double) *(glevl+nl) 
 
275
                                 && val < (double) *(glevl+nl+1))
 
276
                               { vnom = (double) (nl+1) / nlevl;
 
277
                                 if ( LOGS )         /* "log" scale Dwi/Wbrk.*/
 
278
                                    vnom = DWLOG( vnom );
 
279
                               }
 
280
                          }
 
281
                    }
 
282
                 if ( val == (double) *(glevl+nlevl-1) )
 
283
                    { vnom = 1.0;
 
284
                       if ( LOGS )                   /* "log" scale Dwi/Wbrk.*/
 
285
                          vnom = DWLOG( vnom );
 
286
                    }
 
287
               }
 
288
            else    
 
289
               { if ( val >= (double) *glevl && val <= (double) *(glevl+1) )
 
290
                    { vnom = (val - *glevl)/fabs( *(glevl+1) - *glevl );
 
291
                      if ( LOGS )                    /* "log" scale Dwi/Wbrk.*/
 
292
                         vnom = DWLOG( vnom );
 
293
                    }
 
294
               }
 
295
            if ( val >= (double) *glevl && val <= (double) *(glevl+nlevl-1) )
 
296
               HALFT( vnom, ipx, ipy1, pixx, pixy, xstr, ystr, greynes);
 
297
          }
 
298
/*
 
299
 * set the pointer to the begin of the new line to be drawn
 
300
 */
 
301
      p_img += nx;
 
302
 
 
303
    }
 
304
/*
 
305
 * reverse order of contours and reverse sign to get the original values
 
306
 */
 
307
if ( FLIP )
 
308
   { for ( nl = 0; nl < NINT( nlevl/2.0 ); nl++ )
 
309
         { register int   nn = nlevl - nl - 1;
 
310
           register float dummy = *(glevl+nl);
 
311
           *(glevl+nl) = - *(glevl+nn);
 
312
           *(glevl+nn) = - dummy;
 
313
         }
 
314
   }
 
315
 
 
316
return;
 
317
}
 
318
 
 
319
/*++++++++++++++++++++++++++++++++++++++++++++++++++
 
320
.IDENTifer   WEDGE
 
321
.PURPOSE     plots a gray scale wedge
 
322
     input:
 
323
              float  *glevl   level of the countours
 
324
              int    nlevl    number of countours
 
325
              int    *option  holds the following options: 
 
326
                                 LIN  - LOG gray scaling
 
327
                                 STEP - CONTineously increasing gray scale
 
328
                                 POS  - NEG increasing or decreasing gray scale
 
329
                                 ABS        take the absolute values
 
330
                                 CUTS       only gray scaling between the cuts
 
331
              float  greynes  grayness parameter between 0.0 and 1.0,
 
332
                                 1.0 gives the maximum blackness
 
333
                                 0.0 means white
 
334
.COMMENTS    
 
335
----------------------------------------------------*/
 
336
#ifdef __STDC__
 
337
void WEDGE(double *step, float *glevl, int nlevl, int *options, float greynes)
 
338
#else
 
339
void WEDGE( step, glevl, nlevl, options, greynes )
 
340
int    nlevl, *options;
 
341
float  *glevl, greynes;
 
342
double *step;
 
343
#endif
 
344
{
 
345
int    il, ix, iy, ngray, nx, ny;
 
346
float  eps, clpl[4], frame[4], image[4], xl[2], yl[2], *wdata;
 
347
 
 
348
(void) AG_RGET( "clpl", clpl );
 
349
 
 
350
/*
 
351
 * define the area for the wedge
 
352
 */
 
353
clpl[2] = clpl[3] - (clpl[3] - clpl[2]) / 20;
 
354
AG_VN2U( clpl[0], clpl[2], frame  , frame+2 );
 
355
AG_VN2U( clpl[1], clpl[3], frame+1, frame+3 );
 
356
eps = 0.00001;
 
357
 
 
358
/*
 
359
 * draw a line between the wedge and the gray scale plot
 
360
 */
 
361
xl[0] = frame[0];
 
362
xl[1] = frame[1];
 
363
yl[0] = frame[2];
 
364
yl[1] = frame[2];
 
365
AG_GPLL( xl, yl, 2 );
 
366
 
 
367
nx = (int) fabs( (frame[1] - frame[0]) / *step ) + 2;
 
368
ny = (int) fabs( (frame[3] - frame[2]) / *(step+1) ) + 2;
 
369
wdata = (float *) osmmget( nx * ny * sizeof( float ));
 
370
 
 
371
if ( STEP )
 
372
   { ngray = NINT( (float) nx / nlevl );  /* # gr. pnts. with same gray tone */
 
373
     for ( iy = 0; iy < ny; iy++ )
 
374
         { for ( il = 0; il < nlevl-1; il++ )
 
375
               { eps = 0.00001 * (double) glevl[il];
 
376
                 for ( ix = 0; ix < ngray; ix++ )
 
377
                     *(wdata + (il-1) * ngray + ix) = *(glevl+il) + eps;
 
378
               }
 
379
           for ( ix = (nlevl-1) * ngray; ix < nx; ix++ )
 
380
               *(wdata + ix) = *(glevl+il) + eps;
 
381
           wdata += nx;
 
382
         }
 
383
     wdata -= nx * ny;
 
384
   }
 
385
else                                                /* continuous gray scale */
 
386
   { for ( iy = 0; iy < ny; iy++ )
 
387
         { for ( ix = 0; ix < nx; ix++ )
 
388
               { *(wdata + ix) = *glevl + ix * ( *(glevl+1) - *glevl) / nx;
 
389
               } 
 
390
           wdata += nx;
 
391
         }
 
392
     wdata -= nx * ny;
 
393
   }
 
394
/*
 
395
 * size of the wedge in pixel coordinates
 
396
 */
 
397
image[0] = image[2] = 0;
 
398
image[1] = nx;
 
399
image[2] = ny;
 
400
 
 
401
/*
 
402
 * size of the wedge in world coordinates
 
403
 */
 
404
frame[0] += 1.5 * *step;
 
405
frame[1] += 1.5 * *step;
 
406
frame[2] += 0.5 * *(step+1);
 
407
frame[3] += 0.5 * *(step+1);
 
408
PLGRA( wdata, image, frame, step, glevl, nlevl, options, greynes );
 
409
 
 
410
return;
 
411
}
 
412
 
 
413
/*++++++++++++++++++++++++++++++++++++++++++++++++++
 
414
.IDENTifer   PLGRAI
 
415
.PURPOSE     produce plot information for a two-dimensional grayscaler plot
 
416
     input:   int   plmode    plot mode, see PMODE in PLISTAT
 
417
              char  *name     data frame name
 
418
              char  *ident    ascii identifier of image
 
419
              int   nlevl     number of contour levels
 
420
              float *glevl    values of the contours
 
421
.COMMENTS    none
 
422
----------------------------------------------------*/
 
423
void PLGRAI( plmode, name, ident, nlevl, glevl, options )
 
424
int   plmode, nlevl, *options;
 
425
char  *name, *ident;
 
426
float *glevl; 
 
427
 
 
428
{
 
429
int    actvals, ii;
 
430
float  one, ssize, tsize, x1, x2, y1, y2, xt, yt, yh, xstr;
 
431
float  mnmx[2], scale[2], xl[3], yl[3], clpl[4], image[4], wndl[4];
 
432
char   buff[81];
 
433
 
 
434
/*
 
435
 * only plot mode is 2
 
436
 */
 
437
if ( plmode != 2 ) return;
 
438
 
 
439
/*
 
440
 * get the symbol and character dimensions, from the MIDAS keywords
 
441
 */
 
442
PCKRDR( "SSIZE", 1, &actvals, &ssize );
 
443
PCKRDR( "TSIZE", 1, &actvals, &tsize );
 
444
 
 
445
/*
 
446
 * if the symbol size or the text size is not equal to 1, set it to 1
 
447
 * and call PCTSET to get the proper sizes for the MIDAS layout
 
448
 */
 
449
if ( ssize != 1.0 || tsize != 1.0 )
 
450
   { one = 1.0;
 
451
     PCKWRR( "SSIZE", 1, &one );
 
452
     PCKWRR( "TSIZE", 1, &one );
 
453
   }
 
454
PCTSET();
 
455
 
 
456
AG_SSET( "norm");
 
457
AG_SSET( "linx");
 
458
AG_SSET( "liny");
 
459
(void) AG_RGET( "clpl", clpl );
 
460
(void) AG_RGET( "wndl", wndl );
 
461
x1 = clpl[1] + 0.01;
 
462
x2 = 1.0;
 
463
y1 = 0.0;
 
464
y2 = clpl[3];
 
465
AG_CDEF( x1, x2, y1, y2);
 
466
AG_WDEF( 0.0, 1.0, 0.0, 1.0 );
 
467
 
 
468
/*
 
469
 * plot MIDAS logo
 
470
 */
 
471
PLLOGI( &xt, &yt );
 
472
 
 
473
/* 
 
474
 * set character height
 
475
 */
 
476
AG_SSET( "sydi=0.75;chdi=0.75,0.75" );
 
477
AG_TGET( "M", xl, yl );
 
478
yh = 2.0 * yl[1];
 
479
 
 
480
/*
 
481
 * plot user name
 
482
 */
 
483
PLUSER( buff );
 
484
AG_GTXT( xt, yt, buff, 1 );
 
485
 
 
486
/*
 
487
 * name of frame
 
488
 */
 
489
yt -= 2*yh;
 
490
if ( strlen( name ) > (size_t) 12 )
 
491
   { AG_GTXT( xt, yt, "Frame:", 1 );
 
492
     yt -= yh;
 
493
     AG_GTXT( xt, yt, name, 1 ); 
 
494
   }
 
495
else
 
496
   { (void) sprintf( buff, "Frame: %s", name );
 
497
     AG_GTXT( xt, yt, buff, 1 );
 
498
   }
 
499
/*
 
500
 * identification
 
501
 */
 
502
if ( strlen( ident ) > (size_t) 0 )
 
503
   { yt -= 2*yh;
 
504
     AG_GTXT( xt, yt, "Identification:", 1 );
 
505
     yt -= yh;
 
506
     AG_GTXT( xt, yt, ident, 1 );
 
507
   }
 
508
/*
 
509
 * area
 
510
 */
 
511
PCKRDR( "PIXEL", 4, &actvals, image );
 
512
yt -= 2*yh;
 
513
AG_GTXT( xt, yt, "Area:", 1 );
 
514
yt -= yh;
 
515
(void) sprintf( buff, "X: %.0f to %.0f", image[0], image[1] );
 
516
AG_GTXT( xt, yt, buff, 1 );
 
517
yt -= yh;
 
518
(void) sprintf( buff, "Y: %.0f to %.0f", image[2], image[3] );
 
519
AG_GTXT( xt, yt, buff, 1 );
 
520
/*
 
521
 * scales
 
522
 */
 
523
PCKRDR( "SCALES", 2, &actvals, scale );
 
524
yt -= 2*yh;
 
525
AG_GTXT( xt, yt, "Scales:", 1 );
 
526
yt -= yh;
 
527
(void) sprintf( buff, "X: %-.6g", scale[0] );
 
528
AG_GTXT( xt, yt, buff, 1 );
 
529
yt -= yh;
 
530
(void) sprintf( buff, "Y: %-.6g", scale[1] );
 
531
AG_GTXT( xt, yt, buff, 1 );
 
532
/*
 
533
 * minimum and maximum
 
534
 */
 
535
PCKRDR( "ZWNDL", 2, &actvals, mnmx );
 
536
yt -= 2*yh;
 
537
(void) sprintf( buff, "Min: %-.3g ", mnmx[0] );
 
538
AG_GTXT( xt, yt, buff, 1 );
 
539
yt -= yh;
 
540
(void) sprintf( buff, "Max: %-.3g ", mnmx[1] );
 
541
AG_GTXT( xt, yt, buff, 1 );
 
542
 
 
543
/*
 
544
 * contour levels
 
545
 */
 
546
yt -= 2*yh;
 
547
if ( STEP )
 
548
   AG_GTXT( xt, yt, "Gray scale levels:", 1 );
 
549
else
 
550
   { nlevl = 2;
 
551
     AG_GTXT( xt, yt, "Gray scale range:", 1 );
 
552
   }
 
553
 
 
554
for ( ii = 0; ii < nlevl; ii++ )
 
555
    { xstr = xt + 11 * xl[1];
 
556
      if ( ii % 2 == 0 )
 
557
         { xstr = xt;
 
558
           yt  -= yh;
 
559
         }
 
560
      (void) sprintf( buff, "%8.5g", glevl[ii] );
 
561
      AG_GTXT( xstr, yt, buff, 1 );
 
562
    }
 
563
 
 
564
yt -= 2.*yh;
 
565
PLDATI( &xt, &yt );
 
566
 
 
567
/*
 
568
 * back to standard sizes
 
569
 */
 
570
AG_CDEF( clpl[0], clpl[1], clpl[2], clpl[3] );
 
571
AG_WDEF( wndl[0], wndl[1], wndl[2], wndl[3] );
 
572
 
 
573
/*
 
574
 * reset if necessary the symbol and text size
 
575
 */
 
576
if ( ssize != 1.0 || tsize != 1.0 )
 
577
   { PCKWRR( "SSIZE", 1, &ssize );
 
578
     PCKWRR( "TSIZE", 1, &tsize );
 
579
     PCTSET();
 
580
   }
 
581
return;
 
582
}