[BioC] Point plot against labels and reordering

Robert Gentleman rgentlem at fhcrc.org
Wed Apr 18 18:23:06 CEST 2007


even better, there is a very good book on how to do graphics in R,
called R Graphics, by Paul Murrell, you really should buy it...


Sean Davis wrote:
> On Wednesday 18 April 2007 10:25, Daniel Brewer wrote:
>> Hi,
>>
>> I am getting really frustrated with trying to create a specific plot.  I
>> have the following matrix (monkey):
>>     Exon      PRC1     PRC2     PRC3
>> 1  0_110 2.0132845 1.484080 1.923869
>> 2   0_34 2.6528139 1.141114 1.242584
>> 3   0_78 1.6247146 1.230726 1.592407
>> 4     10 1.4471323 1.137777 1.426656
>> 5     11 1.5471201 1.204736 1.500566
>> 6      2 1.0423570 1.104883 1.087180
>> 7      3 0.9563367 1.017354 1.067159
>> 8      4 1.4577586 1.166938 1.422878
>> 9      5 1.5081813 1.177205 1.494983
>> 10     6 1.4432391 1.144851 1.396613
>> 11     7 1.6995243 1.337146 1.643418
>> 12     8 1.3848549 1.096389 1.357165
>> 13     9 1.4995867 1.162944 1.444809
>>
>> Exon is the Exon number of a label saying which two exons the probe is
>> in-between.  That column should be treated as labels, not numeric.
>>
>> What I would like to be able to do is plot for example PRC1 on the
>> y-axis and the Exon as the x-axis labels (just evenly spaced not a
>> numeric scale).  Secondly I would like to be able to reorder the labels
>> for the plot.
>>
>> The closest I have got is:
>> plot(monkey$Exon,monkey$PRC1)
> 
> How about (untested):
> 
> matplot(monkey[,2:4],axes=F)
> axis(side=1,labels=as.character(monkey$Exon))
> box()
> 
> Or, if you want only PRC1:
> 
> plot(monkey[,2],axes=F)
> 
> instead of matplot.
> 
> Sean
> 
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor
> 

-- 
Robert Gentleman, PhD
Program in Computational Biology
Division of Public Health Sciences
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N, M2-B876
PO Box 19024
Seattle, Washington 98109-1024
206-667-7700
rgentlem at fhcrc.org



More information about the Bioconductor mailing list