Re: [R] Turn off border on barplot

From: Paul Murrell <p.murrell_at_auckland.ac.nz>
Date: Thu 26 Oct 2006 - 21:00:47 GMT

Hi

Marc Schwartz wrote:
> On Thu, 2006-10-26 at 16:13 -0400, Frank McCown wrote:

>> I was wondering if there was any way to completely remove the borders 
>> around each bar when using the barplot function.  I understand how to 
>> change the color of the border (border="white"), but I need the border 
>> to be invisible so I can plot many skinny bars right next to each other 
>> with only the bar's color visible.
>>
>> Thanks,
>> Frank

>
> You can try:
>
> # Set line type to blank
> # See ?par
> # First save current value
> lty.o <- par("lty")
>
> par(lty = 0)
>
> # Also set space to 0, rather
> # than default 0.2, if needed for more room
> barplot(1:10, space = 0)
>
> # Reset to old value
> par(lty = lty.o)

or ...

barplot(1:10, border=NA)

Paul

> Depending upon the "look" you need, setting space to 0 may be sufficient
> and still allow you to enable a border.
>
> HTH,
>
> Marc Schwartz
>
> ______________________________________________
> R-help@stat.math.ethz.ch 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.

-- 
Dr Paul Murrell
Department of Statistics
The University of Auckland
Private Bag 92019
Auckland
New Zealand
64 9 3737599 x85392
paul@stat.auckland.ac.nz
http://www.stat.auckland.ac.nz/~paul/

______________________________________________
R-help@stat.math.ethz.ch 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 Fri Oct 27 07:15:50 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Thu 26 Oct 2006 - 22:30:12 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.