Quantcast

'symbols' not plotting correct circle radii

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

'symbols' not plotting correct circle radii

Stuart Leask
Hi there.

I have been plotting some circles using 'symbols', with radii representing my data, but the radii looked incorrect.

It seems to happen with a single circle too:

Symbols ( 0, 0, circles = 40, xlim = c(-40, 40), ylim= c(-40, 40))

If I put a ruler up to my monitor (technology!)  to compare the radius with the axes, the circle isn't radius 40; it is closer to 15...

I suspect there is a simple answer.


Stuart
This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it.   Please do not use, copy or disclose the information contained in this message or in any attachment.  Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham.

This message has been checked for viruses but the contents of an attachment
may still contain software viruses which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.
______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: 'symbols' not plotting correct circle radii

Jim Lemon
On 07/18/2012 08:02 PM, Stuart Leask wrote:

> Hi there.
>
> I have been plotting some circles using 'symbols', with radii representing my data, but the radii looked incorrect.
>
> It seems to happen with a single circle too:
>
> Symbols ( 0, 0, circles = 40, xlim = c(-40, 40), ylim= c(-40, 40))
>
> If I put a ruler up to my monitor (technology!)  to compare the radius with the axes, the circle isn't radius 40; it is closer to 15...
>
> I suspect there is a simple answer.
>
Hi Stuart,
The answer does not appear to be simple. While the documentation for
symbols says that the "inches" argument controls the size of the
circles, it appears to do so with reference to the user units of the
plot, not to that quaint unit descending from the twelfth part of
someone's foot. So, whatever numbers you pass as "circles" seem to be
scaled to a maximum dimension of whatever "inches" is in user units, at
least on the x11 graphics device.

Jim

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: 'symbols' not plotting correct circle radii

Sarah Goslee
On Wed, Jul 18, 2012 at 6:42 AM, Jim Lemon <[hidden email]> wrote:

> On 07/18/2012 08:02 PM, Stuart Leask wrote:
>>
>> Hi there.
>>
>> I have been plotting some circles using 'symbols', with radii representing
>> my data, but the radii looked incorrect.
>>
>> It seems to happen with a single circle too:
>>
>> Symbols ( 0, 0, circles = 40, xlim = c(-40, 40), ylim= c(-40, 40))
>>
>> If I put a ruler up to my monitor (technology!)  to compare the radius
>> with the axes, the circle isn't radius 40; it is closer to 15...
>>
>> I suspect there is a simple answer.
>>
> Hi Stuart,
> The answer does not appear to be simple. While the documentation for symbols
> says that the "inches" argument controls the size of the circles, it appears
> to do so with reference to the user units of the plot, not to that quaint
> unit descending from the twelfth part of someone's foot. So, whatever
> numbers you pass as "circles" seem to be scaled to a maximum dimension of
> whatever "inches" is in user units, at least on the x11 graphics device.

>From ?symbols:

If inches is FALSE, the units are taken to be those of the appropriate axes.

Is that not what's wanted here?

Sarah

--
Sarah Goslee
http://www.functionaldiversity.org

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: 'symbols' not plotting correct circle radii

Jim Lemon
On 07/18/2012 09:42 PM, Sarah Goslee wrote:

> On Wed, Jul 18, 2012 at 6:42 AM, Jim Lemon<[hidden email]>  wrote:
>> On 07/18/2012 08:02 PM, Stuart Leask wrote:
>>>
>>> Hi there.
>>>
>>> I have been plotting some circles using 'symbols', with radii representing
>>> my data, but the radii looked incorrect.
>>>
>>> It seems to happen with a single circle too:
>>>
>>> Symbols ( 0, 0, circles = 40, xlim = c(-40, 40), ylim= c(-40, 40))
>>>
>>> If I put a ruler up to my monitor (technology!)  to compare the radius
>>> with the axes, the circle isn't radius 40; it is closer to 15...
>>>
>>> I suspect there is a simple answer.
>>>
>> Hi Stuart,
>> The answer does not appear to be simple. While the documentation for symbols
>> says that the "inches" argument controls the size of the circles, it appears
>> to do so with reference to the user units of the plot, not to that quaint
>> unit descending from the twelfth part of someone's foot. So, whatever
>> numbers you pass as "circles" seem to be scaled to a maximum dimension of
>> whatever "inches" is in user units, at least on the x11 graphics device.
>
>> From ?symbols:
>
> If inches is FALSE, the units are taken to be those of the appropriate axes.
>
> Is that not what's wanted here?
>
> Sarah
>
My interpretation was that Stuart wanted circles with radii that were
the stated value of the "circles" argument in user units. As the
"inches" argument is TRUE (1) by default, it only seems to serve as a
scaling factor for the values of the "circles" argument. So, the
combination of "circles=40" and "inches=1" yields a circle with a radius
of 1 user unit. When I reran the example with "inches=0.5", I got
circles with a maximum radius of 0.5 user units. I haven't tested this
on any device other than x11.

Jim

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: 'symbols' not plotting correct circle radii

Jim Lemon
On 07/18/2012 10:11 PM, Jim Lemon wrote:

> On 07/18/2012 09:42 PM, Sarah Goslee wrote:
>> On Wed, Jul 18, 2012 at 6:42 AM, Jim Lemon<[hidden email]> wrote:
>>> On 07/18/2012 08:02 PM, Stuart Leask wrote:
>>>>
>>>> Hi there.
>>>>
>>>> I have been plotting some circles using 'symbols', with radii
>>>> representing
>>>> my data, but the radii looked incorrect.
>>>>
>>>> It seems to happen with a single circle too:
>>>>
>>>> Symbols ( 0, 0, circles = 40, xlim = c(-40, 40), ylim= c(-40, 40))
>>>>
>>>> If I put a ruler up to my monitor (technology!) to compare the radius
>>>> with the axes, the circle isn't radius 40; it is closer to 15...
>>>>
>>>> I suspect there is a simple answer.
>>>>
>>> Hi Stuart,
>>> The answer does not appear to be simple. While the documentation for
>>> symbols
>>> says that the "inches" argument controls the size of the circles, it
>>> appears
>>> to do so with reference to the user units of the plot, not to that
>>> quaint
>>> unit descending from the twelfth part of someone's foot. So, whatever
>>> numbers you pass as "circles" seem to be scaled to a maximum
>>> dimension of
>>> whatever "inches" is in user units, at least on the x11 graphics device.
>>
>>> From ?symbols:
>>
>> If inches is FALSE, the units are taken to be those of the appropriate
>> axes.
>>
>> Is that not what's wanted here?
>>
>> Sarah
>>
> My interpretation was that Stuart wanted circles with radii that were
> the stated value of the "circles" argument in user units. As the
> "inches" argument is TRUE (1) by default, it only seems to serve as a
> scaling factor for the values of the "circles" argument. So, the
> combination of "circles=40" and "inches=1" yields a circle with a radius
> of 1 user unit. When I reran the example with "inches=0.5", I got
> circles with a maximum radius of 0.5 user units. I haven't tested this
> on any device other than x11.
>
> Jim
>
Oops, I just realized that I left out saying that you were correct.

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: 'symbols' not plotting correct circle radii

Stuart Leask
In reply to this post by Stuart Leask
(Oh, and yes I've tried setting 'inches=F', but I then get a circle correct on X axis,  but too large on the Y axis.)

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Stuart Leask
Sent: 18 July 2012 11:03
To: [hidden email]
Subject: [R] 'symbols' not plotting correct circle radii

Hi there.

I have been plotting some circles using 'symbols', with radii representing my data, but the radii looked incorrect.

It seems to happen with a single circle too:

Symbols ( 0, 0, circles = 40, xlim = c(-40, 40), ylim= c(-40, 40))

If I put a ruler up to my monitor (technology!)  to compare the radius with the axes, the circle isn't radius 40; it is closer to 15...

I suspect there is a simple answer.


Stuart
This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it.   Please do not use, copy or disclose the information contained in this message or in any attachment.  Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham.

This message has been checked for viruses but the contents of an attachment
may still contain software viruses which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.
______________________________________________
[hidden email] 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.

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: 'symbols' not plotting correct circle radii

Stuart Leask
In reply to this post by Stuart Leask
Problem has gone away!

Last night, on this computer (64-bit i7 Windows 7), setting inches=F plotted wrongly on Y.
Tried it again this morning - still wrong on Y the first time, BUT repeating it - okay on Y!
Repeating previous syntax, then repeating this - still okay.


Odd. I will get back to the list if it starts happening again.

 
Stuart

-----Original Message-----
From: Leask Stuart
Sent: 19 July 2012 10:59
To: [hidden email]
Subject: RE: 'symbols' not plotting correct circle radii

(Oh, and yes I've tried setting 'inches=F', but I then get a circle correct on X axis,  but too large on the Y axis.)

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Stuart Leask
Sent: 18 July 2012 11:03
To: [hidden email]
Subject: [R] 'symbols' not plotting correct circle radii

Hi there.

I have been plotting some circles using 'symbols', with radii representing my data, but the radii looked incorrect.

It seems to happen with a single circle too:

Symbols ( 0, 0, circles = 40, xlim = c(-40, 40), ylim= c(-40, 40))

If I put a ruler up to my monitor (technology!)  to compare the radius with the axes, the circle isn't radius 40; it is closer to 15...

I suspect there is a simple answer.


Stuart
This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it.   Please do not use, copy or disclose the information contained in this message or in any attachment.  Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham.

This message has been checked for viruses but the contents of an attachment may still contain software viruses which could damage your computer system:
you are advised to perform your own checks. Email communications with the University of Nottingham may be monitored as permitted by UK legislation.
______________________________________________
[hidden email] 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.

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: 'symbols' not plotting correct circle radii

Sarah Goslee
In reply to this post by Stuart Leask
On Thursday, July 19, 2012, Stuart Leask wrote:

> (Oh, and yes I've tried setting 'inches=F', but I then get a circle
> correct on X axis,  but too large on the Y axis.)


We're back to "read the help." ?symbols explictly states that if
inches=FALSE and the axis scales are different, then the x axis coordinates
will be used.

And if your axes are different, why would you expect a *circle* to fit both
simultaneously?

Perhaps instead you need plot.ellipse from the plotrix package.


Sarah



> -----Original Message-----
> From: [hidden email] <javascript:;> [mailto:
> [hidden email] <javascript:;>] On Behalf Of Stuart Leask
> Sent: 18 July 2012 11:03
> To: [hidden email] <javascript:;>
> Subject: [R] 'symbols' not plotting correct circle radii
>
> Hi there.
>
> I have been plotting some circles using 'symbols', with radii representing
> my data, but the radii looked incorrect.
>
> It seems to happen with a single circle too:
>
> Symbols ( 0, 0, circles = 40, xlim = c(-40, 40), ylim= c(-40, 40))
>
> If I put a ruler up to my monitor (technology!)  to compare the radius
> with the axes, the circle isn't radius 40; it is closer to 15...
>
> I suspect there is a simple answer.
>


--
Sarah Goslee
http://www.stringpage.com
http://www.sarahgoslee.com
http://www.functionaldiversity.org

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: 'symbols' not plotting correct circle radii

Stuart Leask
You're right - easily tested by just re-sizing the graphics box - sort of counter-intuitive until I remember the clue is in the name - this generates a CIRCLE, come what may...

Stuart

From: Sarah Goslee [mailto:[hidden email]]
Sent: 19 July 2012 11:18
To: Stuart Leask
Cc: [hidden email]
Subject: Re: [R] 'symbols' not plotting correct circle radii



On Thursday, July 19, 2012, Stuart Leask wrote:
(Oh, and yes I've tried setting 'inches=F', but I then get a circle correct on X axis,  but too large on the Y axis.)

We're back to "read the help." ?symbols explictly states that if inches=FALSE and the axis scales are different, then the x axis coordinates will be used.

And if your axes are different, why would you expect a *circle* to fit both simultaneously?

Perhaps instead you need plot.ellipse from the plotrix package.


Sarah



-----Original Message-----
From: [hidden email]<javascript:;> [mailto:[hidden email]<javascript:;>] On Behalf Of Stuart Leask
Sent: 18 July 2012 11:03
To: [hidden email]<javascript:;>
Subject: [R] 'symbols' not plotting correct circle radii

Hi there.

I have been plotting some circles using 'symbols', with radii representing my data, but the radii looked incorrect.

It seems to happen with a single circle too:

Symbols ( 0, 0, circles = 40, xlim = c(-40, 40), ylim= c(-40, 40))

If I put a ruler up to my monitor (technology!)  to compare the radius with the axes, the circle isn't radius 40; it is closer to 15...

I suspect there is a simple answer.


--
Sarah Goslee
http://www.stringpage.com
http://www.sarahgoslee.com
http://www.functionaldiversity.org
This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it.   Please do not use, copy or disclose the information contained in this message or in any attachment.  Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham.

This message has been checked for viruses but the contents of an attachment
may still contain software viruses which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.
        [[alternative HTML version deleted]]

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: 'symbols' not plotting correct circle radii

Jim Lemon
On 07/20/2012 12:33 AM, Stuart Leask wrote:

> You're right - easily tested by just re-sizing the graphics box - sort of counter-intuitive until I remember the clue is in the name - this generates a CIRCLE, come what may...
>
> Stuart
>
> From: Sarah Goslee [mailto:[hidden email]]
> Sent: 19 July 2012 11:18
> To: Stuart Leask
> Cc: [hidden email]
> Subject: Re: [R] 'symbols' not plotting correct circle radii
>
>
>
> On Thursday, July 19, 2012, Stuart Leask wrote:
> (Oh, and yes I've tried setting 'inches=F', but I then get a circle correct on X axis,  but too large on the Y axis.)
>
> We're back to "read the help." ?symbols explictly states that if inches=FALSE and the axis scales are different, then the x axis coordinates will be used.
>
> And if your axes are different, why would you expect a *circle* to fit both simultaneously?
>
> Perhaps instead you need plot.ellipse from the plotrix package.
>
>
Hi all,
You might want to use draw.circle from the plotrix package, as it tries
to compensate for different axis scales.

Jim

______________________________________________
[hidden email] 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.
Loading...