Cloud Plot axis alignment

3 views
Skip to first unread message

prhutson

unread,
Oct 20, 2010, 2:16:20 AM10/20/10
to MadUseR
I have created a cloud plot of drug toxicity grade (z) vs drug dose
(x) and treatment number (y) (see below for data and script). I am
unable to align the axis labels with the axis, and the y label in
particular cannot be made any longer without overlapping the axis
itself (I'd like to change this to "Treatment Number"). I have tried
variations of par(las=0) and staxlab from the web help, but they do
not make the fix. Most suggestions seem to rotate the tick labels,
not the axis label. Can anyone suggest a fix? Data and script:

xdata<-c(0.1, 0.1, 0.1, 15,15,15,15,15,15,15,1,1,1,1,3,3,3,3,15,15,
15,15,1,1,1,1,3,3,3,3,3,3,3,3,15,15,10,10,10,15,15,15,15,0.1, 0.1,
0.1,0.1,0.3,0.3,0.3,0.3,3,3,3,3,15,15,15,15,15,15,15,15,15,15,3,3,
3,3,10,15,15,15,15,15,0.1,0.1,0.1,0.1,1,1,1,1,0.3,0.3,0.3,0.3,0.3,
0.3,0.3,0.3,1,1,1,1,1,1,1,1,3,3,3,3,3,3,3,10,10,10,10,15,15,15,15,
15,15,15,15,15,15)
ydata<-c(1,2, 3, 1, 2, 3, 4, 1, 2, 3, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
11, 12, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 1, 2, 1, 2, 3, 1, 2, 3, 4,
1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 1, 2, 3, 1, 2, 3, 4, 1,
2, 3, 4, 1, 1, 2, 3, 1, 2, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 1, 2,
3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 1, 2, 3, 4, 1, 1,
2, 3, 4, 1, 2, 3, 4, 1)
zdata<- c(0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 3, 0,
1, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 1, 2, 3,
0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 2, 0, 3, 0, 3, 2)
plot.new()
cloud(zdata ~ xdata * ydata,type=c("p","h"),
col="darkblue", scales = list(x=list(at=c(0.1, 1,3,10,15),
labels=c(0.1, 1,3,10,15), arrows=FALSE),
y=list(arrows=FALSE),
z=list(at=c(0,1,2,3), labels=c(0,1,2,3),arrows=FALSE)),
xlab="Dose (mg/kg)", ylab="Cycle", zlab="Grade")

Aimee Teo Broman

unread,
Oct 22, 2010, 9:13:47 AM10/22/10
to mad...@googlegroups.com, prhutson
Have you tried ylab=list("Treatment Number", rot=-45)? It's part of the
help(cloud) documentation--see zlab.

--Aimee

--
biostatistics and medical informatics phone:(608)263-5374
543b biochemistry addition fax:(608)263-9609
433 babcock drive
madison, wi 53706-1544
--

Paul Hutson

unread,
Oct 22, 2010, 9:25:45 AM10/22/10
to Aimee Teo Broman, mad...@googlegroups.com
Aimee: I thought I had, but your suggestion works perfectly.  Thank you.
Paul


On 10/22/2010 8:13 AM, Aimee Teo Broman wrote:
Have you tried ylab=list("Treatment Number", rot=-45)?  It's part of the help(cloud) documentation--see zlab.

--Aimee

On 10/20/2010 01:16 AM, prhutson wrote:
I have created a cloud plot of drug toxicity grade (z) vs drug dose
(x) and treatment number (y) (see below for data and script).  I am
unable to align the axis labels with the axis, and the y label in
particular cannot be made any longer without overlapping the axis
itself (I'd like to change this to "Treatment Number").  I have tried
variations of par(las=0) and staxlab from the web help, but they do
not make the fix.  Most suggestions seem to rotate the tick labels,
not the axis label.  Can anyone suggest a fix?

--

Paul R. Hutson, Pharm.D.

Associate Professor

UW School of Pharmacy

777 Highland Avenue

Madison WI 53705-2222

Tel  608.263.2496

Fax 608.265.5421

Pager 608.265.7000, p7856

Reply all
Reply to author
Forward
0 new messages