[19052] in s-news-athena
[S] Tick mark's labels question.
daemon@ATHENA.MIT.EDU (=?iso-8859-1?Q?"G=E9rald_Jean"?=)
Thu Aug 26 14:28:23 1999
From: =?iso-8859-1?Q?"G=E9rald_Jean"?= <Gerald.Jean@spgdag.ca>
To: s-news@wubios.wustl.edu
Message-Id: <852567D9.0063A0EA.00@mail.spgdag.com>
Date: Thu, 26 Aug 1999 14:22:43 -0400
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
Hello S users,
I have a function that plots a weighted mean of some continuous variables
by levels of a factor. I use the levels of the factor as tick mark's
labels. I send as argument to the function several factors in turn and I
want to have the function general enough so I don't have to fiddle with the
parameters to matplot every time I need such a plot.
Questions:
1) Why is it that for two different factor variables, with the same number
of levels, one of the plot will have tick mark's labels for each tick mark
and the other plot will have those labels only at alternate tick marks? Is
there a way to force a label at each tick mark?
2) I can't get the right most tick mark's labels to line up properly with
the other ones? Playing with the rotation parameter "crt" and the
alignment parameter "adj" I can get it the way I want it, but then the
other ones are not correct? What am I doing wrong?
Following you'll find the portion of the code that does the plotting.
par(mgp=c(3.0,1.75,0))
matplot (c(1:dim(plot.mat)[1]), plot.mat, type = 'b', col = 1,
main = mytitle,
xlab =
substring(xlabstr,regexpr('\\$',xlabstr)+1,nchar(xlabstr)),
ylab = 'Frequences',
ylim = c(mymin,mymax),
axes = F)
axis(side=1,at=c(1:length(levels(factor))),labels=levels(factor),
crt=30,
adj = 0.3)
axis(side=2)
box(n=1)
Gérald Jean
Analyste-conseil (statistiques), Actuariat
télephone : (418) 835-8839
télecopieur : (418) 835-5865
courrier électronique: gerald.jean@spgdag.ca
"In God we trust all others must bring data"
-----------------------------------------------------------------------
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