[R] plot-parameter pch without influence when plotting a data-frame

hadley wickham h.wickham at gmail.com
Fri Oct 10 16:16:23 CEST 2008


On Thu, Oct 9, 2008 at 8:19 AM, John Kane <jrkrideau at yahoo.ca> wrote:
> --- On Thu, 10/9/08, Oliver Bandel <oliver at first.in-berlin.de> wrote:
>
>> From: Oliver Bandel <oliver at first.in-berlin.de>
>> Subject: Re: [R] plot-parameter pch without influence when plotting a data-frame
>> To: "Gerhard Schön, UKE Hamburg" <G.Schoen at uke.de>
>> Cc: "R-help" <r-help at r-project.org>
>> Received: Thursday, October 9, 2008, 9:00 AM
>> Zitat von "Gerhard Schön, UKE Hamburg"
>> <G.Schoen at uke.de>:
>>
>> > what is the result of:
>> >
>> > df <- data.frame(x = 1:5, y = 1:5)
>> > plot(df, pch = 1:5)
>>
>> It prints different symbols.
>>
>> It seemed, that my pch-settings had an effect,
>> but some symbols were very similar, especially, when
>> a lot of them are plotted at similar places.
>>
>>
>> But I also had the effect, that some symbol numbers
>> didn't
>> print enything, but *after* the loop I used, warnings were
>> printed.
>
> Have a look at ?points for some discussion of pch values.  Some values are undefined.
>
> Try something like
> mm <- matrix(1:128, nrow= 4)
> matplot(mm, pch=1:128)
>
> to get some idea of what symbols are available.
>
>>
>> Do you know how to plot very small dots?
>>  pch=20 makes dots that are too big for my plot.
>
> matplot(mm, pch=20, cex=.5)


See also pch = "."

"Value 'pch="."' (equivalently 'pch = 46') is handled
          specially.  It is a rectangle of side 0.01 inch (scaled by
          'cex').  In addition, if 'cex = 1' (the default), each side
          is at least one pixel (1/72 inch on the 'pdf', 'postscript'
          and 'xfig' devices)."

from ?points.

Hadley

-- 
http://had.co.nz/



More information about the R-help mailing list