Hi List,
I am trying unsucessfully to modify the fontsize of lables in mosaic:
require(vcd)
mosaic(Titanic, pop=FALSE,
labeling_args=list(rot_labels=c(bottom=90,top=90),
set_varnames = c(Sex = "Gender"),
gp_text=gpar(fontsize=20))) #can't get it to resize text
tab <- ifelse(Titanic < 6, NA, Titanic)
# it works for labeling_cells
labeling_cells(text = tab, margin 0,gp_text=gpar(fontsize=20))(Titanic)
What am I doing wrong?
Thanx
Herry
> From: r-help-bounces at r-project.org > [mailto:r-help-bounces at r-project.org] On Behalf Of > Alexander.Herr at csiro.au > Sent: Wednesday, 19 September 2007 2:04 p.m. > To: r-help at stat.math.ethz.ch > Subject: [R] fontsize in mosaic plot lables > > Hi List, > > I am trying unsucessfully to modify the fontsize of lables in mosaic: > > > require(vcd) > mosaic(Titanic, pop=FALSE, > labeling_args=list(rot_labels=c(bottom=90,top=90), > set_varnames = c(Sex = "Gender"), > gp_text=gpar(fontsize=20))) #can't get it to resize text > > tab <- ifelse(Titanic < 6, NA, Titanic) > # it works for labeling_cells > labeling_cells(text = tab, margin > 0,gp_text=gpar(fontsize=20))(Titanic) > > What am I doing wrong?The mosaic function isn't part of lattice. Try cex.axis in a more or less normal way instead of gpar settings. HTH ___________________________________________________________________ The contents of this e-mail are privileged and/or confidential to the named recipient and are not to be used by any other person and/or organisation. If you have received this e-mail in error, please notify the sender and delete all material pertaining to this e-mail.
Thanks Patric,
mosaic{vdc} takes gpar parameters. So cex.axis does not work for
mosaic(Titanic, pop=FALSE,
labeling_args=list(rot_labels=c(bottom=90,top=90),cex.axis=0.5))
or
mosaic(Titanic, pop=FALSE,
labeling_args=list(rot_labels=c(bottom=90,top=90)),cex.axis=0.5)
However,
mosaic(Titanic, pop=FALSE,
labeling_args=list(rot_labels=c(bottom=90,top=90),gp_labels=(gpar(fontsi
ze=5))))
works for all labels.
Is there a way to adjust only one set of axis labels?
Thanx and cheers
Herry
-----Original Message-----
From: Patrick Connolly [mailto:PConnolly at hortresearch.co.nz]
Sent: Thursday, September 20, 2007 7:15 AM
To: Herr, Alexander Herr - Herry (CSE, Townsville);
r-help at stat.math.ethz.ch
Subject: RE: [R] fontsize in mosaic plot lables
> From: r-help-bounces at r-project.org
> [mailto:r-help-bounces at r-project.org] On Behalf Of
> Alexander.Herr at csiro.au
> Sent: Wednesday, 19 September 2007 2:04 p.m.
> To: r-help at stat.math.ethz.ch
> Subject: [R] fontsize in mosaic plot lables
>
> Hi List,
>
> I am trying unsucessfully to modify the fontsize of lables in mosaic:
>
>
> require(vcd)
> mosaic(Titanic, pop=FALSE,
> labeling_args=list(rot_labels=c(bottom=90,top=90),
> set_varnames = c(Sex = "Gender"),
> gp_text=gpar(fontsize=20))) #can't get it to resize text
>
> tab <- ifelse(Titanic < 6, NA, Titanic) # it works for labeling_cells
> labeling_cells(text = tab, margin >
0,gp_text=gpar(fontsize=20))(Titanic)
>
> What am I doing wrong?
The mosaic function isn't part of lattice. Try cex.axis in a more or
less normal way instead of gpar settings.
HTH
___________________________________________________________________
The contents of this e-mail are privileged and/or confidenti...{{dropped}}
> From: Alexander.Herr at csiro.au [mailto:Alexander.Herr at csiro.au] > Sent: Thursday, 20 September 2007 11:38 a.m. > To: Patrick Connolly; r-help at stat.math.ethz.ch > Subject: RE: [R] fontsize in mosaic plot lables > > Thanks Patric, > > mosaic{vdc} takes gpar parameters. So cex.axis does not work forOK, my mistake. I was thinking of mosaicplot in the graphics package. It's a while since I used it, and I seem to remember it was a bit tricky also, but I did get it to work in the end using mtext which lets you set the cex. But that's no use to you. ___________________________________________________________________ The contents of this e-mail are privileged and/or confidential to the named recipient and are not to be used by any other person and/or organisation. If you have received this e-mail in error, please notify the sender and delete all material pertaining to this e-mail.
Herry,
mosaic() by default uses the labeling_border() workhorse, which gives
you the choice of modifying either gp_labels or gp_varnames. So just
replacing gp_text by gp_labels shoud do the trick.
Best
David
----------
Hi List,
I am trying unsucessfully to modify the fontsize of lables in mosaic:
require(vcd)
mosaic(Titanic, pop=FALSE,
labeling_args=list(rot_labels=c(bottom=90,top=90),
set_varnames = c(Sex = "Gender"),
gp_text=gpar(fontsize=20))) #can't get it to resize text
tab <- ifelse(Titanic < 6, NA, Titanic)
# it works for labeling_cells
labeling_cells(text = tab, margin 0,gp_text=gpar(fontsize=20))(Titanic)
What am I doing wrong?
Thanx
Herry
--
Dr. David Meyer
Department of Information Systems and Operations
Vienna University of Economics and Business Administration
Augasse 2-6, A-1090 Wien, Austria, Europe
Tel: +43-1-313 36 4393
Fax: +43-1-313 36 90 4393
HP: http://wi.wu-wien.ac.at/~meyer/