Fwd: Question about the font of the axis labels and titles in ggplot2

55 views
Skip to first unread message

Martí Casals

unread,
Mar 21, 2013, 9:14:56 AM3/21/13
to ggp...@googlegroups.com

Hello,


I use the following code to produce the graph attached:

ggplot(tab3$int,aes(x=Package,y=B,colour=Package,shape=factor(mu)),size=4)+geom_point()+

theme_bw()+opts(panel.margin=unit(0,"lines"))+ scale_shape_manual("Marginal mean", values = c(1, 4)) +

labs(y="Intercept Bias")+ ylim(-1.5,1.5)+ geom_point(size=3)+facet_grid(overdispersion~N+offset,labeller=label_both)+

geom_hline(yintercept=0,colour="gray",linetype=2)


Could anyone tell me, please, how to increase the font of the axis labels and titles. For other figures, I use arguments cex.axis and/or cex.lab, but with ggplot2 I don't know how to achieve that. 

Thank you very much!


Martí

--
Martí Casals Toquero

Centre d' Investigació Biomèdica d'Epidemiología i Salut Pública

Agència de Salut Pública de Barcelona

Servei d' Epidemiologia

Tel. 932384545 extensió: 391


mca...@aspb.es



--
Martí Casals Toquero

Centre d' Investigació Biomèdica d'Epidemiología i Salut Pública

Agència de Salut Pública de Barcelona

Servei d' Epidemiologia

Tel. 932384545 extensió: 391


mca...@aspb.es
plot_question.doc

Riley, Steve

unread,
Mar 21, 2013, 9:29:33 AM3/21/13
to Martí Casals, ggp...@googlegroups.com

Marti,

 

You can use something like this:

 

opts(axis.text.x = theme_text(size = 16), axis.text.y = theme_text(size = 16),

        axis.title.x = theme_text(size = 16), axis.title.y = theme_text(size = 16, angle = 90)

 

 

Steve

(860) 441-3435

--
--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: https://github.com/hadley/devtools/wiki/Reproducibility
 
To post: email ggp...@googlegroups.com
To unsubscribe: email ggplot2+u...@googlegroups.com
More options: http://groups.google.com/group/ggplot2
 
---
You received this message because you are subscribed to the Google Groups "ggplot2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ggplot2+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Dennis Murphy

unread,
Mar 21, 2013, 1:30:35 PM3/21/13
to Riley, Steve, Martí Casals, ggp...@googlegroups.com
In versions of ggplot2 >= 0.9.2, opts() is deprecated and replaced by
theme(). In a similar vein, theme_*() is replaced by element_*(), so
the following should work for more recent versions:

theme(axis.text = element_text(size = 16),
axis.title = element_text(size = 16),
axis.title.y = element_text(angle = 90))

The above is an abridged version of the previously offered solution
because the new theming system supports inheritance of properties of
theme elements. Thus, changes to axis.text propagate to axis.text.x
and axis.text.y, for example.

Dennis

Martí Casals

unread,
Mar 22, 2013, 3:47:56 PM3/22/13
to Dennis Murphy, Riley, Steve, ggp...@googlegroups.com
Thank you so much for your suggestion, but I still can't see the labels on the top and on the right clearly when I compile de .tex to LaTex. I attach the new document that I see.

Do you have other suggestion?

Thanks again.

Martí

2013/3/21 Dennis Murphy <djm...@gmail.com>
example.docx
Reply all
Reply to author
Forward
0 new messages