Displaying 20 results from an estimated 10000 matches similar to: "Add a legend to a pairs plot??"
2012 Apr 06
4
Legend based on levels of a variable
I have a bivariate plot of axis2 against axis1 (data below). I would like
to use different size, type and color for points in the plot for the point
coming from different region. For some reasons, I cannot get it done. Below
is my code.
col <- rep(c("blue", "red", "darkgreen"), c(16, 16, 16))
## Choose different size of points
cex <- rep(c(1, 1.2, 1), c(16, 16,
2004 Apr 16
7
Turning windows screen buffering on and off
All, 
Does anyone know if there is an option I can set to turn screen-buffered
output on and off with the win32 rgui? (Apart from the point and click
method). 
I am running some simulations where it is useful to watch output but it
gets mildly tiresome having to manually switch things on and off via the
gui. 
Thanks 
Toby. 
> version
         _              
platform i386-pc-mingw32
arch  
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,
2001 Jul 30
1
legend on a lattice (developmental package) plot
Is there a way to put a legend on an xyplot -- eg, something akin to the
key function? Or, is there a way to get the R legend function to work on a
lattice plot? 
To the people who have done the work on lattice and grid: Thanks for making
lattice. I'm finding it very useful.
Anne
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Anne E. York
National Marine Mammal Laboratory
Seattle WA 98115-0070  USA
2011 Jul 25
1
Creating png of layered legend
I am trying to create a plot that has multiple plot characters for
each point (e.g. a point within a triangle, a triangle within a
square, etc). The workaround I have found to do this is by plotting
twice, as in this example:
x <- c(1.1, 2.3, 4.6)
y <- c(2.0, 1.6, 3.2)
plot(x, y)
points(x,y, pch=20, col="red", cex=0.5)
This works, but perhaps there is a better way to do it in one
2003 Aug 25
1
ODBC Oracle access
Hi all, 
I'm having trouble connecting to an oracle database using RODBC under
winXP. Unfortunately I can't really send a reproducable error as the
initial call to odbcConnect seems to hangs R and I have to kill the
session. 
I have been using RODBC to sucessfully connect to an MS Access DB that
has tables linked through to the oracle database in question and that
seems to work OK but it
2002 Dec 13
2
xyplot {lattice} bug causes crash (PR#2370)
Full_Name: Toby Patterson
Version: 1.6.0
OS: winXP
Submission from: (NULL) (140.79.2.3)
I seem to be able to cause a predictable crash (i.e. the application terminates
abnormally) in R using the library lattice. If I have 
x<-cbind(1:10,c(rep(1,7),rep(2,3)),rnorm(10))
library(lattice)
xyplot(x[,1]~x[,3]|x[,2]) 
 
# works oK but reversing the ylim entries i.e. 
2004 Sep 14
2
R CMD SHLIB setup problem...
All, 
When I try and compile a shared library (on WinXP) I get the following
error:  
E:\data\proj>R CMD SHLIB toy_dll.c
Makevars:1: *** missing separator.  Stop.
Has someone else had this error and fixed it? 
This code compiles and works fine on Linux (fedora core 2). Everything
was working fine under R1.8.1 but I've broken something when I upgraded
to R1.9.1. 
So I am assuming
2003 Feb 03
2
plot.gam for glm objects.
All, 
I was wondering if someone had come across the problem of producing partial
regression plots for glm objects in R? 
When using Splus in the past I have passed glm objects to the plot.gam
function. 
To my knowledge this functionality isn't included in R ( I would be happily
corrected here) and if someone had some code floating around to do this it
would save me re-inventing wheels etc. 
2010 Mar 12
3
how to plot only the upper triangle using the pairs function?
Hi,
I am trying to use function pairs to plot the scatterplot, but I only want
to keep the upper triangle, what's the argument to do this?
Thanks,
-Jack
	[[alternative HTML version deleted]]
2004 Sep 17
1
pairs plot and legend
I would like to add a legend to a pairs plot.  Is there a simple way to 
do this?  Just doing legend(.....) doesn't seem to get it.
Thanks,
Sean
2004 Aug 10
1
date axes and formats in levelplot
Hi all (and particularly Deepayan), 
A while back Deepayan helped me with the query in the text below (thanks
again). Specifically it was about changing the way that dates plotted on
the axes of lattice plots. 
While this works using xyplot, everything comes apart when I use
levelplot. The axis labels on the date axis are shown as the integer
representation of the date (number of seconds since
2006 Oct 26
2
distance between legend title and legend box
Hi,
I've looked at the parameters available for the legend function and  
cannot find a way to change the distance between the top of the box  
surrounding a legend and the legend's title. I have a math expression  
that raises the height of my title.
If you don't mind the non-sensical title I give to the legend for  
this plot (Figure 3.20 in R Graphics):
with(iris,
      
2007 Aug 28
2
Limiting size of pairs plots
Dear R-users,
I would like to add a legend at the bottom of pairs plots (it's my first 
use of this function). With the plot function, I usually add some 
additional space at the bottom when I define the size of the graphical 
device (using mar); grid functions then allows me to draw my legend as I 
want.
Unfortunatley, this technique does not seem to work with the pairs 
function as the
1998 Feb 20
1
R-beta: legend
Does the "legend" command work in the windows version of R? Here is 
the command that I'm using:
legend(1,1,legend=c("G1","G2","G3","G4","G5","G6"),pch=array(1:6,dim=c
(1,6)))
When I use this on my existing graph in a window I get a solid black 
box at the lower left. If I use this with the postscript driver my 
output
2001 Jul 26
2
Fancy pairs(), scatterplot matrix?
(I have checked the 2000 &2001 archives)
Awhile ago, someone posted a function to plot a scatterplot matrix with the
upper triangle containing plots (and maybe fitted curves?) and the lower
triangle containing the correlation coefs. I have lost that code and would
love it again if anyone has it. Thanks,
Henry
*****************************
Martin Henry H. Stevens
HStevens at muohio.edu
tel:
2011 Jul 26
2
Lattice: choice of symbol and symbol position in legend
I am making final adjustments to a multi-plot figure using basic and lattice.
In the lattice plot, I would like to include a legend that matches the
format of the legends in the other plots, which consist of appropriately
colored squares (pch 22) followed by text. In lattice, I was able to get a
legend using 
auto.key = list(x = .6, y = .6, corner = c(0, 0), pch=22)
but my request for pch=22 was
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)
2004 Sep 20
1
findInterval in compiled code.
Hi all, 
I am writing some C code where I want to use the findInterval function
documented in "Writing R extensions/Utility functions". i.e. the
C-version not the R version.
It all compiles but the shared library is causing seg-faults and I'm
obviously stuffing something up. 
Has anyone got any examples of calling this function they'd be will to
share? I've searched through
2004 Jul 05
1
date Axes and formats in lattice plots
All,
I have some data of animal movements that I'm plotting using xyplot() from lattice. I want to have the date (class POSIXct object) on the Y-axis and the animals longitude on X-axis.
Eg. 
xyplot(date ~ longitude, groups = animal, data = my.data) 
with data like:
     animal   ptt year month day    lon                date
125 03P0014 13273 2003     7  10 150.38 2003-07-10 14:03:48
126