1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923
|
.ig >>
<STYLE TYPE="text/css">
<!--
A:link{text-decoration:none}
A:visited{text-decoration:none}
A:active{text-decoration:none}
OL,UL,P,BODY,TD,TR,TH,FORM { font-family: arial,helvetica,sans-serif;; font-size:small; color: #333333; }
H1 { font-size: x-large; font-family: arial,helvetica,sans-serif; }
H2 { font-size: large; font-family: arial,helvetica,sans-serif; }
H3 { font-size: medium; font-family: arial,helvetica,sans-serif; }
H4 { font-size: small; font-family: arial,helvetica,sans-serif; }
-->
</STYLE>
<title>ploticus: proc scatterplot</title>
<body bgcolor=D0D0EE vlink=0000FF>
<br>
<br>
<center>
<table cellpadding=2 bgcolor=FFFFFF width=550><tr>
<td>
<table cellpadding=2 width=550><tr>
<td><br><h2>proc scatterplot</h2></td>
<td align=right>
<small>
<a href="../doc/welcome.html"><img src="../doc/ploticus.gif" border=0></a><br>
Version 2.33 Jun'06
</small><br><a href="../doc/scripthome.html">Scripts</a>
<td></tr></table>
</td></tr>
<td>
<br>
<br>
.>>
.TH proc_scatterplot PL "02-JUN-2006 PL ploticus.sourceforge.net"
.ig >>
<center>
<img src="../gallery/scatterplot0.gif">
<img src="../gallery/heatmap0.gif">
</center>
.>>
.LP
\fBProc scatterplot\fR displays data points in one or two dimensions using the
.ig >>
<a href="dataformat.html#currentds">
.>>
\0current data set
.ig >>
</a>
.>>
and
.ig >>
<a href="areadef.html">
.>>
\0current plotting area.
.ig >>
</a>
.>>
It can produce traditional scatterplots and distributions and also can be used as a general
technique for rendering data points or text at specific locations.
Data points can be rendered
as symbols, line segments, or bits of text. Data point color, shape, size,
and/or text content can be driven by data.
Duplicate data points can be clustered
in a variety of ways, or duplicity can be represented by color change.
(Unadjusted duplicate data points can appear as just one point, which may be misleading.)
Clickmap and mouseover text labels
are supported for data points.
See the
.ig >>
<a href="../gallery/gall.scat.html">
.>>
\0gallery scatterplot examples
.ig >>
</a>
.>>
and
.ig >>
<a href="../gallery/gall.heatmap.html">
.>>
\0heatmap examples.
.ig >>
</a>
.>>
.ig >>
<br><br><br>
.>>
.SH Attributes
For a 2-D scatterplot both \fCxfield\fR and \fCyfield\fR \fBmust\fR
be specified. For conventional scatterplots you'll probably also
want to specify a particular symbol.
.ig >>
<br><br><br>
.>>
.SH Data point position
.LP
\fBxfield\fR
.ig >>
.>>
.ig >>
<a href="attributetypes.html#dfield">
.>>
\0dfield
.ig >>
</a>
.>>
.IP \0
Contents of this field controls the X location of data points.
First field is 1.
Example: \fCxfield: 2\fR
.ig >>
<br><br>
.>>
.LP
\fByfield\fR
.ig >>
.>>
.ig >>
<a href="attributetypes.html#dfield">
.>>
\0dfield
.ig >>
</a>
.>>
.IP \0
Contents of this field controls the Y location of data points.
First field is 1.
Example: \fCyfield: 1\fR
.ig >>
<br><br>
.>>
.LP
\fBxlocation\fR
.ig >>
.>>
.ig >>
<a href="attributetypes.html#locvalue">
.>>
\0locvalue
.ig >>
</a>
.>>
.IP \0
If specified, a 1-D distribution will be rendered, with data points to be distributed
(before any clustering) vertically at X = \fIlocvalue\fR.
\fCyfield\fR can be used for the Y component.
.ig >>
<br><br>
.>>
.LP
\fBylocation\fR
.ig >>
.>>
.ig >>
<a href="attributetypes.html#locvalue">
.>>
\0locvalue
.ig >>
</a>
.>>
.IP \0
If specified, a 1-D distribution will be rendered, with data points to be distributed
(before any clustering) horizontally at Y = \fIlocvalue\fR.
\fCxfield\fR can be used for the X component.
.ig >>
<br><br><br>
.>>
.SH Displaying data points using symbols
.LP
\fBsymbol\fR
.ig >>
.>>
.ig >>
<a href="symboldetails.html">
.>>
\0symboldetails
.ig >>
</a>
.>>
.IP \0
If specified, a geometric point symbol will mark data points.
This specifies the attributes of the symbols to be used.
.br
Example: \fCsymbol: style=fill shape=circle fillcolor=red\fR
.ig >>
<br><br>
.>>
.LP
\fBrectangle\fR
.ig >>
.>>
\fIwidth height
.ig >>
.>>
\fC[outline]\fR
.IP \0 \0
If specified, data points will be displayed using a rectangle centered around the data point
of \fIwidth\fR data units wide and \fIheight\fR data units high.
If \fCoutline\fR is specified, the rectangles will be outlined with a line
(controllable using \fClinedetails\fR). The color of the rectangle can be
controlled via a datafield (see \fCsymfield\fR, \fCsymrangefield\fR, and
\fCdupsleg\fR below).
.br
Example: \fCrectangle 1 1 outline\fR
.br
Example: \fCrectangle 0.9 0.9\fR
.ig >>
<br><br>
.>>
.LP
See also the "Data-driven control" options for controlling the appearance of data points, below.
.ig >>
<br><br><br>
.>>
.SH Displaying data points using line segments
.LP
\fBlinelen\fR
.ig >>
.>>
\fIn\fR
.IP \0
If specified, data points will be displayed as short line segments.
The lines segments will be of length \fIn\fR in
.ig >>
<a href="attributetypes.html#positionunits">
.>>
\0absolute units.
.ig >>
</a>
.>>
The default direction of the line will
be appropriate for 1-D scatterplots; for 2-D it is horizontal.
Line color, etc. may be controlled using \fClinedetails\fR.
Line length may also be influenced using \fCsizefield\fR.
Line direction may be explicitly controlled using \fClinedir\fR.
Example: \fClinelen: 0.2\fR
.ig >>
<br><br>
.>>
.LP
\fBlinedir\fR
.ig >>
.>>
\fCh|v|u|r\fR
.IP \0
Allows explicit control of direction of line when displaying data points
as line segments (\fClinelen\fR).
\fCh\fR = horizontal (centered);
\fCv\fR = vertical (centered);
\fCu\fR = upward;
\fCr\fR = rightward.
Example: \fClinedir: v\fR
.ig >>
<br><br>
.>>
.LP
\fBlinedetails\fR
.ig >>
.>>
.ig >>
<a href="linedetails.html">
.>>
\0linedetails
.ig >>
</a>
.>>
.IP \0
If points are displayed using line segments (\fClinelen\fR), this
attribute allows control of color, line width, etc. Also can
be used to control outline when \fCrectangle\fR is used.
.ig >>
<br><br><br>
.>>
.SH Displaying data points using text
.LP
\fBtext\fR
.ig >>
.>>
.ig >>
<a href="attributetypes.html#text">
.>>
\0text
.ig >>
</a>
.>>
.IP \0
If specified, data points will be displayed using the
given \fItext\fR, centered around the data point.
This attribute may be used with or without a \fCsymbol\fR.
Example: \fCtext: A\fR
.ig >>
<br><br>
.>>
.LP
\fBlabelfield\fR
.ig >>
.>>
.ig >>
<a href="attributetypes.html#dfield">
.>>
\0dfield
.ig >>
</a>
.>>
.IP \0
If specified, data points will be displayed using the text in data
field \fIdfield\fR. The text will be centered around the data point.
May not be used with symbol; in order to do datafield-driven label
plus a symbol proc scatterplot must be invoked twice.
.br
Example: \fClabelfield: 4\fR
.ig >>
<br><br>
.>>
.LP
\fBlabelword\fR
.ig >>
.>>
\fIstring\fR
.IP \0
A template for displaying the values rendered by \fClabelfield\fR.
The value will be substituted in at the token @VAL.
Example:
.nf
labelfield: 2
labelword: Case @VAL
.fi
.ig >>
<br><br>
.>>
.LP
\fBtextdetails\fR
.ig >>
.>>
.ig >>
<a href="textdetails.html">
.>>
\0textdetails
.ig >>
</a>
.>>
.IP \0
Details concerning the rendering of data point text or data point labels.
.br
Example: \fCtextdetails: size=6\fR
.ig >>
<br><br>
.>>
.LP
\fBverticaltext\fR
.ig >>
.>>
\fCyes\fR | \fCno\fR
.IP \0
If \fCyes\fR, label text will be rendered vertically.
.ig >>
<br><br><br>
.>>
.SH Data-driven sizing of data points
.LP
\fBsizefield\fR
.ig >>
.>>
.ig >>
<a href="attributetypes.html#dfield">
.>>
\0dfield
.ig >>
</a>
.>>
.IP \0
If specified, the size of data point symbols, lines, or text are controlled by
this data field, effectively allowing another variable to be presented.
For symbols or text the value in \fIdfield\fR will be taken to be a character point size
(see also \fIsizescale\fR).
For line segments, the value in \fIdfield\fR
will scale the length of the lines, ie. a data value
of 2.0 doubles it and 0.5 halves it.
.ig >>
<br><br>
.>>
.LP
\fBsizescale\fR
.ig >>
.>>
\fIn\fR
.IP \0
May be used with \fCsizefield\fR when the size of data point symbols or text is
being controlled by a datafield. This attribute may be used
to scale the size of the point symbols to the desired range.
Scaling is based on symbol area rather than diameter.
A value of 2.0 doubles the resulting size; 0.5 halves it.
.ig >>
<br><br><br>
.>>
.SH Data-driven color / shape / size of data points
.LP
\fBsymfield\fR
.ig >>
.>>
.ig >>
<a href="attributetypes.html#dfield">
.>>
\0dfield
.ig >>
</a>
.>>
.IP \0
If specified, the data point color, size, shape, etc. can be driven by specific data values
in this field.
This attribute uses the
.ig >>
<a href="legendentry.html#legenddriven">
.>>
\0legend-driven technique
.ig >>
</a>
.>>
(the legend structure is used to map data values to symbol appearance specifications).
If rendering symbols, symbol attributes should be given in the legendentries \fCdetails\fR;
if rendering rectangles, colors should be given.
.br
Example:
.ig >>
<a href="../gallery/symfld.htm">
.>>
\0symfld
.ig >>
</a>
.>>
.ig >>
<br><br>
.>>
.LP
\fBsymrangefield\fR
.ig >>
.>>
.ig >>
<a href="attributetypes.html#dfield">
.>>
\0dfield
.ig >>
</a>
.>>
.IP \0
If specified, the symbol color, size, shape, etc. can be driven by numeric data
in this field.
Similar to \fCsymfield\fR above, except that numeric range comparison is used
when finding the appropriate legend entry, using the
.ig >>
<a href="legendentry.html#legenddriven">
.>>
\0legend-driven technique
.ig >>
</a>
.>>
(the legend structure is used to map data values to symbol appearance specifications).
Legend tags must be a single numeric value.
Legend entries must be specified in numerical order by tag, from highest to lowest.
Prospective values will be compared against legend entries in the order specified (highest to lowest);
when a legend entry tag is found that is less than or equal to the contents of
the \fCsymrangefield\fR data field,
that legend entry is chosen, and the point will be rendered using the symbol
described in that entry.
Examples:
.ig >>
<a href="../gallery/symrangefld.htm">
.>>
\0symrangefld
.ig >>
</a>
.>>
and
.ig >>
<a href="../gallery/heatmap3.htm">
.>>
\0heatmap3
.ig >>
</a>
.>>
.ig >>
<br><br><br>
.>>
.SH Displaying duplicity by clustering of data points
.LP
\fBcluster\fR
.ig >>
.>>
\fCyes\fR | \fCno\fR
.IP \0
If yes, data will be sorted on X,Y and duplicate (or near-duplicate) data points
will be detected and offset slightly to show duplicity.
The default is \fCno\fR (changed in 2.33).
2-D clusters may be as large as N=38 (after this, points will overlap).
Additional attributes related to clustering are described below.
Note: If labelfield and/or sizefield are being used, clustering
will work properly only when data are presorted into X,Y order.
.ig >>
<br><br>
.>>
.LP
\fBclustermethod\fR
.ig >>
.>>
\fC2d | horiz | vert | upward | rightward\fR
.IP \0
Explicitly control the way that duplicate points will be clustered.
.br
\fC2d\fR clusters the points evenly around the data point.
.br
\fChoriz\fR clusters the points evenly leftward and rightward.
.br
\fCvert\fR clusters the points evenly upward and downward.
.br
\fCupward\fR strings the points upward only for generating little vertical bars.
.br
\fCrightward\fR strings the points rightward only for generating little horizontal bars.
.br
Default is \fC2d\fR for 2-D scatterplots, or \fChoriz\fR or \fCvert\fR for 1-D
scatterplots depending on orientation.
An example of using \fCclustermethod: upward\fR to form rows of little bars is
.ig >>
<a href="../gallery/snpmap1.htm">
.>>
\0snpmap1
.ig >>
</a>
.>>
.IP \0
To represent duplicate points using different symbol colors (etc.) see \fCdupsleg\fR.
.ig >>
<br><br>
.>>
.LP
\fBclusterfact\fR
.ig >>
.>>
\fIf\fR
.IP \0
May be used when \fCclustering\fR is being done. The clustering offset distance
will be multiplied by \fIf\fR.
A value of 2.0 spreads clustered points out more, and 0.5 spreads them out less.
.ig >>
<br><br>
.>>
.LP
\fBclusterdiff\fR
.ig >>
.>>
\fIf\fR
.IP \0
May be used when \fCclustering\fR is being done. Two values
that are within \fIf\fR
.ig >>
<a href="attributetypes.html#positionunits">
.>>
\0absolute units (inches)
.ig >>
</a>
.>>
of each other will be considered duplicates
eligible for clustering. Default value is \fC0.001\fR.
.ig >>
<br><br>
.>>
.LP
\fBclustevery\fR
.ig >>
.>>
\fIn\fR
.IP \0
With clustering, normally every duplicate point is offset from all
the others, which may become cluttered and ineffective with large numbers of duplicates.
This attribute may be used to offset
only for every \fIn\fRth duplicate encountered.
.br
Example: \fCclustevery: 5\fR ..would result in a point having 35 duplicates
represented using 7 point marks.
.ig >>
<br><br><br>
.>>
.SH Displaying duplicity by data point color
.LP
\fBdupsleg\fR
.ig >>
.>>
\fCyes | no\fR
.IP \0
If \fCyes\fR, the appearance details of data points will be controlled by
the number of duplicate points counted.
This attribute can be used when rendering data points as symbols or rectangles, and it uses the
.ig >>
<a href="legendentry.html#legenddriven">
.>>
\0legend-driven technique
.ig >>
</a>
.>>
(the legend structure is used to map data values to appearance specifications).
Each legend entry must have a \fCtag\fR that is an integer.
If you're rendering symbols, supply
.ig >>
<a href="symboldetails.html">
.>>
\0symboldetails
.ig >>
</a>
.>>
for the legendentry \fCdetails\fR; supply a
.ig >>
<a href="color.html">
.>>
\0color
.ig >>
</a>
.>>
if rendering rectangles.
Legend entries must be specified in numerical order by tag, from highest to lowest.
As the scatterplot is drawn and duplicate points are detected,
a count of duplicates is maintained.
Then the count is compared against the set of tags (from highest to lowest).
When a tag is found that is <= the duplicate count, that
legend entry is chosen, and the point will be rendered using the symbol
described in that entry.
Example:
.ig >>
<a href="../gallery/dupsleg.htm">
.>>
\0dupsleg
.ig >>
</a>
.>>
.ig >>
<br><br><br>
.>>
.SH Selecting certain data points
.LP
\fBselect\fR
.ig >>
.>>
.ig >>
<a href="select.html">
.>>
\0select expression
.ig >>
</a>
.>>
.IP \0
May be used to select data rows for inclusion into the scatterplot.
.br
Example: \fCselect: @@3 = AA\fR
.LP
\fBxrange\fR
.ig >>
.>>
\fIlow high\fR
.IP \0
If specified, only data points within the given plottable range in X
will be shown. By default the points will be drawn only if within
the plotting area.
Example: \fCxrange: 0 50\fR
.LP
\fByrange\fR
.ig >>
.>>
\fIlow high\fR
.IP \0
If specified, only data points within the given plottable range in Y
will be shown. By default the points will be drawn only if within
the plotting area.
Example: \fCyrange: 0 50\fR
.ig >>
<br><br><br>
.>>
.SH Legend
.LP
\fBlegendlabel\fR
.ig >>
.>>
.ig >>
<a href="attributetypes.html#text">
.>>
\0text
.ig >>
</a>
.>>
.IP \0
A label to be associated with the current set of points in the legend.
\fBproc legend\fR must be executed later in order to
render the legend. \fB@NVALUES\fR may be used to signify number of
points rendered.
The \fC\\n\fR construct can be used to force a line break when the legend is displayed,
or the label can be wordwrapped using proc legend wraplen attribute (2.32+).
If
.ig >>
<a href="getdata.html">
.>>
\0proc getdata field names
.ig >>
</a>
.>>
are being used, use of
the special symbols \fC#usexname\fR (or \fC#useyname\fR) causes the field name of \fCxfield\fR (or \fCyfield\fR)
to be automatically used as the legend label (2.04+).
.br
Example: \fClegendlabel: Group 4, N=@NVALUES\fR
.br
Example: \fClegendlabel: Round 2\fR
.br
Example: \fClegendlabel: #useyname\fR
.ig >>
<br><br><br>
.>>
.SH Clickmap and mouseover
.LP
Note: clickmap is not supported when data points are displayed using line segments.
.LP
\fBclickmapurl\fR
.ig >>
.>>
\fIurl-template\fR
.IP \0
If generating an
.ig >>
<a href="clickmap.html">
.>>
\0HTML clickmap
.ig >>
</a>
.>>
, this specifies a url template, and
causes the data points (symbol or character) to be mapped.
This attribute usually contains one or more embedded
.ig >>
<a href="attributetypes.html#dfield">
.>>
\0data field references
.ig >>
</a>
.>>
preceded by double at-sign (@@).
See
.ig >>
<a href="clickmap.html">
.>>
\0HTML clickmap
.ig >>
</a>
.>>
for more details and examples.
.br
Example: \fCclickmapurl: http://abc.com/mycgi?category=@@3\fR
.ig >>
<br><br>
.>>
.LP
\fBclickmaplabel\fR
.ig >>
.>>
\fIlabel-template\fR
.IP
If generating a
.ig >>
<a href="clickmap.html">
.>>
\0client-side clickmap,
.ig >>
</a>
.>>
this specifies a template for building mouseover text labels.
.br
Example: \fCclickmaplabel: @@3 (@@4)\fR
.LP
\fBclickmaplabeltext\fR
.ig >>
.>>
.ig >>
<a href="attributetypes.html#text">
.>>
\0multiline text
.ig >>
</a>
.>>
.IP \0
Same as \fCclickmaplabel\fR but multiline text. Must be terminated with a blank line.
.ig >>
<br><br><br>
.>>
.SH Variables that are set by proc scatterplot
.LP
\fBNVALUES\fR = the number of in-range plottable points that were rendered.
Note: this may be used in the legendlabel.
.ig >>
<br><br>
.>>
.LP
\fBMAXDUPS\fR = the maximum number of clustered duplicate points. If \fCclustermeth\fR
is \fC2d\fR this maxes out at 37.
.ig >>
<br>
<br>
</td></tr>
<td align=right>
<a href="../doc/welcome.html">
<img src="../doc/ploticus.gif" border=0></a><br><small>data display engine <br>
<a href="../doc/Copyright.html">Copyright Steve Grubb</a>
<br>
<br>
<center>
<img src="../gallery/all.gif">
</center>
</td></tr>
</table>
<br>
<center>
Ploticus is hosted at http://ploticus.sourceforge.net <br>
<img src="http://sourceforge.net/sflogo.php?group_id=38453" width="88" height="31" border="0" alt="SourceForge Logo">
</center>
.>>
|