[R] Drawing a dotted circle.

Rui Barradas ruipbarradas at sapo.pt
Sat Jan 12 20:20:52 CET 2013


Hello,

In Windows it's

.Internal(symbols(x, y, type, data, inches, bg, fg, ...))

And this is what I've found:
file r-2.15.2\src\main\graphics.c
function GSymbol

     /*
      * Force line type LTY_SOLID
      * i.e., current par(lty) is ignored when drawing symbols
      */
     gc.lty = LTY_SOLID;


So, the op is out of luck, lty solid is hard-coded in the C source.
Maybe plotrix::draw.circle, like Jose suggested.

Rui Barradas
Em 12-01-2013 18:53, Ben Bolker escreveu:
>    A wild guess which I can't check right now, but: is there something
> funny/different with the Windows graphics driver that draws the result
> of a dashed line based on many closely spaced points as a solid line?
> i.e., it draws a dash for the beginning of every segment within the
> line, even if they are close together, resulting in overlapping dashes
> -> a solid line?  Don't have time to dig into
>
> .External.graphics(C_symbols, x, y, type, data,
>          inches, bg, fg, ...)
>
>   right now ...
>
>
> On 13-01-12 01:41 PM, Rui Barradas wrote:
>> Hello,
>>
>> Checks ok on Ubuntu 12.04 but not on Windows 7, where it plots a solid
>> line circle.
>>
>> symbols(0, 0, circles = 1, inches = FALSE, fg = 'gray', lty=2)
>> sessionInfo()
>> R version 2.15.2 (2012-10-26)
>> Platform: x86_64-w64-mingw32/x64 (64-bit)
>>
>> locale:
>> [1] LC_COLLATE=Portuguese_Portugal.1252 LC_CTYPE=Portuguese_Portugal.1252
>> [3] LC_MONETARY=Portuguese_Portugal.1252 LC_NUMERIC=C
>> [5] LC_TIME=Portuguese_Portugal.1252
>>
>> attached base packages:
>> [1] stats     graphics  grDevices utils     datasets  methods base
>>
>> loaded via a namespace (and not attached):
>> [1] tools_2.15.2
>>
>>
>> Hope this helps,
>>
>> Rui Barradas
>> Em 12-01-2013 17:02, Ben Bolker escreveu:
>>> Ved P. Sharma <vedsharma <at> gmail.com> writes:
>>>
>>>> I am trying to draw a dotted circle by using symbols command:
>>>>
>>>> symbols(0, 0, circles = 1, inches = FALSE, fg = 'gray', lty=2)
>>>>
>>>> But it gives me a solid line. I was just wondering whether am I making a
>>>> mistake?
>>>>
>>>     Works for me (although it's a dashed line; lty=3 gives a dotted
>>> line) on Ubuntu 10.04, R-devel.  Results of sessionInfo() please?
>>>
>>> ______________________________________________
>>> R-help at r-project.org 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.




More information about the R-help mailing list