# [R] How to convert color to black & white - Solve

Mon May 16 18:39:50 CEST 2005

```Dear Uwe,
Now, I know how to do with my color printer to print black and white.
Then I use a simple color like this to use my picture.
print.bw4 <-c(blueF         = "#0000FF",
redF          = "#FF0000",
salmon.light  = "#dd9955",
yellowF       = "#FFFF00")
barplot(1:4,col = print.bw4)

Best,

On this day 5/16/2005 2:42 PM, Uwe Ligges wrote:

>
>> Thank's you very much.
>> But I need the plot with color not gray.
>
>
> So you want a colorful rgb plot, OK, fine with your code below.
>
> Now you want to print it black and white: This is now a question for
> the folks who wrote your printer driver, but not for R-help.
>
> Uwe Ligges
>
>
>> Best wishes,
>>
>> On this day 5/14/2005 3:05 AM, OlsenN at pac.dfo-mpo.gc.ca wrote:
>>
>>> Here's one option:
>>>
>>> barplot(1:5,col=gray(seq(0,1,length=5)))
>>>
>>> Norm Olsen
>>>
>>> -----Original Message-----
>>> From: r-help-bounces at stat.math.ethz.ch
>>> To: R-help at stat.math.ethz.ch
>>> Sent: 5/13/2005 11:40 AM
>>> Subject: [R] How to convert color to black & white
>>>
>>> Dear all,
>>> Could someone please explain to me how to convert color to black &
>>> white.
>>> For example:
>>> barplot(1:5,col = rainbow(5))
>>> Because I need to print my plot to save my ink color printer.
>>> I don't want to convert to grayscale, but keep it as an RGB.
>>> I  would be very happy if anyone could help me.
>>> Thank you very much in advance.
>>>
>>> Kindly regards,
>>>
>>> ______________________________________________
>>> R-help at stat.math.ethz.ch mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-help
>>> http://www.R-project.org/posting-guide.html
>>>
>>>
>>>
>>
>> ______________________________________________
>> R-help at stat.math.ethz.ch mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help