similar to: Plotting legend outside of plot region

Displaying 20 results from an estimated 10000 matches similar to: "Plotting legend outside of plot region"

2005 Apr 30
1
legend(): how to put variable in subscript?
Dear List, I would like to plot a simple legend with two math expressions, e.g. plot(0) legend(1, 0.5, expression(sigma[i], sigma[j])) The difficulty is that i and j should be variables rather than strings "i" and "j". In other words I'd like to do something like: i = "A" j = "B" legend(1, 0.5, expression(sigma[i], sigma[j])) and have "A"
2002 Aug 27
1
legend() outside plotting region
Hi, Is it possible to put the legend outside the plotting region? Say, I have some 24 lines within my plot, which pretty much filled the plotting region and left me no space (well not enough space) to put in a legend. So I'd like to put the legend outside the plotting region (i.e. the region enclosed by the two axis -- I hope I got my terminology right). Actually, I did the 24 lines with
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
2004 Oct 26
1
putting legend outside ploting region
Hello! I have created a plot and would like to put a legend in the top left corner (above and left of plotting region), but non of the functions can plot there (I tried 'legend', 'text', 'points', 'lines', 'mtext', 'axes',...). I would be very grateful if someone could help me put something in that corrner, with any fuction. Thanks, Ales Ziberna
2000 Mar 26
2
hist2d() function in R?
Dear R users, I am just starting with R (v. 1.0.0) and I use Vehables & Ripley's MASS book for examples. In the intro session, there is an example of a 2D histogram on an 8x8 grid: x <- rnorm(1000) y <- rnorm(1000) contour(hist2d(x,y,,,8,8)) R complains: Error in contour(hist2d(x, y, , , 8, 8)) : couldn't find function "hist2d" I looked for hist2d() in the
2000 Oct 10
1
Adding a new column to data frame (recoding)
Dear R users, I have a very simple question. What is the easiest way to recode data in one of the columns of a data frame and put it into a new column? For example, here is a simple data frame: var1 1 1 2 2 3 3 How do I add a new column to data - 'var2' in which I group values in 'var1', for example: var1 var2 1 1 4 2 2 4 3 3 5 It's got to
2000 Jun 13
3
Question on closure (lexical scoping) and encapsulation
Dear R users, I have two related questions about scoping and data encapsulation. One is fairly specific - I am looking at "scoping.R" which is used in demo(scoping) - it's an example of lexical scoping and encapsulation. Where is the 'total' stored? It is not an attribute in 'ross' or 'robert' however, functions like balance() have access to it. Is it more
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',
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 <-
2000 Dec 14
1
How do I track a segfault?
Dear R users, I have to catch a nasty bug and would appreciate any advice or help! I get a segfault (core dumped) that happens in one of my own functions. The problem is, it does not happen most of the time, only sometimes, so it's very hard to reproduce. Or it may run ok in interactive mode, but bug out in batch mode. Also, it tends to happen more on the slower of my 2 machines (PII 266),
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
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
2003 Nov 11
2
Test for new page
Dear R experts, I am writing a multi-page PDF file and would like to put a header on each page. Is there a way to test a graphic device to see if a new page is started (so that I know when to write the header)? I could simply count the plots made (each page has the same number of plots), but wanted to see if a more general solution is available. Thank you, Aleksey -- Aleksey Naumov GIS
2003 Jun 22
1
Using weighted.mean() in aggregate()
Dear R users, I have a question on using weighted.mean() while aggregating a data frame. I have a data frame with columns Sub, Length and Slope: > x[1:5,] Sub Length Slope 1 2 351.547 0.0025284969 2 2 343.738 0.0025859390 3 1 696.659 0.0015948968 4 2 5442.338 0.0026132544 5 1 209.483 0.0005304225 and I would like to calculate the weighted.mean of Slope, using Length
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
2007 May 22
4
Legend outside plotting area
Hi, I have been trying many of the suggested options to place a legend outside plotting area, including something like this: par(xpd=T, oma=par()$oma+c(4.5,0,1.5,0),mar=par()$mar+c(1,0,1,0) But the aspect of the four plots gets compromised when I change the margin settings. I cannot use mtext because I need to use colors for the text. I tried layout, but wouldn't let me include
2006 Jul 12
1
legend outside plotting area
Hi, I would like to place a legend outside a plotting area. Could anybody give me a hint how this is done? Cheers, Georg
2007 Sep 08
1
ggplot legend consolidation
Hello Everyone, I have recently been introduced to the ggplot package by Hadley Wickham and must say I am quite impressed so far at how easy it is to make attractive plots, but one thing I am struggling over is how to consolidate legends. I have 3 plots that I would like to put on a single page and all 3 map the same dimension of the data to the colour aesthetic. Right now, when I plot all
2012 Feb 16
2
Legend vanishes when placed outside the graph
Hello everyone, i’ve got a problem with my diagram’s legend. I know i should be able to figure it out by reading the ‘plot’ and ‘legend’ reference. However nothing works so it would be kind if anyone could point me to the necessary parameters. The problem is that i’m moving the legend using the ‘inset’-parameter so it does not overlap with the graph. However it vanishes outside the graph, so
2012 Sep 09
1
PCA legend outside of PCA plot
Hi All, I have been trying to get to plot my PCA legend outside of the PCA plot, but success still alludes me. Can you guys please advise how I can achieve this. I used locater() to obtain coordinates for below the Comp.1 axis. Using these coordinates the legend disappears. Below is the code for the PCA and legend. Thanks in advance for the help. Regards Tinus r.cols <-