Displaying 20 results from an estimated 2000 matches similar to: "Adding axis lines to splom plots"
2010 Sep 30
2
panel.pairs in splom
Hello,
I have a customized pairs () fonction as follows that displays correctely my
data.
------------------------------------------------------------------------
panel.cor1 <- function (x, y, digits=2, prefix="")
{
usr <- par("usr"); on.exit(par(usr))
par(usr = c(0, 1, 0, 1))
r <- cor(x, y,use="pairwise.complete.obs",
2008 Sep 21
1
How to put given values in lower triangle of splom-plot?
Dear R-experts,
I have found a splom-modification online which is given below. This
works perfectly, but I would like to have a matrix of given
correlation values to be used in the lower triangular part
(lower.panel) of the splom-plot instead of calculated correlation
values. Here is the matrix I would like to use (it can be any other
convenient data structure):
2007 Aug 01
1
Splom custom superpanels
I thought one nice addition to a splom figure would be to have the
scatterplots in the upper triangle and a color-coordinated
correlation matrix on the bottom. So I tried my hand at customizing
panel.pairs(), and was rebuffed. Many times. Four hours of
fruitless debugging later, I turn to you for help:
panel.pairs(z=teststatfull[,6:12], pscales=0,
panel.subscripts=FALSE, subscripts=,
2003 Mar 08
1
FIX: pscales=list(...) and splom
Dear R Users,
When plotting with "splom" I tried to use the pscales=list(...) feature
Unfortunately it didn't work at all. Instead the scales always were
suppressed.
So I looked at the source of panel.pairs and found:
"draw <- is.numeric(pscales) && pscales != 0"
which rather has to be:
"draw <- is.list(pscales) || (is.numeric(pscales) &&
2007 Feb 09
1
How to add the variable name to a qqplot or densityplot in the diagonal of an splom?
splom() doesn't complain here, but writes no names in the diagonal
boxes. What am I missing?
I believe that I need to add something like grid.text(x, ...) to the
diagonal panel, but I don't know how to get it cycle through the
column labels. And should
varname.col = 'blue', varname.cex = 1
be inside the diag.panel() function?
splom(szw[, n], pscales = 0,
diag.panel
2010 Jan 15
1
Lattice: How to color the data points in splom() according to the panel they are plotted?
Dear ExpeRts,
I have the scatter plot matrix as given below. I would like the different "sub-plots" in the scatter plot matrix to be colored differently. How do I get all points shown in the upper-left plot (on position (1,1) in the scatter plot matrix) to be plotted in blue, and the points shown in the plot to the right (on position (1,2) in the scatter plot matrix) to be plotted in
2012 Nov 19
2
lattice: defining grouping variable only for the upper/lower panel with splom
Using the mtcars dataset, how to define the grouping variable to be valid
only for the upper or lower panel?
The following doesn't work:
# Code start
splom(~data.frame(mpg, disp, hp, drat, wt, qsec),
data=mtcars, pscales=0,
auto.key=list(columns=3),
upper.panel = function(...){
panel.grid(...)
panel.xyplot(groups=cyl,...)
}
)
# Code end
--
View
2010 Dec 26
1
lattice splom: how to adjust space between tick marks and tick labels?
Dear expeRts,
how can I decrease the space between the tick marks and the corresponding labels in an splom?
See here:
library(lattice)
U <- matrix(runif(4000), ncol = 8)
splom(U, axis.text.cex = 0.2) # => space between the [small] tick labels and tick marks is/seems to be too large
I checked ?panel.pairs but could not find an option for that.
Cheers,
Marius
2004 May 06
1
modifying the text size in splom
All,
I have long variable names that are being fed through splom (R 1.8.1). I'd
like to resize the text printed on the diagonals to better display the
names (unless anyone can suggest another approach - creative use of
varnames). I've looked at the code, R-Help, ?splom and the Trellis User's
Guide to no avail.
Any suggestions? Thanks in advance,
Max Kuhn, Ph.D.
Becton Dickinson
2011 Apr 18
4
splom, plotmath: how to add three lines of information with alignment?
Dear expeRts,
I would like to create a scatter plot matrix with splom(). The lower panel should
contain some additional information about the samples shown in the upper panel
plot, see the splom() call below. Now two questions came up:
(1) The lower panels show "tau" and "alpha" on top of each other. How can I plot
*three* expressions on top of each other? I tried several
2011 May 09
0
Lattice: splom plots for different factors with correlation in lower.panel
Hello list,
I am looking to create a figure for my dataset using splom, where there is a
splom subplot for each level of a factor within, for example, a 2x2 layout.
For each subplot, I wish to put the r-value between each variable pair in
the lower panel. The code I have thus far is below, using the iris dataset
so that it is reproducible. This almost does what I want, but for some
reason
2011 Dec 15
1
lattice key in blank panel
Somewhere I've seen an example of an xyplot() where the key was placed
in a location of a missing panel. For example, if there were 3
conditioning levels, the panel grid would look like:
34
12
In this (possibly imaginary) example, there were scatter plots in
locations 1:3 and location 4 had no conditioning bar at the top, only
the key.
I can find examples of putting the legend outside of
2003 Sep 04
3
Putting regression lines on SPLOM
Sorry Folks,
I'm sure I could suss out the answer myself but I need it
soon ... !
1. Given a set of 4 variables X,Y,Z,W in a dataframe DF, I make
a scatter-plot matrix using splom(DF).
2. I do all regressions of U on V using lm(U~V), where U and V
are all 12 different ordered pairs from X,Y,Z,W.
3. Now I would like to superpose the regression lines from (2)
onto the corresponding
2010 Jan 31
1
accessing column and row numbers inside splom in lattice
Hi,
When using splom() in the lattice package, I would like to be able to
access the row and column number of each individual pairs plot ,
similar to the way that current.row() and current.column() can be used
in other lattice plotting functions such as xyplot. For example, I
would like to be able to write something along the lines of
library(mvtnorm)
library(lattice)
y <-
2010 Nov 26
1
How to use expression(italic()) in a "vectorized" way (within a function)?
Dear expeRts,
I would like to use expression() for creating labels in a splom, as shown in the
first minimal example below. Is there any way I can simplify having to write
"expression(italic(...))" several times?
The second example is what I tried so far, but I can't manage to get italic() to
work. Moreover, it still seems bulky...
Cheers,
Marius
## minimal example (working but
2010 Oct 07
1
Lattice: Histogram in splom diagonals
Dear list, I want to plot several variables with splom and in the main
diagonal, instead of the variable names, I'd like to plot an histogram of
corresponding variables. Searching I did not find the correct syntax, only
some tips in an old post in the list, but this comments help to plot only
density lines instead of histograms. I had some code, but it fails to plot
(I've commented the
2012 Dec 11
1
Focus on a sub-panel of a splom with trellis.focs() -- return coordinate of sub-panel, or names of variables therein
Hi,
I'd like to be able to generate a splom plot in R and then use my mouse to click on one of the sub-panels (panel.pairs, specifically) and have R return either the coordinates of that sub-panel, or even better, the names of the corresponding variables plotted in that sub-panel.
Here's an example to work with:
> library(lattice)
> splom(~iris[1:4], groups = Species, data = iris,
2007 Feb 21
2
Splom plot:how to plot with different symbols?
Hi,
Kindly let me know if I posted a wrong question in the forum.
I want to draw a splom plot with different symbols in plot. My command is as
follows:
splom(~ log10(splomData[2:3]), groups = programs, data = splomData,
panel = panel.superpose,
key = list(title = paste(splomLoop,"Programs of Hog Analysis (Sorted by
LR(GB))"),
panel = panel.superpose,
columns =
2009 Feb 21
0
Bold fonts and greek characters in lattice plots
Hi,
I am trying to "convince" lattice to use bold face in an expression containing Greek characters without any luck.
Example code (without Greek characters, renders the expression in bold)
library(lattice)
data(Cars93,package=="MASS")
splom(~Cars93[,5:8]|Origin,data=Cars93,panel=function(x,y,...) {
panel.splom(x,y,...)
2011 Jan 20
2
circular reference lines in splom
Hello everyone,
I'm stumped. I'd like to create a scatterplot matrix with circular
reference lines. Here is an example in 2d:
library(ellipse)
set.seed(1)
dat <- matrix(rnorm(300), ncol = 3)
colnames(dat) <- c("X1", "X2", "X3")
dat <- as.data.frame(dat)
grps <- factor(rep(letters[1:4], 25))
panel.circ <- function(x, y, ...)
{
circ1