similar to: Legend problems

Displaying 20 results from an estimated 10000 matches similar to: "Legend problems"

2001 May 04
1
image legend
I am trying to place a legend onto an image but the legend to clipped/nonexitent outside the boundary of the image. I am wanting to place the legend where the main title normally would appear. I would appreciate someone telling me why I cannot do this. (Which part of the help file I haven't read most likely) Regards Ross Darnell
2012 Aug 15
1
legend position help
Hi there, I draw a multiple figure in one plot, like the following: par(mfcol=c(1,5),mar=c(4,4,0,0)+0.2, oma=c(0,0,3,0)) plot(1:10, type = "b") plot(1:10, type = "b") plot(1:10, type = "b") plot(1:10, type = "b") plot(1:10, type = "b") Now, I hope to plot the legend like the following: legend("top", legend=c("Example"), pch
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 Feb 18
1
Plotting a legend outside the figure - units
Dear R gurus, I am trying to plot a legend in the margins of a figure. The basic idea is to have two (or more) plots on the same figure, but then to have a common legend at the bottom of the plot. The approach that I have taken is to setup the figures, then do a "dummy" plot of the legend to determine the height of the legend box (ie from the value returned by the legend() command). I
2012 May 09
1
barplot: legend: two rows
dear r-helpers, i have got another question: i am using the functions par(xpd=T) legend to create a legend below the x-axis. i used the parameter horiz=T. now i would like to put the elements of the legend in two rows: e.g. if my legend has got 5 elements, i would like 3 elements in one row and the last two elements in the next row. does anyone know how to do that? thank you very much for
2008 Dec 22
0
Align legend title
Dear R developers, I needed to align the title of legend for some of my plots. If there is interest to include this into base R, bellow are the examples and the relevent diffs. Regards, Gregor x <- 1:10 y1 <- 1.5 * x y2 <- 2.0 * x y <- cbind(y1, y2) source(file=url("http://gregor.gorjanc.googlepages.com/legend.R")) matplot(x, y, type="l", lty=c(1, 2)) ##
2010 Aug 30
3
Putting legend *outside* plotting area
Is there a simple way to put a legend outside the plot area for a simple plot? I found... (at http://www.harding.edu/fmccown/R/) # Expand right side of clipping rect to make room for the legend *par(xpd=T, mar=par()$mar+c(0,0,0,4))* # Graph autos (transposing the matrix) using heat colors, # put 10% of the space between each bar, and make labels # smaller with horizontal y-axis labels
2010 Sep 01
2
Legend with fill = gray ?
Hi, I am facing a problem with the legend, I don?t know how to use the fill option in the legend in order to achieve the same standard gray levels that are plotted. Sorry for this easy one, but I really did not find anything so far. It works fine with color: ###### C O L O R mat <- matrix(2,3,rep(2,6)) rownames(mat)<-c("A","B","C") par(xpd=T,
2023 Mar 04
1
legend: interplay between title and y.intersp
Set the legend position explicitly with x and y values and add xpd = TRUE to the legend call to clip the plot to the figure region and not the plot region (the default). Something like this (you may have to fool around with y.intersp, etc. to allow enough space between the legend lines): plot(c(0,1), c(0,1), type="n") legend(x = .4, y = 1.25, legend=c("", "",
2010 Jan 20
2
legend in multiple plot
Dear R users, I'm making multiple plots within the same pdf page (par(mfcol = c(5,1)), and want a legend for this at the bottom of all the plots. From previous mails it has been suggested to use par(xpd=TRUE), increase the margin at the last plot, and then draw the legend. However, when I do this, the last plot gets smaller with the same amount I increase the margin with. The problem seems to
2011 Feb 06
2
Legend outside the plot? xpd?
Hi All, BG: Will try be brief. I'd like 3 graphs on a page (below each other mfrow=c(3,1)), saved to pdf. The three plot data on the same subject so I'm having one legend, to the right of the center graph. I'm using mar=c(5,15,4,15) to bring the sides in so that the graphs are square and not stretched wide. To have the graph to the side I'm thinking xpd=T. Each graph has a number
2006 Apr 10
2
Legend in the outer margin
Dear Rs I have a 3x3 multiple plot. I would like to have a overall legend in the outer right margin. From the help archive, I found that it can be done by setting par(xpd=NA). However, I couldn't find the correct values for x and y co-ordinates for the legend. Please find the code snippet below: par(mfrow=c(3,3), mar=c(4,4,0.9,0.5), oma=c(1,2,2,4),cex.main=1.1)
2023 Mar 06
1
legend: interplay between title and y.intersp
Hi, I think you are right, legend cannot do it. I have now created my own legend function where I changed only one line and now it works the way I want it to. But I'm not sure if that might not have other side effects. I have the impression that the legend and the title start at the same y-position (try y.intersp=0). Only if y.intersp is big enough, then it leads to a non-overlap of
2008 Jul 02
2
position legend below x-axis title
Dear helpers, I'm using a R script on several different datasets, which makes that axis scales may vary quite a lot from dataset to dataset. So what I'm looking for now, is how to automagically find out how to position the legend (horizontal) in the space below the x-axis title, and how to make sure that the legend is within the limits of the lower inner or outer margin? I'm aware of
2008 Nov 07
0
barplot can put legend in wrong place, request option to override that (PR#13265)
This in an enhancement requestion, to add the capability to pass arguments through barplot() to legend(). I've created a version that does this. # Run this code; notice that the legend # is superposed over one bar: barplot(height = cbind(x = c(465,91) / 465 * 100, y = c(840,200) / 840 * 100, z = c(37,17) / 37 * 100), beside = FALSE, width =
2009 Nov 30
1
Plotting color.legend() outside of plot region
Dear List, I am trying to plot a color.legend() in the right outer margin of my device region. I have read multiple threads on the subject and still can't get it right. I have stolen an example from one of the threads to demonstrate my problem. I have extended the outer margin using par(oma()), and have used par(xpd=NA) to tell it to plot in the device region. I can get the legend to plot
2010 May 03
2
Plotting legend outside of multiple panels
Hello, I have used layout() to produce to 2 plots on a page, leaving a plotting space above them. I would like "Legend", which will actually be a real legend, to be centered above the two graphs. Right now I am only able to position "Legend" above the second graph that I create... obviously I am stuck in its margin space. Is there a way to draw the legend in the empty
2010 Apr 22
2
legend problem
Dear R users, I have been plotting several graphics in only one page. I intend to plot only one legend in each page. Since the graphics are inside a loop I have to do it automatically. The main problem is that inside the loop I work with differente types of variables, I mean , the range is different for each one. I have already tried : par(xpd=TRUE) pos<-par("usr")
2005 Jul 05
0
plot legend outside the grid
Thanks Bert for all the help. I got the legend figured out Friday but left early becoz of long weekend so didn't get a chance to reply.. I modified the plot margins a little bit and Here's what I finally had... par(mar=c(c(10, 6, 6, 10) + 0.1)); par(xpd=FALSE); with (dataFrame, stripchart(marbles_buried ~ genotype, method="jitter", vertical=TRUE, col = c('blue',
2010 Oct 18
0
Question about legend parameters
Hello! The code below works - if you run it you'll see a stacked area chart generated based on the data example. I only have one understanding question about the legend location (the very last snippet of code): legend(par()$usr[2], mean(par()$usr[3:4]), rev(order.of.vars), xpd=T, bty="n", pch=15, col=all.colors[rev(order.of.colors)]) I see that par()$usr[2] = 14763.72