92 c_plenvi( xmin, xmax, ymin, ymax, just, axis, 1 );
106 c_plenvi( xmin, xmax, ymin, ymax, just, axis, 0 );
114 PLFLT lb, rb, tb, bb, dx, dy;
115 PLFLT xsize, ysize, size, xscale, yscale, scale;
116 PLFLT spxmin, spxmax, spymin, spymax;
117 PLFLT vpxmin, vpxmax, vpymin, vpymax;
119 if ( plsc->level < 1 )
121 plabort(
"plenv: Please call plinit first" );
126 plabort(
"plenv: Invalid xmin and xmax arguments" );
131 plabort(
"plenv: Invalid ymin and ymax arguments" );
134 if ( just < -1 || just > 2 )
136 plabort(
"plenv: Invalid just option" );
140 if ( plsc->nsubx * plsc->nsuby == 1 )
150 else if ( just == 1 )
152 lb = 8.0 * plsc->chrht;
153 rb = 5.0 * plsc->chrht;
154 tb = 5.0 * plsc->chrht;
155 bb = 5.0 * plsc->chrht;
156 dx =
ABS( xmax - xmin );
157 dy =
ABS( ymax - ymin );
158 plgspa( &spxmin, &spxmax, &spymin, &spymax );
159 xsize = spxmax - spxmin;
160 ysize = spymax - spymin;
161 xscale = dx / ( xsize - lb - rb );
162 yscale = dy / ( ysize - tb - bb );
163 scale =
MAX( xscale, yscale );
164 vpxmin =
MAX( lb, 0.5 * ( xsize - dx / scale ) );
165 vpxmax = vpxmin + ( dx / scale );
166 vpymin =
MAX( bb, 0.5 * ( ysize - dy / scale ) );
167 vpymax = vpymin + ( dy / scale );
168 plsvpa( vpxmin, vpxmax, vpymin, vpymax );
170 else if ( just == 2 )
172 lb = 8.0 * plsc->chrht;
173 rb = 5.0 * plsc->chrht;
174 tb = 5.0 * plsc->chrht;
175 bb = 5.0 * plsc->chrht;
176 plgspa( &spxmin, &spxmax, &spymin, &spymax );
177 xsize = spxmax - spxmin;
178 ysize = spymax - spymin;
179 size =
MIN( xsize - lb - rb, ysize - tb - bb );
180 dx = ( xsize - size - lb - rb ) / 2;
182 vpxmax = vpxmin + size;
183 dy = ( ysize - size - bb - tb ) / 2;
185 vpymax = vpymin + size;
186 plsvpa( vpxmin, vpxmax, vpymin, vpymax );
189 plwind( xmin, xmax, ymin, ymax );
295 plwarn(
"plenv: Invalid axis argument" );
309 PLFLT xmin, xmax, ymin, ymax;
310 PLFLT lb, rb, tb, bb;
312 if ( plsc->level < 1 )
314 plabort(
"plvsta: Please call plinit first" );
322 lb = 8.0 * plsc->chrht;
323 rb = 5.0 * plsc->chrht;
324 tb = 5.0 * plsc->chrht;
325 bb = 5.0 * plsc->chrht;
332 plvpor( xmin, xmax, ymin, ymax );
344 if ( plsc->level < 1 )
346 plabort(
"plvpor: Please call plinit first" );
349 if ( ( xmin >= xmax ) || ( ymin >= ymax ) )
351 plabort(
"plvpor: Invalid limits" );
354 if ( ( plsc->cursub <= 0 ) || ( plsc->cursub > ( plsc->nsubx * plsc->nsuby ) ) )
356 plabort(
"plvpor: Please call pladv or plenv to go to a subpage" );
360 plsc->vpdxmi = plsc->spdxmi + ( plsc->spdxma - plsc->spdxmi ) * xmin;
361 plsc->vpdxma = plsc->spdxmi + ( plsc->spdxma - plsc->spdxmi ) * xmax;
362 plsc->vpdymi = plsc->spdymi + ( plsc->spdyma - plsc->spdymi ) * ymin;
363 plsc->vpdyma = plsc->spdymi + ( plsc->spdyma - plsc->spdymi ) * ymax;
365 plsc->vppxmi =
plP_dcpcx( plsc->vpdxmi );
366 plsc->vppxma =
plP_dcpcx( plsc->vpdxma );
367 plsc->vppymi =
plP_dcpcy( plsc->vpdymi );
368 plsc->vppyma =
plP_dcpcy( plsc->vpdyma );
370 plP_sclp(
MAX( plsc->vppxmi, plsc->phyxmi ),
MIN( plsc->vppxma, plsc->phyxma ),
371 MAX( plsc->vppymi, plsc->phyymi ),
MIN( plsc->vppyma, plsc->phyyma ) );
386 PLFLT spxmin, spxmax, spymin, spymax;
387 PLFLT vpxmin, vpxmax, vpymin, vpymax;
388 PLFLT xsize, ysize, nxsize, nysize;
389 PLFLT xoffset, yoffset;
391 if ( plsc->level < 1 )
393 plabort(
"plvpas: Please call plinit first" );
396 if ( ( xmin >= xmax ) || ( ymin >= ymax ) )
398 plabort(
"plvpas: Invalid limits" );
408 plgspa( &spxmin, &spxmax, &spymin, &spymax );
410 xsize = spxmax - spxmin;
411 ysize = spymax - spymin;
413 xoffset = xsize * xmin;
414 yoffset = ysize * ymin;
416 spxmax = spxmin + xsize * xmax;
417 spxmin = spxmin + xsize * xmin;
418 spymax = spymin + ysize * ymax;
419 spymin = spymin + ysize * ymin;
422 xsize = spxmax - spxmin;
423 ysize = spymax - spymin;
425 if ( aspect * xsize > ysize )
427 nxsize = ysize / aspect;
433 nysize = xsize * aspect;
438 vpxmin = 0.5 * ( xsize - nxsize ) + xoffset;
439 vpxmax = vpxmin + nxsize;
440 vpymin = 0.5 * ( ysize - nysize ) + yoffset;
441 vpymax = vpymin + nysize;
443 plsvpa( vpxmin, vpxmax, vpymin, vpymax );
456 PLFLT spxmin, spxmax, spymin, spymax;
457 PLFLT vpxmin, vpxmax, vpymin, vpymax;
458 PLFLT xsize, ysize, nxsize, nysize;
459 PLFLT lb, rb, tb, bb;
461 if ( plsc->level < 1 )
463 plabort(
"plvasp: Please call plinit first" );
467 lb = 8.0 * plsc->chrht;
468 rb = 5.0 * plsc->chrht;
469 tb = 5.0 * plsc->chrht;
470 bb = 5.0 * plsc->chrht;
472 plgspa( &spxmin, &spxmax, &spymin, &spymax );
473 xsize = spxmax - spxmin;
474 ysize = spymax - spymin;
477 if ( aspect * xsize > ysize )
479 nxsize = ysize / aspect;
485 nysize = xsize * aspect;
490 vpxmin = .5 * ( xsize - nxsize ) + lb;
491 vpxmax = vpxmin + nxsize;
492 vpymin = .5 * ( ysize - nysize ) + bb;
493 vpymax = vpymin + nysize;
495 plsvpa( vpxmin, vpxmax, vpymin, vpymax );
510 if ( plsc->level < 1 )
512 plabort(
"plsvpa: Please call plinit first" );
515 if ( ( xmin >= xmax ) || ( ymin >= ymax ) )
517 plabort(
"plsvpa: Invalid limits" );
520 if ( ( plsc->cursub <= 0 ) || ( plsc->cursub > ( plsc->nsubx * plsc->nsuby ) ) )
522 plabort(
"plsvpa: Please call pladv or plenv to go to a subpage" );
534 plsc->vppxmi =
plP_dcpcx( plsc->vpdxmi );
535 plsc->vppxma =
plP_dcpcx( plsc->vpdxma );
536 plsc->vppymi =
plP_dcpcy( plsc->vpdymi );
537 plsc->vppyma =
plP_dcpcy( plsc->vpdyma );
void c_plsvpa(PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax)
void plabort(PLCHAR_VECTOR errormsg)
void c_plvasp(PLFLT aspect)
void c_plenv0(PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax, PLINT just, PLINT axis)
void c_plvpas(PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax, PLFLT aspect)
void c_plvpor(PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax)
void plwarn(PLCHAR_VECTOR errormsg)
static void c_plenvi(PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax, PLINT just, PLINT axis, PLINT old)
void plP_sclp(PLINT ixmin, PLINT ixmax, PLINT iymin, PLINT iymax)
void c_plenv(PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax, PLINT just, PLINT axis)