Displaying 7 results from an estimated 7 matches for "mergedtrellislegendgrob".
2011 Sep 01
1
Background fill and border for a legend in dotplot
...usments. I would like to be able to put a border and background
fill around the legend in this plot.
I understand the legend 'bty' should do this have this capablity but not
sure how the syntax works in this case
###### initalise
library("lattice")
library(latticeExtra) # for mergedTrellisLegendGrob()
##read the data to a variable
#----------------------------------------------------------------------------------------
Cal_dat <- read.table("Calibration2.dat",header = TRUE,sep = "\t",)
## set up plotting colours
#-------------------------------------------------------...
2010 Oct 26
1
lattice key subtitle
Hello everybody,
Is there a way to add a subtitle to a lattice key?
It is important form me that the subtitle must be linked to the key
because those graphs are produced on a daily temporal scale,
and the numbers of rectangles from the key may be different from day to
day.
Thank you,
Alexandru Dumitrescu
[[alternative HTML version deleted]]
2011 Sep 15
1
Colour code y-axis labels on a dot plot
Dear R helpers
I would like to be able to colour code the y-axis labels on a complex dot
plot by a variable known as company (of which there are only two). The code
is below and data attached.
Thanks
MarkM
library("lattice")
library(latticeExtra) # for mergedTrellisLegendGrob()
# set size of the window
windows(height=10, width=7,rescale=c("fixed"))
##read the data to a variable
#----------------------------------------------------------------------------------------
Cal_dat <- read.table("Calibration2.dat",header = TRUE,sep = "\t",)...
2010 Aug 22
0
lattice::xyplot() with one factor for points and another for lines - solution
...0.8)
mykey2 <- list(title = 'Group 2',
cex.title = 1.2,
text = list(levels(d$gp2)),
lines = list(lty = 1, col = c('blue', 'orange')))
# Create a grob by merging the two keys - from latticeExtra (Felix Andrews)
mylegend <-
mergedTrellisLegendGrob(list(fun = draw.key, args = list(key = mykey1)),
list(fun = draw.key, args = list(key = mykey2)),
vertical = TRUE)
# Generate the plot:
with(d,
xyplot(val ~ time,
pch = mypch, col = mycol,
lty = 1, col.line = c('bl...
2011 Sep 10
0
Mutiple vertical reference lines with a dotplot
...e
years automatically using a function rather than computing and plotting
manually. The next challange will be to get these mean lines in the legend
as well!
Thanks in advance for any pointers
MarkM
(current code below and data attached)
library("lattice")
library(latticeExtra) # for mergedTrellisLegendGrob()
##read the data to a variable
#----------------------------------------------------------------------------------------
Cal_dat <- read.table("Calibration2.dat",header = TRUE,sep = "\t",)
## set up plotting colours
#-------------------------------------------------------...
2011 Aug 25
1
Sorting order of reorder with multiple variables
...like to control the sorting
by the 2010 Year values.
Any assistance greatly appreciated (Data file is attached)
(out of interst this code also has a very neat solution for plotting two
different keys - code by Deepayan Sarkar)
## initalise
library("lattice")
library(latticeExtra) # for mergedTrellisLegendGrob()
##read the data to a variable
Cal_dat <- read.table("Calibration2.dat",header = TRUE,sep = "\t",)
## set up plotting colours
col.pat<-c("violet","cyan","green","red","blue","black","yellow")
sym.pat...
2012 Jun 16
2
Adding title to colorkey
A recent paper on visualisation (in Neuron, a leading neuroscience
journal) surveyed how well previous articles in this journal labelled their
graphs (e.g. axis labelling and describing their error bars). Of
particular interest is that (only) 40% of plots labelled what their
colorkey was showing (variable and units).
The paper is at http://dx.doi.org/10.1016/j.neuron.2012.05.001
R is not yet