Displaying 20 results from an estimated 5000 matches similar to: "xyplot: distance between axis and axis-label gets wrong"
2009 Jun 18
1
lattice logaritmic scale (basis "e" ), rewriting labels using xscale.component
Hi there,
sorry for troubling everybody once again, I've got a problem rewriting
Sarkar's function for
rewriting the tick locations in a logaritmic way (s.
http://lmdvr.r-forge.r-project.org/code/Chapter08.R):
His example works for log 2 but I need log e (natural logarithm). My
problem is that if I replace
2 with "e" (using paste()), I get the error message that the location
2008 Jun 30
1
Lattice : Single reference line/label at 0.05
r-friends--
I am trying to make a lattice plot with a single label at 0.05. A reference line at y=0.05 as well... This is what I have so far. The label reads 0.0 and there is a grid instead of a single reference line. Can someone help please?
Troy
x<-18:35
(pv<-1/(x-17))
xydf<-data.frame(x, pv)
print(xyplot(pv~x, data=xydf, type=c('p', 'g'),
ylim=c(0,1),
2013 Feb 27
1
lattice xyplot point labelling
This is my reproducible example
tv.ms<-structure(list(inq = structure(4:17, .Label = c("D4", "D5", "D6a",
"D6b", "D6c", "D7", "D8", "F4", "F5a", "F5b", "F6a", "F6b", "F6c",
"F6d", "F7a", "F7b", "F8"), class =
2011 Aug 15
1
lattice: How to get log base for each axis inside panel function?
Hello!
I'd like to have a function to draw correct grid while using log axis with xyplot from lattice package. Right now I have the following code inside of my panel function:
lim <- current.panel.limits()
v <- latticeExtra:::logTicks(2^lim$xlim, loc=1)
h <- latticeExtra:::logTicks(2^lim$ylim, loc=1)
panel.abline(h=log2(h), v=log2(v), col="LightGray")
Is there an easy way
2012 Sep 14
0
problem with user defined panel function in xyplot
Hi everyone,
?
I am trying to do a horizonplot using my own time series
data. I know that there is a horizonplot function in latticeExtra, but on
closer examination i think that the graph itself is slightly wrong (it displays
some regions as triangles and i think they should be trapezoids, and the red
regions (that are below the baseline) are displayed on top of the blue areas ?
while i think
2007 Feb 21
3
Different gridlines per panel in xyplot
In the example R script below, horizontal gray gridlines are drawn at y
coordinates where the points are drawn with the code:
panel.abline(h=y, v=xScale, col.line="gray")
How do I change this so that the horizontal gray gridlines are drawn at y
coordinates where the y labels are drawn? The challenge is that each panel
has different y-ranges (in my real example the y-ranges and
2011 Sep 15
1
Lattice xyplot log scale labels help!
I have a problem with lattice log scales that I could use some help with.
I'm trying to print log y-axis scales without exponents in the labels.
A similar thread with Deepayan' recommendation is here:
http://tolstoy.newcastle.edu.au/R/e11/help/10/09/9865.html. For
example, this code using xyplot produces a logged y-axis but the
labels (e.g. "10^1.2") are not very
2012 Mar 28
1
xyplot lattice fine control of axes limits and thick marks (with log scale)
After a long and winding road (sorry but I'm a novice) I get to a final
result which is quite close to what I need;
nevertheless I would like to tweak a little further the xyplot so that I can
get ***for each single panel defined by variable z*** a finer control over:
-the x and y the limits: I would like to be the same for both axes;
-the number of thick marks: again I would like to be same
2001 Nov 20
0
Summary: non-negative least squares
Thank you Brian Ripley, Gardar Johannesson, and Marcel Wolbers for your
prompt
and friendly help! I will share any further learnings as I move through
these suggestions. -Bob Abugov
Brian Ripley wrote:
I just use optim() on the sum of squares with non-negativity constraints.
That did not exist in 1999.
Gardar Johannesson wrote:
You can always just use the quadratic programing library in R
2010 Mar 29
1
xyplot second y-xis and legend
Dear list,
I try to set a secondary y-axis in a lattice xyplot. This works. However, I
am unable to set a proper legend/key together with the 2nd y-axis under
general xyplot procedures. See example below.
The combination of the par.settings with simpleTheme and other settings
seems to go wrong.
I couldn't find a solution from previous topics. Any suggestions? thanks in
advance!
Robbert
2007 Mar 21
0
4 commits - libswfdec/swfdec_js_movie.c libswfdec/swfdec_script.c player/swfdec_slow_loader.c
libswfdec/swfdec_js_movie.c | 22 ++++++++++++++++++----
libswfdec/swfdec_script.c | 6 +++++-
player/swfdec_slow_loader.c | 20 +++++++++++++++++++-
3 files changed, 42 insertions(+), 6 deletions(-)
New commits:
diff-tree 13171a49b02675d44bc54c91ec872e173cfcefd6 (from parents)
Merge: dae7f00125145fc3e540c5454942acbbabe800db bbf53a5c2060eadff2632674d2550a09719f41e1
Author: Benjamin Otte
2010 May 26
0
substitution in a function
I have the following function defined as below
match.trace <- function(dfobj, distance, day1, day2) {
day1 <- substitute(dfobj$day1); day1
day2 <- substitute(dfobj$day2)
distance <- substitute(dfobj$distance)
xx <- NULL
for (i in 0:10) xx[i+1] <- with(dfobj,
cor(Lag((day1-day1[1]),i), (day2-day2[1]), use='pair'))
i <- match(max(xx), xx)
with(dfobj, {
2009 Jul 21
2
animated grid graphics
I need to make a fairly complex animated graphic and decided to use grid for it.
A very simple example of what I need:
##==============================================================================
library(grid)
grid.newpage()
pushViewport(plotViewport())
pushViewport(viewport(xscale = extendrange(c(0, 100)),
yscale = extendrange(c(0, 100))))
grid.xaxis()
grid.yaxis()
2011 May 14
1
Using dates on axis with Grid plots
Hi,
I'm trying to use Grid plots and would like to have an X axis that
represents dates. I have several years of data so I would like to be able to
have labeled tick marks only intermittently (not one per date). I can
transform the initial data from a date time string into POSIXlt or POSIXct,
or Date objects.
The issue is that when I try to layout the plot using:
dev.off()
pushViewport(
2007 Dec 10
0
6 commits - libswfdec/Makefile.am libswfdec/swfdec_as_interpret.c libswfdec/swfdec_color_as.c libswfdec/swfdec_graphic_movie.c libswfdec/swfdec_image_decoder.c libswfdec/swfdec_morph_movie.c libswfdec/swfdec_movie_as_drawing.c
libswfdec/Makefile.am | 14 +-
libswfdec/swfdec_as_interpret.c | 4
libswfdec/swfdec_color_as.c | 4
libswfdec/swfdec_graphic_movie.c | 16 ++
libswfdec/swfdec_image_decoder.c | 8 +
libswfdec/swfdec_morph_movie.c | 14 ++
libswfdec/swfdec_movie.c
2003 Dec 30
0
grid's viewports
Hello!
There is something wrong with nested viewports in grid package (I have
tested it in R-1.8.0, may be it is different in other versions). Here is
an simple example of a feature which seems strange to me:
x11()
rec<-T
push.viewport(viewport(xscale=c(-10,10),yscale=c(-10,10),gp=gpar(col="magenta")),recording=rec)
#Parent viewport with scales -10:10
2012 Apr 01
0
lattice levelplot axis ticks labels
Hello,
I've searched for help a lot and think I am close, but an still not able to
place ticks and labels how I'd like in lattice's levelplot. I've come up
with general reproducible code that gives the same problem as I'm having
with real data:
heat <- array(1:24,c(3,8))
require (lattice)
##basically I want a graph like this. depth y axis doesn't have ticks and
2010 Oct 20
1
need for speed on grid.rect
When I use grid.rect to print a multi-coloured grid, it is incredibly slow compared to a single colour grid, or even a two colour grid.
I've set out some simplified examples below. This is something I run literally thousands of times a day, so I would greatly appreciate any hints on how I might improve the speed???
library(grid)
pushViewport(viewport(
width = unit(100,
2008 May 06
1
Spacing between lattice panels
I'm trying to set up a lattice plot with two y-axes for each panel. (Yes,
I know that multiple y-axes are generally a bad idea; the graph is for
someone else and they want it that way.) I've used a custom
yscale.component in xyplot to achieve this:
myyscale.component <- function(...)
{
ans <- yscale.components.default(...)
ans$right <- ans$left
foo <-
2006 May 19
2
Tick marks in lines.survfit
I posted several months about the problem with adding tick marks to curves
using lines.survfit.
This occurs when lines.survfit is used to add a curve to survival curves
plotted with plot.survfit. The help for this function implies that
mark.time=TRUE thus:
plot(pfsfit,conf.int=FALSE,xscale=365.25,yscale=100,xlab="Years",ylab="%
surviving",lty=2,mark=3)