In R graphics, what is the different between plotting characters (pch) 16 and 19?

后端 未结 3 1523
隐瞒了意图╮
隐瞒了意图╮ 2021-01-12 11:45

I can\'t find any documentation other than mentions of \"filled\" vs \"solid\".

library(graphics)
plot.new()
points(.48, .5, pch=19)
points(.52, .5, pch=16)
         


        
相关标签:
3条回答
  • 2021-01-12 11:48

    From Hadley's new book R for Data Science: Note that there are some seeming duplicates: 0, 15, and 22 are all squares. The difference comes from the interaction of the colour and fill aesthetics. The hollow shapes (0–14) have a border determined by colour; the solid shapes (15–18) are filled with colour; the filled shapes (21–24) have a border of colour and are filled with fill.

    0 讨论(0)
  • 2021-01-12 11:50

    This may help:

    Values of pch are stored internally as integers. The interpretation is

    NA_integer_: no symbol.
    
    0:18: S-compatible vector symbols.
    
    19:25: further R vector symbols.
    
    26:31: unused (and ignored).
    
    32:127: ASCII characters.
    
    128:255 native characters only in a single-byte locale and for the symbol font. (128:159 are only used on Windows.)
    
    -32 ... Unicode code point (where supported).
    

    The full text is here

    0 讨论(0)
  • 2021-01-12 11:51

    I used your code, and saving the image as svg.

    When opening in Inkscape, the different is that 19 has a "stroke", that is a border. 16 does not.

    Note that this is not a separate shape, but within the same shape.

    0 讨论(0)
提交回复
热议问题