~ubuntu-branches/ubuntu/intrepid/plplot/intrepid

« back to all changes in this revision

Viewing changes to doc/docbook/src/contour-plots.html

  • Committer: Bazaar Package Importer
  • Author(s): Rafael Laboissiere
  • Date: 2006-11-04 10:19:34 UTC
  • mfrom: (2.1.8 edgy)
  • Revision ID: james.westby@ubuntu.com-20061104101934-mlirvdg4gpwi6i5q
Tags: 5.6.1-10
* Orphaning the package
* debian/control: Changed the maintainer to the Debian QA Group

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 
1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
2
2
<HTML
3
3
><HEAD
4
4
><TITLE
5
5
>Contour and Shade Plots</TITLE
6
6
><META
7
7
NAME="GENERATOR"
8
 
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
 
8
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
9
9
REL="HOME"
10
10
TITLE="The PLplot Plotting Library"
11
11
HREF="index.html"><LINK
86
86
      use non-continuous line styles.  Further, one may specify arbitrary
87
87
      coordinate mappings from array indices to world coordinates, such as
88
88
      for contours in a polar coordinate system.  In this case it is best
89
 
      to draw the distinction between a C and Fortran language caller, so
90
 
      these are handled in turn.
 
89
      to draw the distinction between the C,  Fortran 95, and Fortran 77
 
90
      interfaces so these are handled in turn.
91
91
    </P
92
92
><DIV
93
93
CLASS="sect2"
113
113
><P
114
114
></P
115
115
><A
116
 
NAME="AEN1711"
 
116
NAME="AEN1911"
117
117
></A
118
118
><TABLE
119
119
CLASS="funcprototype"
132
132
>
133
133
      </P
134
134
><P
135
 
>       where <VAR
 
135
>       where <TT
136
136
CLASS="literal"
137
 
>z</VAR
 
137
>z</TT
138
138
> is the two-dimensional array of size
139
 
        <VAR
140
 
CLASS="literal"
141
 
>nx</VAR
142
 
> by <VAR
143
 
CLASS="literal"
144
 
>ny</VAR
 
139
        <TT
 
140
CLASS="literal"
 
141
>nx</TT
 
142
> by <TT
 
143
CLASS="literal"
 
144
>ny</TT
145
145
> containing samples
146
 
        of the function to be contoured.  (<VAR
 
146
        of the function to be contoured.  (<TT
147
147
CLASS="literal"
148
 
>z</VAR
 
148
>z</TT
149
149
> is a
150
150
        vectored two-dimensional array as described in the previous
151
151
        section.  It is <SPAN
155
155
>not</I
156
156
></SPAN
157
157
> a fixed-size
158
 
        two-dimensional array.) The parameters <VAR
 
158
        two-dimensional array.) The parameters <TT
159
159
CLASS="literal"
160
 
>kx</VAR
 
160
>kx</TT
161
161
>,
162
 
        <VAR
163
 
CLASS="literal"
164
 
>lx</VAR
165
 
>, <VAR
166
 
CLASS="literal"
167
 
>ky</VAR
 
162
        <TT
 
163
CLASS="literal"
 
164
>lx</TT
 
165
>, <TT
 
166
CLASS="literal"
 
167
>ky</TT
168
168
> and
169
 
        <VAR
170
 
CLASS="literal"
171
 
>ly</VAR
172
 
> specify the portion of <VAR
173
 
CLASS="literal"
174
 
>z</VAR
 
169
        <TT
 
170
CLASS="literal"
 
171
>ly</TT
 
172
> specify the portion of <TT
 
173
CLASS="literal"
 
174
>z</TT
175
175
>
176
 
        that is to be considered.  The array <VAR
 
176
        that is to be considered.  The array <TT
177
177
CLASS="literal"
178
 
>clevel</VAR
 
178
>clevel</TT
179
179
> of
180
 
        length <VAR
 
180
        length <TT
181
181
CLASS="literal"
182
 
>nlevel</VAR
 
182
>nlevel</TT
183
183
> is a list of the desired contour
184
184
        levels.
185
185
      </P
186
186
><P
187
187
>       The path of each contour is initially computed in terms of the
188
 
        values of the array indices which range from <VAR
 
188
        values of the array indices which range from <TT
189
189
CLASS="literal"
190
 
>0</VAR
 
190
>0</TT
191
191
>
192
 
        to <VAR
 
192
        to <TT
193
193
CLASS="literal"
194
 
>nx-1</VAR
 
194
>nx-1</TT
195
195
> in the first index and from
196
 
        <VAR
197
 
CLASS="literal"
198
 
>0</VAR
199
 
> to <VAR
200
 
CLASS="literal"
201
 
>ny-1</VAR
 
196
        <TT
 
197
CLASS="literal"
 
198
>0</TT
 
199
> to <TT
 
200
CLASS="literal"
 
201
>ny-1</TT
202
202
> in the second
203
203
        index.  Before these can be drawn in the current window (see <A
204
204
HREF="viewport_window.html#windows"
207
207
></A
208
208
>), it is necessary to convert from these array
209
209
        indices into world coordinates.  This is done by passing a pointer
210
 
        <VAR
 
210
        <TT
211
211
CLASS="literal"
212
 
>pltr</VAR
 
212
>pltr</TT
213
213
> to a user-defined transformation function 
214
214
        to <A
215
215
HREF="plcont.html"
268
268
>examples/c/x16c.c</TT
269
269
>.  These same three examples
270
270
        also demonstrate a user-defined transformation function 
271
 
        <VAR
 
271
        <TT
272
272
CLASS="literal"
273
 
>mypltr</VAR
 
273
>mypltr</TT
274
274
> which is capable of 
275
275
        arbitrary translation, rotation, and/or shear. By defining other
276
276
        transformation subroutines, it is possible to draw contours wrapped
286
286
>Shade Plots from C</A
287
287
></H2
288
288
><P
289
 
>        NEEDS DOCUMENTATION
290
 
      </P
291
 
></DIV
292
 
><DIV
293
 
CLASS="sect2"
294
 
><H2
295
 
CLASS="sect2"
296
 
><A
297
 
NAME="contour-plots-fortran"
298
 
>Contour Plots from Fortran</A
 
289
>        NEEDS DOCUMENTATION.  Follow the plshade and plshades usage in
 
290
        <TT
 
291
CLASS="filename"
 
292
>examples/c/x??c.c</TT
 
293
>.
 
294
      </P
 
295
></DIV
 
296
><DIV
 
297
CLASS="sect2"
 
298
><H2
 
299
CLASS="sect2"
 
300
><A
 
301
NAME="contour-plots-f95"
 
302
>Contour Plots from the Fortran 95 interface</A
 
303
></H2
 
304
><P
 
305
>        NEEDS DOCUMENTATION.  Follow the plcont usage (with a variety
 
306
        of overloaded forms available with different arguments) in 
 
307
        <TT
 
308
CLASS="filename"
 
309
>examples/f95/x??f.f90</TT
 
310
>.
 
311
      </P
 
312
></DIV
 
313
><DIV
 
314
CLASS="sect2"
 
315
><H2
 
316
CLASS="sect2"
 
317
><A
 
318
NAME="shade-plots-f95"
 
319
>Shade Plots from the Fortran 95 interface</A
 
320
></H2
 
321
><P
 
322
>        NEEDS DOCUMENTATION.  Follow the plshade and plshades usage 
 
323
        (with a variety
 
324
        of overloaded forms available with different arguments) in
 
325
        <TT
 
326
CLASS="filename"
 
327
>examples/f95/x??f.f90</TT
 
328
>.
 
329
      </P
 
330
></DIV
 
331
><DIV
 
332
CLASS="sect2"
 
333
><H2
 
334
CLASS="sect2"
 
335
><A
 
336
NAME="contour-plots-f77"
 
337
>Contour Plots from the Fortran 77 interface</A
299
338
></H2
300
339
><P
301
340
>       The routines mentioned above are not recommended for use directly
302
 
        from Fortran due to the need to pass a function pointer.  That is,
 
341
        from Fortran 77 due to the need to pass a function pointer.  That is,
303
342
        the transformation function is written in C and can not generally
304
343
        be changed by the user.  The call for routine <A
305
 
HREF="plcontfortran.html"
 
344
HREF="plcontfortran77.html"
306
345
><CODE
307
346
CLASS="function"
308
 
>plcontfortran</CODE
 
347
>plcontfortran77</CODE
309
348
></A
310
349
> from
311
 
        Fortran is then:
 
350
        Fortran 77 is then:
312
351
      </P
313
352
><P
314
353
>       <DIV
316
355
><P
317
356
></P
318
357
><A
319
 
NAME="AEN1782"
 
358
NAME="AEN1991"
320
359
></A
321
360
><TABLE
322
361
CLASS="funcprototype"
335
374
>
336
375
      </P
337
376
><P
338
 
>When called from Fortran, this routine has the same effect as when invoked
 
377
>When called from Fortran 77, this routine has the same effect as when invoked
339
378
from C.  The interpretation of all parameters (see <A
340
379
HREF="plcont.html"
341
380
><CODE
346
385
same except there is no transformation function supplied as the last
347
386
parameter.  Instead, a 6-element array specifying coefficients to use in the
348
387
transformation is supplied via the named common block
349
 
<VAR
 
388
<TT
350
389
CLASS="literal"
351
 
>plplot</VAR
352
 
> (see code). Since this approach is somewhat
 
390
>plplot</TT
 
391
> (see code).
 
392
Since this approach is somewhat
353
393
inflexible, the user is recommended to call either of <A
354
 
HREF="api-fortran.html#plcon0"
 
394
HREF="api-fortran-77.html#plcon0"
355
395
><CODE
356
396
CLASS="function"
357
397
>plcon0</CODE
369
409
CLASS="function"
370
410
>plcon2</CODE
371
411
></A
372
 
> instead.
 
412
> instead for Fortran 77.
373
413
      </P
374
414
><P
375
 
>       The three routines recommended for use from Fortran are <A
376
 
HREF="api-fortran.html#plcon0"
 
415
>       The three routines recommended for use from Fortran 77 are <A
 
416
HREF="api-fortran-77.html#plcon0"
377
417
><CODE
378
418
CLASS="function"
379
419
>plcon0</CODE
394
434
>.  These routines are similar to existing
395
435
        commercial plot package contour plotters in that they offer
396
436
        successively higher complexity, with <A
397
 
HREF="api-fortran.html#plcon0"
 
437
HREF="api-fortran-77.html#plcon0"
398
438
><CODE
399
439
CLASS="function"
400
440
>plcon0</CODE
422
462
><P
423
463
></P
424
464
><A
425
 
NAME="AEN1828"
 
465
NAME="AEN2037"
426
466
></A
427
467
><TABLE
428
468
CLASS="funcprototype"
445
485
><P
446
486
></P
447
487
><A
448
 
NAME="AEN1850"
 
488
NAME="AEN2059"
449
489
></A
450
490
><TABLE
451
491
CLASS="funcprototype"
468
508
><P
469
509
></P
470
510
><A
471
 
NAME="AEN1876"
 
511
NAME="AEN2085"
472
512
></A
473
513
><TABLE
474
514
CLASS="funcprototype"
488
528
      </P
489
529
><P
490
530
>       The <A
491
 
HREF="api-fortran.html#plcon0"
 
531
HREF="api-fortran-77.html#plcon0"
492
532
><CODE
493
533
CLASS="function"
494
534
>plcon0</CODE
548
588
>
549
589
      </P
550
590
><P
551
 
>       assuming the user had already set up arrays <VAR
 
591
>       assuming the user had already set up arrays <TT
552
592
CLASS="literal"
553
 
>r</VAR
 
593
>r</TT
554
594
>
555
 
        and <VAR
 
595
        and <TT
556
596
CLASS="literal"
557
 
>theta</VAR
 
597
>theta</TT
558
598
> to specify the (r, &#952;) values at
559
599
        the gridpoints in his system.  For this example, it is recommended
560
600
        that the user add an additional cell in theta such that
561
 
        <VAR
 
601
        <TT
562
602
CLASS="literal"
563
 
>xg(i, NY+1) = xg(i, 1)</VAR
564
 
> and <VAR
 
603
>xg(i, NY+1) = xg(i, 1)</TT
 
604
> and <TT
565
605
CLASS="literal"
566
606
>yg(i, NY+1)
567
 
        = yg(i, 1)</VAR
 
607
        = yg(i, 1)</TT
568
608
> so that the contours show the proper periodic
569
609
        behavior in &#952; (see also example program 9).
570
610
      </P
571
611
><P
572
612
>       The transformation function not only specifies the transformation
573
613
        at grid points, but also at intermediate locations, via linear
574
 
        interpolation.  For example, in the <VAR
 
614
        interpolation.  For example, in the <TT
575
615
CLASS="literal"
576
 
>pltr1</VAR
 
616
>pltr1</TT
577
617
>
578
618
        transformation function used by <A
579
619
HREF="plcon1.html"
582
622
>plcon1</CODE
583
623
></A
584
624
>, the 1-d interpolation to
585
 
        get <VAR
586
 
CLASS="literal"
587
 
>tx</VAR
588
 
> as a function of <VAR
589
 
CLASS="literal"
590
 
>x</VAR
 
625
        get <TT
 
626
CLASS="literal"
 
627
>tx</TT
 
628
> as a function of <TT
 
629
CLASS="literal"
 
630
>x</TT
591
631
>
592
632
        looks like (in C):
593
633
      </P
612
652
>
613
653
      </P
614
654
><P
615
 
>       while in Fortran this might look like:
 
655
>       while in Fortran 77 this might look like:
616
656
      </P
617
657
><P
618
658
>       <TABLE
640
680
><H2
641
681
CLASS="sect2"
642
682
><A
643
 
NAME="shade-plots-fortran"
644
 
>Shade Plots from Fortran</A
 
683
NAME="shade-plots-f77"
 
684
>Shade Plots from the Fortran 77 interface</A
645
685
></H2
646
686
><P
647
 
>        NEEDS DOCUMENTATION
 
687
>        NEEDS DOCUMENTATION. Follow the plshade* and plshades* usage in
 
688
        <TT
 
689
CLASS="filename"
 
690
>examples/f77/x??f.f</TT
 
691
>.
648
692
      </P
649
693
></DIV
650
694
></DIV