[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [Groff] Venn Diagram in Pic?
From: |
Nathaniel Harward |
Subject: |
RE: [Groff] Venn Diagram in Pic? |
Date: |
Tue, 16 Sep 2008 01:04:59 -0700 |
There is an old post from 2007 about Venn diagrams in PIC I found on Google
while looking for existing Venn/PIC help; after not really finding anything
I could use I created a few PIC macros for them after some experimentation
since I needed to make some. I thought I'd post them here, there is a
picture of some samples at:
http://nharward.blogspot.com/2008/09/venn-diagrams-in-pic.html
For PIC newbies like me make sure to include the following snippet in your
troff/groff/whatever source to use them:
-- snip --
.PS
define vennDiagram1 {
box height $1 width $2
$3 at last box.nw - (0.1, 0.0)
"U" at last box.ne - (0.1, 0.1)
circle radius last box.height/4 at last box.c
$4 at last circle.nw + (-0.1, 0.1)
move to last box.e
}
define vennDiagram2 {
box height $1 width $2
$3 at last box.nw - (0.1, 0.0)
"U" at last box.ne - (0.1, 0.1)
circle radius last box.height/4 at last box.c - (last box.height/8, 0)
$4 at last circle.nw + (-0.1, 0.1)
circle radius last box.height/4 at last box.c + (last box.height/8, 0)
$5 at last circle.ne + (0.1, 0.1)
move to last box.e
}
define vennDiagram3 {
box height $1 width $2
$3 at last box.nw - (0.1, 0.0)
"U" at last box.ne - (0.1, 0.1)
circle radius last box.height/4 at last box.c - (last box.height/7,
-last box.height/10)
$4 at last circle.nw + (-0.1, 0.1)
circle radius last box.height/4 at last box.c + (last box.height/7,
last box.height/10)
$5 at last circle.ne + (0.1, 0.1)
circle radius last box.height/4 at last box.c - (0, last box.height/7)
$6 at last circle.sw - (0.1, 0.1)
move to last box.e
}
.PE
-- snip --
From then on you can use them in your document source; the example below
prints three diagrams one below the other:
-- snip --
.PS
vennDiagram1(2, 3, "1.", "A")
move down from last box.s
vennDiagram2(2, 3, "2.", "A", "B")
move down from last box.s
vennDiagram3(2, 3, "3.", "X", "Y", "Z")
.PE
-- snip --
Hope that helps.... somebody out there. Big thanks to "PIC — A Graphics
Language for Typesetting User Manual" by Brian Kernighan (1991) for the
help.
Nat Harward
- RE: [Groff] Venn Diagram in Pic?,
Nathaniel Harward <=