[prev in list] [next in list] [prev in thread] [next in thread]
List: r-help
Subject: Re: [R] Problem between panel.abline and log scales (lattice)
From: "Deepayan Sarkar" <deepayan.sarkar () gmail ! com>
Date: 2009-01-19 8:40:39
Message-ID: eb555e660901190040n7cc65257gdbb98d6fe5000109 () mail ! gmail ! com
[Download RAW message or body]
On 1/12/09, Ptit_Bleu <ptit_bleu@yahoo.fr> wrote:
>
> Hello and Happy New Year to all R-Users !!!
>
> I would like to plot a lattice graph with a logarthmic y axis and add two
> reference lines that is :
>
> ref<-c(0.0070, 0.0096)
>
> graph1<-xyplot(data$y1 ~ as.numeric(strptime(data$x1, format="%Y-%m-%d
> %H:%M:%S")) | as.character(data$Code),
> list(y = list(log = T)),
> xlab="X'", ylab="Y",
> panel = function(...) {
> panel.xyplot(..., type="p", pch=20)
> panel.abline(h=ref, col="red")
> }
>
> )
> print(graph1)
>
>
> With this script, no reference lines are plotted.
> But if I use list(y = list(log = F)), that is a linear scale, it works.
>
> Could you please explain me the problem (and help me to solve it) ?
xyplot(y ~ x, scales=list(log=TRUE))
is basically equivalent to
xyplot(log10(y) ~ log10(x))
(plus some changes to axis annotation). You will probably need to use
panel.curve instead of panel.abline in your panel function.
-Deepayan
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic