# Re: [R] lattice package - question on plotting lines

From: Tony <ahirst_at_qwest.net>
Date: Tue 23 May 2006 - 12:10:43 EST

On Mon, 2006-05-22 at 18:36 -0700, Tim Smith wrote:
> Hi all,
>
> I was trying to plot a graph using the following data:
>
> method percent accuracy group
> A1 4 0.8529 cns
> A1 10 0.8412 cns
> A1 15 0.8235 cns
> A2 4 0.9353 cns
> A2 10 0.9412 cns
> A2 15 0.9471 cns
> A1 4 0.8323 col
> A1 10 0.8452 col
> A1 15 0.8484 col
> A2 4 0.8839 col
> A2 10 0.8677 col
> A2 15 0.8678 col
>
> #################
> The code I'm using to generate the graphs is:
>
> ### code :
>
> xyplot(accuracy ~ percent|group,data = k, groups = method, allow.multiple = TRUE, scales = "same",type="o",
> xlab = "% of genes", ylab = "Accuracy", main = " Accuracy ", aspect = 2/3,
> panel = function(...) {
> panel.superpose(...)
> }
> )
>
>
> ####################
>
> I have tried to use the 'get' and 'set' functions of 'par()', but can't figured it out. I have two questions:
>
> i) How can I set it so that the line plotted for A1 in all the plots is 'solid', and the one for A2 is 'dotted' for both the groups (cns and col)
>
> ii) How can I set the abline feature to show a horizontal line at different points on the y-axis for each of the two graphs?
>
> Any help would be highly appreciated.
>
> many thanks.
>
>
>
>
>
>
>
>
> ---------------------------------
> Sneak preview the all-new Yahoo.com. It's not radically different. Just radically better.
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
>

Does this get you closer?

xyplot(accuracy ~ percent|group,data = k, groups = method, allow.multiple = TRUE, scales = "same",type="o",

par.settings=list(superpose.line = list(lty=1:2)), # added   xlab = "% of genes", ylab = "Accuracy", main = " Accuracy ", aspect = 2/3,

```            panel = function(...) {
panel.superpose(...)
}
```

)
```--
Tony <ahirst@qwest.net>

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help