Displaying 20 results from an estimated 10000 matches similar to: "Lattice: choice of symbol and symbol position in legend"
2011 Jan 25
1
lattice draw.key(): position of key in panels
Good afternoon,
I am working on a plot that requires custom legends to be placed in some
panels of the plot; other panels do not contain legends. The problem
that I run into is positioning of the legend in individual panels. In
particular, the 'x' and 'y' elements of the key-list are ignored by
draw.key() when it is called from inside a panel function. As a result,
the legend is
2011 Aug 11
1
legend position in interaction.plot
How do I move the legend from default position (right and within the plot)?to the "bottomleft" of the plot?
?
interaction.plot(YEAR, ID?GROWTH, legend=TRUE, col = 2:7,xlab="Year",
?????? ylim=c(0,2), ylab="Growth",leg.bty = "o")
Peter Maclean
Department of Economics
UDSM
2009 May 10
1
ggplot2: recommended workaround for broken legend.position="top"
Searching the mail archives I found that using legend.position as in
p.ring.3 + opts(legend.position="top")
is a known bug. I tried doing
p.ring.3 + opts(legend.position=c(0.8, 0.2))
which works, but the legend background is transparent, i.e. I see the
plot background through the legend. Adding additional option
opts(legend.background=theme_rect(fill=TRUE,colour="white"))
2009 Nov 02
1
Lattice: Saving Plots with Legend
Dear R Users!
I've want to save a lattice "parallel" plot with legend as png:
Plotting with legend works well, but when trying to save the plot there occurs a problem with the legend.
###################################################
require(lattice)
#Some data:
data<-matrix(rnorm(100),ncol=5)
#Plot works
parallel(data)
2005 Jun 09
4
position of a legend-object
Hello,
I've written a function that plots a few functions in a diagram.
The xlim and or ylim is not always the same, and set automatically by R.
A legend is part of this object.
Now the problem is: where to put the legend? Me would help a function that
returns the limits and scaling of the axis.
Thanks for your help.
Carsten
[[alternative HTML version deleted]]
2006 Aug 24
1
Lattice symbol size and legend margins
Hi:
I am using the following command:
xyplot(dat6$CO3*1e6 ~ dat6$irradiance, data=dat6, group=ref,
xlab=list(label=expression(paste("Irradiance (", mu, "mol photons",
m^"-2", " ", s^"-1", ")")), cex=1.3),
ylab=list(label=expression(paste("Carbonate concentration (x ", 10^"6",
" ", kg^"-1",
2008 Dec 05
1
Legend and Main Title positioning
Hi folks,
can anybody give me a hint how to solve the following problem?
I have several plots in one window like this:
layout(matrix(c(1,2,3,4), nrow = 2, byrow = TRUE))
plot(rnorm(100))
plot(rnorm(200))
plot(rnorm(300))
plot(rnorm(400))
Now, I'd like to create a legend below each plot and generate a common title.
How can I do that?
Antje
2009 May 06
1
Positioning a legend via X and Y coordinates
Dear R Users,
I'm able to display a legend using the following code:
> legend("topright", c("Simulation", "Observation"), fill=2:3, bty="n")
However, this causes the legend to be positioned too close to the bars in my barplot. I'd like to move the legend up slightly. I have been trying to determine the necessary values by trial and error to do
2009 Jan 14
4
How to get legend outside of plot?
I am creating a CDF plot function more user-friendly than any default r
function. Depending upon the bimodality of the data (it is often bimodal),
or any other strange data trends, the points can end up gathering in just
about any corner of the plot. So, when I add a legend, whether I choose to
add it in the bottom right, top left, or wherever, it will sometimes end up
putting the legend right
2009 Jun 26
3
Automatically placing a legend in an area with the most white space...
At one point I believe I heard of an R package that would automatically find the most empty space in a plot, and then that answer could then be used to intelligently place a legend.
I would like to try to apply that R package to the contrived example shown below, so thank you for any hints or tips that can be provided.
x = seq(0, 1000, by = 1)
y1_vals<-rnorm(1000, mean = 0, sd = 50)
2002 Nov 12
4
trouble positioning legends on barplot written to a file
I'm trying to generate some plots for print publication and I'm having trouble
getting them the way I want. I get a plot with a legend that overlaps the bars
and looks bad. Also, I'm saving this as PDF file (whatever happened to the
"png" function to save as PNG format, in r 1.4.1?)
I've tried a number of things, which produce a number of questions.
1) it seems that the
2005 Jun 30
1
FW: plot legend outside the grid
-----Original Message-----
From: Ghosh, Sandeep
Sent: Thursday, June 30, 2005 5:43 PM
To: 'Berton Gunter'
Subject: plot legend outside the grid
Thanks for the pointers... I managed to get everything to look and feel the way I want except for the legend to plot outside the grid... Thanks for the note on the par, but I'm not able to it to plot outside the plot grid..
dataFrame <-
2008 Sep 24
2
lattice xyplot symbols instead of colors and legend matching plot symbols or colors
I would like to use the data below where the plots are close to what I
want. Instead of color I would like to use different symbols, and
have the symbols in the legend match the graphs. I am also going to
add a regression line to these I know about the type="r" (which is
fine for these particular graphs) argument, but it fits the subsets
instead of the entire data set-- should I use a
2001 Sep 25
2
pairs() Legend
Hi,
Is it possible to create a legend in a pairs() plot?
For example, suppose I have the following R codes:
data(iris)
pairs(iris[1:4], main = "Anderson's Iris Data -- 3 species",
pch = 21, bg = c("red", "green3", "blue")[codes(iris$Species)])
How can I created a legend that shows which colour represents to which
Iris species?
Thanks,
2012 Jul 30
1
lattice legen and auto.key conflict
Hello R-helpers,
I'm trying to customize a graphic in lattice using the 'legend' argument to add labels on my plot but in the process I'm losing the legend drawn by 'auto.key', despite the fact that I'm actually not sticking these on the same sides of the graphic. I worked up a quick and simple example with the iris data :
### here's the basic graph
2006 Oct 13
3
Barplot legend position
Dear useRs,
I'm trying to create a barplot like so:
x=matrix(1:10,2,5)
barplot(x,leg=c("left","right"),besid=T)
The legend is placed in default position topright, however the data are
plotted there too. I tried controlling the legend position by adding
x="topleft" but this results in an error that x matches multiple formal
arguments.
Leaving out the legend
2011 Jul 18
2
line jump in plot legend title
Hello,
In order to reduce the width of my legend in a plot I introduced line jumps in the title. Here's the problem; the legend box hasn't adapted accordingly and part of the title is printed out of the frame.
See the example below:
plot(1:10)
legend("bottomright", bg="white", fill=c(7,8,12,13,19),
2009 May 04
4
Producing a legend successfullly
Dear all,
I'm attempting to insert a legend into a line graph. I've sorted out the positioning, but I'm unable to display the sample line and associated colour to go within the legend box. Instead, under the variable names, the numbers 1, 2, 2, 3 are displayed in a column (with '2' repeated twice). This is the code I'm using:
legend(80,1150, c("Simulation",
2009 Oct 12
1
Position of legend box
Good morning to you. I have about 4 different lines in one plot. I have used
legend to indicate the colour of each plot. But the box contain the legend
covers part of the lines thereby blurring the legend. There are some spaces
in the plot that are empty and large enough to accommodate the legend box.
If there a command I could use to set the position of the legend myself.
I added the legend
2005 Mar 17
1
Legend positioning in scaled survival plot
I am sorry that this is another novice question. I am having trouble
using "legend" with the survival curve plot from the survival package,
and I wonder if it is because I have rescaled my plot.
Here is the relevant segment of code:
> plot(survfit(Surv(OS,Status)~shortishcr1),main='Overall Survival by
factor',
+ xlab='Years',ylab='%