Group: http://groups.google.com/group/ggplot2/topics
- Automagic line breaks in graph annotation? Version 0.9.2 [2 Updates]
- Plots of backtransformed data [1 Update]
- Independent control over axis lines in 0.9.2 [3 Updates]
- plot.background doesn't work in 0.9.2 [1 Update]
Winston Chang <winsto...@gmail.com> Sep 06 09:19PM -0500
It's definitely not possible anymore to do what the theme_title()
function does, which is to return a function that returns a text grob.
In the old theme system, a theme was a list of functions that returned
grobs. In the new theme system, a themes is a list of lists of
properties.
I haven't tried it, but I think you'd have to run splitString() on the
original title text, and then use that returned text as the title. For
example:
title <- "Marker1 : Similar to AAA80501.1 Lycopersicon esculentum;
unknown; Solanum lycopersicum unknown oxidase-like protein mRNA,
complete cds; similar to hyoscyamine 6beta-hydroxylase: SwissProt
Accession Number P24397, flavavone-3-hydroxylase: PIR Accession Number
S36233, and ethylene forming enzyme: encoded by GenBank Accession
number M90294 ;cl209ct403cn544 ;COMPLETE ;RESISTANCE(6), FLOWER(71),
FRUIT(7)"
newtitle <- splitString(title, unit(10, "cm"))
qplot(1:10, 1:10) + ggtitle(newtitle)
-Winston
igreg <zoor...@gmx.net> Sep 07 05:20AM -0700
Winston, Dennis & Brandon! Thanks a lot! :-)
greg
kirsty <nashk...@gmail.com> Sep 06 09:28PM -0700
Thank you Dennis,
Very happy with the plots!
Cheers
Kirsty
On Thursday, September 6, 2012 5:19:32 PM UTC+10, Dennis Murphy wrote:
Sandy Muspratt <sandy.m...@optusnet.com.au> Sep 06 04:15PM -0700
Hi Dennis,
Thank you so much for you reply. You code works, but only if one axis line
is to be modified and the other is to be removed.
But what if I want to modify both axis lines: x-axis line coloured red and
y-axis line coloured blue. It seems I can't do that.
Version 0.9.2 gives me independent control over other x and y elements. For
instance I can independently modify the tick marks:
baseplot + theme(axis.ticks.x = element_line(colour = "red", size =
2),
axis.ticks.y = element_line(colour = "blue", size =
2))
Or I can independently modify the grid lines:
baseplot + theme(panel.grid.major.x = element_line(colour = "red",
size = 1),
panel.grid.major.y = element_line(colour = "blue",
size = 1))
But it seems the same style of code will not work to independently modify
the axis lines:
baseplot + theme(axis.line.x = element_line(colour = "red", size = 1),
axis.line.y = element_line(colour = "blue", size =
1))
Is there a way to apply different modifications to the axis lines?
Thanks
Sandy
Winston Chang <winsto...@gmail.com> Sep 06 10:15PM -0500
This is one area where the theme inheritance combined with the default
theme isn't an improvement on the old system...
The problem is that in the default theme_grey(), axis.line is set to
element_blank(), and the two elements that inherit from axis.line,
axis.line.x and axis.line.y, inherit the blank element. Perhaps it
would be a little easier the default for axis.line was this:
theme(axis.line = element_line(colour=NA))
At any rate, this should do the trick - you just need to set axis.line
to something that's not element_blank():
qplot(1:3, 1:3) +
theme(axis.line = element_line(),
axis.line.x = element_line(colour = "red", size = 1),
axis.line.y = element_line(colour = "blue", size = 1))
-Winston
On Thu, Sep 6, 2012 at 6:15 PM, Sandy Muspratt
Sandy Muspratt <sandy.m...@optusnet.com.au> Sep 06 09:17PM -0700
Hi Winston,
Thanks for the reply. I think I understand now. Also, I think the theme
inheritance is a big improvement on the old system. In the old system, we
had to use the grid package to get this sort of independent control over a
few of the x and y elements. So I'm saying "Thank you, thank you, thank
you".
Sandy
Tengfei Yin <yinte...@gmail.com> Sep 06 10:53AM -0500
Hi Winston,
Thanks a lot! It works after I updated to the latest version of ggplot2
0.9.2 on CRAN.
cheers
Tengfei
--
Tengfei Yin
MCDB PhD student
1620 Howe Hall, 2274,
Iowa State University
Ames, IA,50011-2274
You received this message because you are subscribed to the Google Group ggplot2.
--
You can post via email.
To unsubscribe from this group, send an empty message.
For more options, visit this group.
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