## Ploticus prefabs examples gallery

Version 2.32
Prefabs

Manual page for Ploticus_prefabs_examples_gallery(PL)

This page is a collection of all of the ploticus prefab examples.``

## chron

These examples all use the chron prefab.`` All of these examples are included in the distribution (`./pltestsuite/testpf_chron`).``

## chron example 1 - dates

    pl  -prefab chron  data=data14  x=1  y=2  datefmt=yy/mm/dd  xinc="1 month" \
         stubfmt=M  xyears=yyyy  yrange="0 25"  barwidth=line  color=red  \
         title="# hits per day"  omitweekends=yes

    The data14 file:
    	00/12/21 1
    	00/12/22 1
    	00/12/23 2
    	00/12/27 1
            ...etc.

## chron example 2 - dates - tabulated by week

    pl  -prefab chron  data=data14  x=1  y=2  datefmt=yy/mm/dd  xinc="1 month" \
          stubfmt=M  xyears=yyyy  color=green  tab=week  title="# hits per week"

## chron example 3 - dates - tabulated by week

    pl  -prefab chron  data=data19  x=2  y=1  datefmt=mmddyy  xinc="1 month" \
    	stubfmt=M  xyears=yyyy  color=green  tab=week  include2=annot \
    	title="# website visitors per week"  rectangle="1 1 4 2.5"  ygrid=yes  \
    	mode=line step=yes fill=red

    The data19 file:
      18 071301
      16 071401
      15 071501
      34 071601
      ...etc.

In the above example, notice that rectangle (new in 2.02) was used to set a smaller size, and a file containing script code for the annotation is included.``

## chron example 4 - dates - tabulated by month

    pl  -prefab chron  data=data14  x=1  y=2  datefmt=yy/mm/dd  xinc="1 month"  \
    	stubfmt=M  xyears=yyyy  color=powderblue  tab=month  tabmode=first  \
    	nearest=month  barwidth=0.2  curve=yes

## chron example 5 - datetimes - tabulated by hour

    pl -prefab chron  data=data16  x=1  tab=hour  datefmt=yy/mm/dd  xinc="1 day" \
    	barwidth=line  stubfmt=MMMdd  unittype=datetime  timefld=2  \
    	title="# hits per hour"

    The data16 file:
    	01/09/05	09:43:35
    	01/09/05	09:43:40
    	01/09/05	13:15:00
    	01/09/05	13:15:11
    	...etc.

    Note that a file such as this (data13) could also be used, and timefld
    would not need to specified:
    	01/09/05.09:43:35
    	01/09/05.09:43:40
    	01/09/05.13:15:00
    	01/09/05.13:15:11
    	..etc.

## chron example 6 - times - tabulated by hour

    pl -prefab chron  data=data15  x=1  tab=hour unittype=time xinc="1 hour" \
    	nearest=hour  barwidth=0.2  stubfmt=HHA  \
    	title="# events per hour"  color=coral

    The data15 file:
    	07:47:49
    	07:47:52
    	07:47:54
    	..etc.

## chron example 7 - hourly temperature readings plotted for one week

    pl -prefab chron data=data22 header=yes x=1 y=2 datefmt=mm/dd/yyyy  \
      xinc="1 day" mode=line unittype=datetime title="temperatures this week"

    The data22 file has data for one week and begins like this:
    datetime temp
    12/08/2002.00:00 22
    12/08/2002.06:00 24
    12/08/2002.12:00 31
    12/10/2002.00:00 30

## chron example 8 - multiple curves

    pl -prefab chron data=data24 header=yes unittype=datetime mode=line\
      datefmt=mm/dd/yyyy x=dt y=airtemp y2=soiltemp y3=watertemp \
      xinc="1 day" legendfmt=singleline

    The data24 file looks like this:
    dt airtemp soiltemp watertemp
    12/08/2002.06:00 24 27 16
    12/09/2002.00:00 25 27 16
    12/10/2002.00:00 30 27 15
    12/11/2002.00:00 32 32 15
    12/12/2002.00:00 40 37 16
    12/13/2002.00:00 19 27 15
    12/14/2002.00:00 14 18 13

In version 2.20 the ability to render multiple curves or bar sets was introduced.`` This can be done so long as tabulation is not being performed.``

## cumufrac

These examples use the cumufrac prefab and are included in the distribution (`./pltestsuite/testpf_cumufrac`).``

## cumufrac example 1

    	pl  -prefab cumufrac  data=cumufrac.dat  header=yes  x=1  name="set 1"  \
    	  x2=2  name2="set 2" title="Cumulative fraction plot"

    	The cumufrac.dat file looks like this:
    	set1	set2
    	1.26	2.37
    	0.34	2.16
    	0.70	14.82
    	1.75	1.73
    	50.57	41.04
    	...

## cumufrac example 2

    	pl  -prefab cumufrac  data=cumufrac.dat header=yes  logmode=log   x=1   x2=2  \
    	  title="Cumulative fraction plot w/ log scale" \
    	  linedet="color=blue width=1.5" \
    	  linedet2="color=orange width=1.5 style=2 dashscale=3"

## dist

These examples all use the dist prefab.`` All of these examples are included in the distribution (`./pltestsuite/testpf_dist`).``

## dist example 1

    	pl -prefab dist fld=1  data=data6  curve=yes  binsize=0.05 \
    	  barwidth=0.08  ygrid=yes

    	data6 file:
    		0.017
    		0.269
    		0.178
    		..etc.

## dist example 2

      pl -prefab dist  fld=1  data=data8  cats=yes  yrange=0  \
         stubvert=yes  barwidth=0.05   ylbl="# Hits"   order=rev

      data8 file:
    	home
    	kwindex
    	details
    	browseform
    	..etc.

## heatmap

These examples use the heatmap prefab and are included in the distribution (`./pltestsuite/testpf_heatmap`).``

## heatmap example 1

       pl -prefab heatmap data=curve1.dat y=1 x=2

       The curve1.dat file looks like this:
    	331	75
    	331.624	83.5518
    	332.105	88.7758
    	332.492	91.8638
    	..etc.

The heatmap prefab's basic mode is to count instances. Here, the bin sizes in x and y are automatically determined, as is the breakdown for color coding.`` Default color scheme is used.`` These can all be given explicitly if desired.`` In this example, both X and Y are numeric.``

## heatmap example 2

      pl -prefab heatmap data=snpmap.dat header=yes y=1 x=2 ycats=yes xbinsize=5  \
         colorlist=white,limegreen,green,teal,blue,purple,black

Counting instances again. In this example X is categorical and Y is numeric, and a user-supplied x binsize and color scheme was used. Y bin size and color breakdown are automatically determined.``

## heatmap example 3

      pl -prefab heatmap data=data26 x=1 xcats=yes y=2 ycats=yes contentfield=3  \
    	outline="color=black width=5"

      The data26  file looks like this:
    	CL PNG 44
    	CL SVG 38
    	CL SWF 26
    	CL PS 54
    	CGI PNG 37
    	...

In this example, instead of counting instances, a predetermined value (`contentfield=3`) is used to set cell color. Both X and Y are categorical. The cells are separated by thicker black lines.``

## heatmap example 4

      pl -prefab heatmap data=data26 x=1 xcats=yes y=2 ycats=yes contentfield=3 \
    	symbol="shape=circle radius=0.1" legendsep=0.2 zerocolor=white

Same as example 3 but circles are used for cells, and background is white.``

## lines

These examples all use the lines prefab.`` All examples are included in the distribution (`./pltestsuite/testpf_lines`).``

## lines example 1

       pl -prefab lines  data=data17  x=1 y=2  pointsym=none

       The data17 file:
    	331 75
    	331.624 83.5518
    	332.105 88.7758
    	..etc.

## lines example 2

       pl  -prefab lines data=data10 delim=tab  x=1  y=2  y2=4  step=yes \
         yrange=0 name="Group A" name2="Group B" xlbl=Months

## lines example 3

       pl  -prefab lines  data=data10 delim=tab  x=1  y=2 err=3  y2=4 err2=5  \
           y3=6 err3=7  y4=8 err4=9   yrange=0  xlbl=Months \
           name="Group A" name2="Group B" name3="Group C" name4="Group D"

       The data10 file:
           0	100	2	100	4	100	3	100	4
           1.5	92	4	94	7	87	6	86	5
           3	89	4	92	8	78	6	74	4
           6	86	5	91	8	65	8	61	6
           ..etc.

## lines example 4

       pl -prefab lines  data=data20  x=1  y=2

       The data20 file:
          1031 20.96 6.4
          1032 19.71 5.8
          1033 19.98 5.9
          ... etc.

## lines example 5

      pl -prefab lines  data=data20  x=1  y=2  fill=redorange pointsym=none  \
    	y2=2 pointsym2=none

In this example the same data field was given twice, first to do the filled area, and again to do the blue line.``

## lines example 6

       pl -prefab lines  data=data20  x=1  y=2  gapmissing=yes

## lines example 7

       pl -prefab lines  data=data20  x=1  y=2  fill=tan1  pointsym=none  \
    	y2=2 pointsym2=none  y3=3  pointsym3=none  linedet3=color=black \
    	yrange="0 25"  name="background" name3="interior"

## multidist

This example uses the multidist prefab.``

## Example 1

      pl  -prefab multidist  overlay=yes  data=data21  rotate=yes  \
         xrange="0 2000"  yrange="0 20"

           The data21 file is like this:
           sample1	380	239	384	384	1220	888
           sample2	778	870	398	499	1472

    		..etc.

## pie

These examples use the pie prefab.`` They are included in the distribution (`./pltestsuite/testpf_pie`).``

## pie example 1

        pl  -prefab pie  values=3  labels=1  data=data9  \
          delim=tab  title="Student enrollment"

        data9 file:
    	Business Admin	1.39	331
    	English 	1.67	182
    	Chemistry	2.07	301
    	..etc.

## pie example 2

        pl  -prefab pie  data=data23  delim=tab  values=2  labels=1  colorfld=3  \
          title="Colors from data field"  legend=yes

        the data23 file:
    	Employment		8	red
    	In transit		2	orange
    	Meals			1	green
    	Errands			1	purple
    	Household chores	2	yellow
    	Recreation & relaxation	2	blue
    	Sleep			8	gray(0.8)

Colors driven by data, and a legend for explanation.``

## pie example 3

      pl  -prefab pie  data=data23  delim=tab  values=2  "labelfmtstring= @1\n (@PCT%)"
    	colorfld=3  labelback=dullyellow  firstslice=90 center="4 3" radius=1.5

Labels with backing boxes, and an explicitly defined center and radius.``

## scat

These examples use the scat prefab and are included in the distribution (`./pltestsuite/testpf_scat`).``

## scat examples 1 & 2

    Left:	pl  -prefab scat  data=data1  x=2  y=3

    Right:	pl  -prefab scat  data=data1  x=2  y=3  id=1 \
    	   xlbl="Total Ch"  ylbl="White Blood Cell Count"  corr=yes

    data1 file: 	A/J	1.39	331
    		BALB/cJ	1.67	182
    		C3H/HeJ	2.07	301
    		..etc..

## scat example 3

    pl  -prefab scat  data=data3  x=2  y=6  err=3  xerr=7  corr=yes \
    	  ptshape=triangle ptsize=0.08  ptcolor=red  "errcolor=gray(0.8)"

    data3 file:
    	129S1/SvImJ 0.4927 0.111 0.353 129S1/SvImJ 0.4080 0.0839 0.265
    	A/J 0.5547 0.0768 0.243 A/J 0.6051 0.0656 0.207
    	AKR/J 0.4125 0.0631 0.200 AKR/J 0.3653 0.0418 0.132
    	...etc.

## scat example 4

Two different sets of data points are plotted using two different symbols, and error bars are also generated.`` The sets are selected using `ptselect` and `ptselect2`.``

    pl -prefab scat data=data25 delim=tab x=3 y=4 err=5 ptselect=" = A" xerr=6 \
    	x2=3 y2=4 err2=5 ptselect2=" = B" xerr2=6

    data25 file:
    	ABC	A	5	4	2.5	2.3
    	ABC	B	4	4.5	1.6	1.8
    	DEF	A	8	9	1.8	1.5
    	DEF	B	3	3	0.9	1.3
    	GHI	A	7.7	6.5	1.2	0.6
    	GHI	B	6.6	6.3	0.8	1.1

## stack

These examples use the stack prefab.`` They are included in the distribution (`./pltestsuite/testpf_stack`)

## stack example 1 - bars

       pl -prefab stack data=data10 x=1 y=2 y2=4 y3=6 y4=8 xlbl=Months \
        name="Group A" name2="Group B" name3="Group C" name4="Group D"

       data10 file:
    	0	100	2	100	4	100	3	100	4
    	1.5	92	4	94	7	87	6	86	5
    	3	89	4	92	8	78	6	74	4
    	..etc.

## stack example 2 - a stacked area plot

       pl -prefab stack data=data5 delim=tab header=yes x=1 y=2 y2=3 y3=4 y4=5  \
            stackarea=yes echodata=yes stubvert=yes \
    	name=eastern name2=central name3=mountain name4=pacific

       data5 file looks like this:
         Test 3	76	19	84	14
         Test 4	83	12	64	9
         Test 5	95	11	92	13
         Test 6	42	8	76	11
         Test 7	69	13	68	6
         Test 8	76	19	84	14
         Test 9	83	12	64	9
         Test 10	95	11	92	13
         Test 11	42	8	76	11
         Test 12	69	13	68	6

## vbars

These examples use the vbars prefab and are included in the distribution (`./pltestsuite/testpf_vbars`)

## vbars example 1

      pl  -prefab vbars  data=data4  delim=tab  x=1  y=2  vals=yes\
           yrange=0  yinc=20  ygrid=yes  barwidth=0.3

    	data4 file:
    		Group A	78	7
    		Group B	84	12
    		Group C	56	6

## vbars example 2

       pl -prefab vbars  data=data5  delim=tab  x=1  y=2  err=3  \
       y2=4  err2=5  errunder=yes  ygrid=yes  barwidth=0.1  \
         name=Treatment  name2=Control stubvert=yes

        data5 file:
    	Test 3	76	19	84	14
    	Test 4	83	12	64	9
    	Test 5	95	11	92	13
    	...etc..

## vbars example 3

      pl -prefab vbars  data=data5  delim=tab  x=1  y=2  err=3  y2=4  \
      err2=5   erronly=yes   name=Treatment  name2=Control  stubvert=yes \
      errcolor=red  errcolor2=blue  sep=0.08  xgrid=yes  ylog=log

## vbars example 4

       pl -prefab vbars  data=data18  x=1  y=2  crossover=0  \
       color=blue  vals=yes

       The data18 file:
    	1992	-47
    	1993	-63
    	1994	-24
    	1995	12
    	..etc.

## vdist

These examples use the vdist prefab.`` They are included in the distribution (`./pltestsuite/testpf_vdist`).`` All examples use data from the `data6` and `data6b` files having one field containing several hundred numeric values.``

## vdist example 1

        pl -prefab vdist data=data6 y=1

## vdist example 2

       pl -prefab vdist data=data6 y=1  mediansym=dot  dist=hist \
    	showoutliers=yes

## vdist example 3

       pl  -prefab vdist   data=data6 data2=data6b   y=1 y2=1   dist=hist \
    	title="Set 1"   title2="Set 2"

Markup created by unroff 1.0, `` `` August 23, 2005.