s-news
[Top] [All Lists]

[S] Answers to "Simple Plot of Alphanumeric data"

To: "'s-news@wubios.wustl.edu'" <s-news@wubios.wustl.edu>
Subject: [S] Answers to "Simple Plot of Alphanumeric data"
From: "Barker, Chris {GL P~Palo Alto}" <CHRIS.BARKER@roche.com>
Date: Thu, 28 Jan 1999 10:03:52 -0800
Sender: owner-s-news@wubios.wustl.edu
My sincerest thanks to those who replied. I've cut and pasted two replies
below. I have only had time to try the first procedure below, but it worked
like a charm for me. 
____________________________________________________________________________
_________________
S.D.Byers [byers@research.att.com]

For example: In latex there is a built in glossary function. 
             latex also has a nice table environment to format such
things. One of these would be my first choice. 

If you want to stick to MS products it might be the case that Word offers
a built in glossary functionality, I would not know abything about that. 

It seems a bit wasteful (and not quite correct) to have a plot that
contains only text unless there is some other structure present, such as
tree or graph links. But having said that it is perfectly feasible. 


Run this Splus script to see what occurs.

### script to demo text on graphics device in Splus
X11() 
short.names <-c("SCoffM","KF","DRG","GG","TRT") 
long.names <-c("Special Coffee Machines","Kipper Factory","Daring Rented 
Glaziers","Gaggles of Geese","Tenuosly Routed Tortoise") 

n <- length(short.names)

## Note abbrevs not sorted, will do that in plotting.


plot(0,0,pch=19,ylim=c(0,n+1),xlim=c(0,10), axes=F,xlab="",ylab="")
par(adj=1) 
text(rep(1,n),n:1,short.names[order(short.names)]) 
par(adj=0.5)
text(rep(3,n),n:1,rep("=",n)) 
par(adj=0)
text(rep(5,n),n:1,long.names[order(short.names)])

par(adj=0.5) 
title(main="Glossay of terms")




##################


Note you may need to dink about to fix sizes and spacing etc etc. For a
print preview from unix Splus do this, sorry if you use a PC.


printgraph(file = "/tmp/test.ps", width = 6, horizontal =F)
unix("ghostview /tmp/test.ps &")
____________________________________________________________________________
_________________

#Create some hypothetical variables and labels.
variables <- c("ht", "wt", "age", "bp")
labels <- c("Height", "Weight", "Age", "Blood Pressure")

#Open a graphics window, to write the text to later.  xlim and ylim
#may need adjustments, depending on the length of the variable and
#label names, and depending on how many there are.
plot(0,0, xlim=c(0,length(variables)), ylim=c(0,length(variables)),
   type='n', axes=F, xlab="", ylab="")

#Write text to the graphics window.  Placement of text using the first
#two arguments of text will need adjustment according to how long your
#variable names are, and how many variables you want on the page.
for(i in 1:length(variables)){
  text(0,i, variables[i], cex=2, adj=0)
  text(0.5, i, "=", cex=2);
  text(1,i, labels[i], cex=2, adj=0)
}



Chris Barker
Principal Pharmacoeconomic Statistician
Roche Pharma Business - Palo Alto
(650)-852-3152

-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu.  To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message:  unsubscribe s-news

<Prev in Thread] Current Thread [Next in Thread>
  • [S] Answers to "Simple Plot of Alphanumeric data", Barker, Chris {GL P~Palo Alto} <=