Re: [R] points marking

From: Greg Snow <Greg.Snow_at_imail.org>
Date: Mon, 14 Jun 2010 09:43:10 -0600

I don't think that I would use a barplot as the base, but rather just set up the graph and add the lines where I wanted them. I still don't understand what you want your graph to look like, or what question you are trying to answer with it (part may be a language barrier). If you can give us a better example of what you are trying to accomplish, or a better description of what your data is like and what you are trying to get from the graph, we will have a better chance of being able to help you.

--
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow_at_imail.org
801.408.8111

From: khush ........ [mailto:bioinfo.khush_at_gmail.com]
Sent: Saturday, June 12, 2010 5:38 AM
To: Greg Snow
Cc: r-help_at_r-project.org; Petr PIKAL
Subject: Re: [R] points marking

Hi,

Well Thanks for letting me know that pch is of no use with segments petr. I am using lend as it suits to me more as gregory suggested , but I am not getting imite???  think I try to fix it with some other method also, as I have to deal more with the symbols in this case, But I want to the know one thing from you guys that the way I am using the code is good enough to start, as I am not much familiar with this suff or its dirty way to handle such task. please let me know.

Thanks gregory and petr.

Thank you
Jeet


On Fri, Jun 11, 2010 at 9:07 PM, Greg Snow <Greg.Snow_at_imail.org<mailto:Greg.Snow_at_imail.org>> wrote:
Those graphs look like chromosome maps, if so, you may want to look into the bioconductor project, they may have some prewritten functions to do this.  If not, the lend argument (see ?par) may be something to look at.  If you really want points and segments you will need to plot the points with the points function and the segments separately.  Segments can take vectors, so you don't need to separate things into multiple calls.

--
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow_at_imail.org<mailto:greg.snow_at_imail.org>
801.408.8111

From: khush ........ [mailto:bioinfo.khush_at_gmail.com<mailto:bioinfo.khush_at_gmail.com>]
Sent: Friday, June 11, 2010 12:00 AM
To: Greg Snow
Cc: r-help_at_r-project.org<mailto:r-help_at_r-project.org>
Subject: Re: [R] points marking

Dear Gregory ,

Thnaks for your reply and help. I am explaining you my problems again, below  is my script for the same .

Dom <-c (195,568,559)

fkbp <- barplot (Dom, col="black", xlab="", border = NA, space = 7, xlim=c(0,650), ylim =c(0, 87), las = 2, horiz = TRUE)

axis (1, at = seq(0,600,10), las =2)

1. ==============Segments 1=================================

segments(164,7.8,192,7.8, col = "green", pch=23, cex="9", lty="solid", lwd=20)
segments(45,15.8,138,15.8, col = "green", pch=23, cex="9", lty="solid", lwd=20)
segments(160,15.8,255,15.8, col = "green", pch=23, cex="9", lty="solid", lwd=20)
segments(277,15.8,378,15.8, col = "green", pch=23, cex="9", lty="solid", lwd=20)
segments(51,23.8,145,23.8, col = "green", pch=23, cex="9", lty="solid", lwd=20)
segments(167,23.8,262,23.8, col = "green", pch=23, cex="9", lty="solid", lwd=20)
segments(284,23.8,381,23.8, col = "green", pch=23, cex="9", lty="solid", lwd=20)

2. ==============Segments 2 ==================================
segments(399,15.8,432,15.8, col = "blue", pch=21, cex="9", lty="solid", lwd=20)
segments(448,15.8,475,15.8, col = "blue", pch=21, cex="9", lty="solid", lwd=20)
segments(486,15.8,515,15.8, col = "blue", pch=21, cex="9", lty="solid", lwd=20)
segments(401,23.8,434,23.8, col = "blue", pch=21, cex="9", lty="solid", lwd=20)
segments(450,23.8,475,23.8, col = "blue", pch=21, cex="9", lty="solid", lwd=20)
segments(486,23.8,517,23.8, col = "blue", pch=21, cex="9", lty="solid", lwd=20)

I solved one part of my query i.e to mark points from one positions to other is ok and I found that its working fine but I have another issue now, as I am using using two segments data 1 and 2 , although I want to draw different shapes for segmants 2 as I am giving pch=21, but I it seems to give a solid line for both. I want to draw different shapes for every chunk of segments i.e is the whole point.

I want to make script which can generate such figures, below is link to one of the tool.
http://www.expasy.ch/tools/mydomains/

Thank you

Jeet
On Thu, Jun 10, 2010 at 11:10 PM, Greg Snow <Greg.Snow_at_imail.org<mailto:Greg.Snow_at_imail.org>> wrote:
Your question is not really clear, do either of these examples do what you want?

 with(anscombe, plot(x1, y2, ylim=range(y2,y3)) )
 with(anscombe, points(x1, y3, col='blue', pch=2) )
 with(anscombe, segments(x1, y2, x1, y3, col=ifelse( y2>y3, 'green','red') ) )


 with(anscombe, plot(x1, y2, ylim=range(y2,y3), type='n') )
 with(anscombe[order(anscombe$x1),], polygon( c( x1,rev(x1) ), c(y2, rev(y3)), col='grey' ) )



--
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow_at_imail.org<mailto:greg.snow_at_imail.org>
801.408.8111



> -----Original Message-----
> From: r-help-bounces_at_r-project.org<mailto:r-help-bounces_at_r-project.org> [mailto:r-help-bounces_at_r-<mailto:r-help-bounces_at_r->
> project.org<http://project.org>] On Behalf Of khush ........
> Sent: Thursday, June 10, 2010 7:48 AM
> To: r-help_at_r-project.org<mailto:r-help_at_r-project.org>
> Subject: [R] points marking
>
> Hi,
>
> How to mark points on x axis of a graph keeping x axis as constant and
> changing y from y1 to y2 respectively. I want to highlight the area
> from y1
> to y2.
>
> Any suggestions
>
> Thank you
> Jeet
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help_at_r-project.org<mailto:R-help_at_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.
[[alternative HTML version deleted]] ______________________________________________ R-help_at_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.
Received on Mon 14 Jun 2010 - 16:11:03 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 14 Jun 2010 - 16:20:31 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive