Problem with coloring histograms
1
0
Entering edit mode
@jdelasherasedacuk-1189
Last seen 8.8 years ago
United Kingdom
Hi, I am using 'hist' to make a frequency histogram from my background-substracted foreground values. I want to highlight the first bar in the histogram. That's easily accomplished... unless the first bar is of negative values, then teh bar can't get coloured. It's either all coloured or nothing. what I do is something like this: hist(RG.s$R,col=c("darkblue",rep("white",14))) this one contains only positive values, and paints the first bar blue, and teh rest white. but if the RG.s$R vector contains some negative values, then the bar at the left of the 0 (negative counts) doesn't get coloured. However, if I do: hist(RG.s$R,col="darkblue") it paints all of them blue... so teh first bar can be painted so... anybody knows how can I get around this? Jose -- Dr. Jose I. de las Heras Email: J.delasHeras at ed.ac.uk The Wellcome Trust Centre for Cell Biology Phone: +44 (0)131 6513374 Institute for Cell & Molecular Biology Fax: +44 (0)131 6507360 Swann Building, Mayfield Road University of Edinburgh Edinburgh EH9 3JR UK
• 695 views
ADD COMMENT
0
Entering edit mode
@jdelasherasedacuk-1189
Last seen 8.8 years ago
United Kingdom
Agh, ignore this... I needed a coffee... it works just fine, it's just that the first bar was so tiny it didn't really show at teh scale I was drawing, so the bar I was looking at was actually the second. Doh! All is good. Jose Quoting J.delasHeras at ed.ac.uk: > > Hi, > > I am using 'hist' to make a frequency histogram from my > background-substracted foreground values. I want to highlight the first > bar in the histogram. That's easily accomplished... unless the first > bar is of negative values, then teh bar can't get coloured. It's either > all coloured or nothing. > > what I do is something like this: > > hist(RG.s$R,col=c("darkblue",rep("white",14))) > > this one contains only positive values, and paints the first bar blue, > and teh rest white. > > but if the RG.s$R vector contains some negative values, then the bar at > the left of the 0 (negative counts) doesn't get coloured. > > However, if I do: > > hist(RG.s$R,col="darkblue") > > it paints all of them blue... so teh first bar can be painted > > so... anybody knows how can I get around this? > > Jose > > -- > Dr. Jose I. de las Heras Email: J.delasHeras at ed.ac.uk > The Wellcome Trust Centre for Cell Biology Phone: +44 (0)131 6513374 > Institute for Cell & Molecular Biology Fax: +44 (0)131 6507360 > Swann Building, Mayfield Road > University of Edinburgh > Edinburgh EH9 3JR > UK > > _______________________________________________ > 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 > -- Dr. Jose I. de las Heras Email: J.delasHeras at ed.ac.uk The Wellcome Trust Centre for Cell Biology Phone: +44 (0)131 6513374 Institute for Cell & Molecular Biology Fax: +44 (0)131 6507360 Swann Building, Mayfield Road University of Edinburgh Edinburgh EH9 3JR UK
ADD COMMENT

Login before adding your answer.

Traffic: 349 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6