An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20090427/0ab8a72d/attachment-0001.pl>
problem with symbol function
17 messages · Andrew Dolman, Duncan Murdoch, Joshua Wiley +2 more
Hi Christophe, I am able to plot dashed circles on Windows. I'm afraid I do not have any suggestions for you. What happens when you try to plot it on Windows? Joshua Wiley ---- Original message ----
Date: Mon, 27 Apr 2009 22:15:53 +0200 From: r-help-bounces at r-project.org (on behalf of Christophe Dutang <dutangc at gmail.com>) Subject: [R] problem with symbol function To: r-help at r-project.org Hi all, I use the symbol functions to draw circles. But the argument lty does not work on windows but works correctly on my macbook: x <- -4:4 y <- -4:4 plot(x,y,type="n") symbols(0, 0, add = TRUE, circles = 1, inches = 1, fg="black", lty="solid") symbols(0, 0, add = TRUE, circles = 1, inches = 2, fg="black", lty="dashed") The second circle should be drawn with dash... it works on my macbook but on my PC. I use R 2.9.0 on windows xp home and mac os 10.5. Does anyone have this problem? is it a limitation of windows? thanks in advance Christophe -- Christophe Dutang Ph. D. student at ISFA, Lyon, France website: http://dutangc.free.fr [[alternative HTML version deleted]]
______________________________________________ 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.
it just plot solid lines? I also have a similar problem on my PC at the office, which run XP pro... Le 27 avr. 09 ? 22:29, Joshua Wiley a ?crit :
Hi Christophe, I am able to plot dashed circles on Windows. I'm afraid I do not have any suggestions for you. What happens when you try to plot it on Windows? Joshua Wiley ---- Original message ----
Date: Mon, 27 Apr 2009 22:15:53 +0200 From: r-help-bounces at r-project.org (on behalf of Christophe Dutang <dutangc at gmail.com
)
Subject: [R] problem with symbol function To: r-help at r-project.org Hi all, I use the symbol functions to draw circles. But the argument lty does not work on windows but works correctly on my macbook: x <- -4:4 y <- -4:4 plot(x,y,type="n") symbols(0, 0, add = TRUE, circles = 1, inches = 1, fg="black", lty="solid") symbols(0, 0, add = TRUE, circles = 1, inches = 2, fg="black", lty="dashed") The second circle should be drawn with dash... it works on my macbook but on my PC. I use R 2.9.0 on windows xp home and mac os 10.5. Does anyone have this problem? is it a limitation of windows? thanks in advance Christophe -- Christophe Dutang Ph. D. student at ISFA, Lyon, France website: http://dutangc.free.fr [[alternative HTML version deleted]]
______________________________________________ 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.
-- Christophe Dutang Ph. D. student at ISFA, Lyon, France website: http://dutangc.free.fr
what is your service pack version? at home I use the SP2 version. Le 27 avr. 09 ? 22:29, Joshua Wiley a ?crit :
Hi Christophe, I am able to plot dashed circles on Windows. I'm afraid I do not have any suggestions for you. What happens when you try to plot it on Windows? Joshua Wiley ---- Original message ----
Date: Mon, 27 Apr 2009 22:15:53 +0200 From: r-help-bounces at r-project.org (on behalf of Christophe Dutang <dutangc at gmail.com
)
Subject: [R] problem with symbol function To: r-help at r-project.org Hi all, I use the symbol functions to draw circles. But the argument lty does not work on windows but works correctly on my macbook: x <- -4:4 y <- -4:4 plot(x,y,type="n") symbols(0, 0, add = TRUE, circles = 1, inches = 1, fg="black", lty="solid") symbols(0, 0, add = TRUE, circles = 1, inches = 2, fg="black", lty="dashed") The second circle should be drawn with dash... it works on my macbook but on my PC. I use R 2.9.0 on windows xp home and mac os 10.5. Does anyone have this problem? is it a limitation of windows? thanks in advance Christophe -- Christophe Dutang Ph. D. student at ISFA, Lyon, France website: http://dutangc.free.fr [[alternative HTML version deleted]]
______________________________________________ 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.
-- Christophe Dutang Ph. D. student at ISFA, Lyon, France website: http://dutangc.free.fr
I am running SP3. You said earlier that you were having trouble downloading 2.9.0, are you sure everything downloaded and installed properly? There have been some questions about transitioning to the new build going around. Joshua Wiley ---- Original message ----
Date: Mon, 27 Apr 2009 22:45:26 +0200 From: Christophe Dutang <dutangc at gmail.com> Subject: Re: [R] problem with symbol function To: Joshua Wiley <jwile004 at ucr.edu> Cc: r-help at r-project.org what is your service pack version? at home I use the SP2 version. Le 27 avr. 09 ? 22:29, Joshua Wiley a ?crit :
Hi Christophe, I am able to plot dashed circles on Windows. I'm afraid I do not have any suggestions for you. What happens when you try to plot it on Windows? Joshua Wiley ---- Original message ----
Date: Mon, 27 Apr 2009 22:15:53 +0200 From: r-help-bounces at r-project.org (on behalf of Christophe Dutang <dutangc at gmail.com
)
Subject: [R] problem with symbol function To: r-help at r-project.org Hi all, I use the symbol functions to draw circles. But the argument lty does not work on windows but works correctly on my macbook: x <- -4:4 y <- -4:4 plot(x,y,type="n") symbols(0, 0, add = TRUE, circles = 1, inches = 1, fg="black", lty="solid") symbols(0, 0, add = TRUE, circles = 1, inches = 2, fg="black", lty="dashed") The second circle should be drawn with dash... it works on my macbook but on my PC. I use R 2.9.0 on windows xp home and mac os 10.5. Does anyone have this problem? is it a limitation of windows? thanks in advance Christophe -- Christophe Dutang Ph. D. student at ISFA, Lyon, France website: http://dutangc.free.fr [[alternative HTML version deleted]]
______________________________________________ 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.
-- Christophe Dutang Ph. D. student at ISFA, Lyon, France website: http://dutangc.free.fr
This point is ok if I download R from the Austrian mirror. R is properly install on both computers. I also get this strange behavior with R 2.7.2. There is something I'm missing... Le 27 avr. 09 ? 22:54, Joshua Wiley a ?crit :
I am running SP3. You said earlier that you were having trouble downloading 2.9.0, are you sure everything downloaded and installed properly? There have been some questions about transitioning to the new build going around. Joshua Wiley ---- Original message ----
Date: Mon, 27 Apr 2009 22:45:26 +0200 From: Christophe Dutang <dutangc at gmail.com> Subject: Re: [R] problem with symbol function To: Joshua Wiley <jwile004 at ucr.edu> Cc: r-help at r-project.org what is your service pack version? at home I use the SP2 version. Le 27 avr. 09 ? 22:29, Joshua Wiley a ?crit :
Hi Christophe, I am able to plot dashed circles on Windows. I'm afraid I do not have any suggestions for you. What happens when you try to plot it on Windows? Joshua Wiley ---- Original message ----
Date: Mon, 27 Apr 2009 22:15:53 +0200 From: r-help-bounces at r-project.org (on behalf of Christophe Dutang <dutangc at gmail.com
)
Subject: [R] problem with symbol function To: r-help at r-project.org Hi all, I use the symbol functions to draw circles. But the argument lty does not work on windows but works correctly on my macbook: x <- -4:4 y <- -4:4 plot(x,y,type="n") symbols(0, 0, add = TRUE, circles = 1, inches = 1, fg="black", lty="solid") symbols(0, 0, add = TRUE, circles = 1, inches = 2, fg="black", lty="dashed") The second circle should be drawn with dash... it works on my macbook but on my PC. I use R 2.9.0 on windows xp home and mac os 10.5. Does anyone have this problem? is it a limitation of windows? thanks in advance Christophe -- Christophe Dutang Ph. D. student at ISFA, Lyon, France website: http://dutangc.free.fr [[alternative HTML version deleted]]
______________________________________________ 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.
-- Christophe Dutang Ph. D. student at ISFA, Lyon, France website: http://dutangc.free.fr
-- Christophe Dutang Ph. D. student at ISFA, Lyon, France website: http://dutangc.free.fr
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20090427/9445b55d/attachment-0001.pl>
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20090427/f6c5d3dc/attachment-0001.pl>
I read that the lty=2 argument does not work on all graphics devices. You might double check that since it works on mac. Joshua Wiley ---- Original message ----
Date: Mon, 27 Apr 2009 22:58:11 +0200 From: Christophe Dutang <dutangc at gmail.com> Subject: Re: [R] problem with symbol function To: Joshua Wiley <jwile004 at ucr.edu> Cc: r-help at r-project.org This point is ok if I download R from the Austrian mirror. R is properly install on both computers. I also get this strange behavior with R 2.7.2. There is something I'm missing... Le 27 avr. 09 ? 22:54, Joshua Wiley a ?crit :
I am running SP3. You said earlier that you were having trouble downloading 2.9.0, are you sure everything downloaded and installed properly? There have been some questions about transitioning to the new build going around. Joshua Wiley ---- Original message ----
Date: Mon, 27 Apr 2009 22:45:26 +0200 From: Christophe Dutang <dutangc at gmail.com> Subject: Re: [R] problem with symbol function To: Joshua Wiley <jwile004 at ucr.edu> Cc: r-help at r-project.org what is your service pack version? at home I use the SP2 version. Le 27 avr. 09 ? 22:29, Joshua Wiley a ?crit :
Hi Christophe, I am able to plot dashed circles on Windows. I'm afraid I do not have any suggestions for you. What happens when you try to plot it on Windows? Joshua Wiley ---- Original message ----
Date: Mon, 27 Apr 2009 22:15:53 +0200 From: r-help-bounces at r-project.org (on behalf of Christophe Dutang <dutangc at gmail.com
)
Subject: [R] problem with symbol function To: r-help at r-project.org Hi all, I use the symbol functions to draw circles. But the argument lty does not work on windows but works correctly on my macbook: x <- -4:4 y <- -4:4 plot(x,y,type="n") symbols(0, 0, add = TRUE, circles = 1, inches = 1, fg="black", lty="solid") symbols(0, 0, add = TRUE, circles = 1, inches = 2, fg="black", lty="dashed") The second circle should be drawn with dash... it works on my macbook but on my PC. I use R 2.9.0 on windows xp home and mac os 10.5. Does anyone have this problem? is it a limitation of windows? thanks in advance Christophe -- Christophe Dutang Ph. D. student at ISFA, Lyon, France website: http://dutangc.free.fr [[alternative HTML version deleted]]
______________________________________________ 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.
-- Christophe Dutang Ph. D. student at ISFA, Lyon, France website: http://dutangc.free.fr
-- Christophe Dutang Ph. D. student at ISFA, Lyon, France website: http://dutangc.free.fr
On 27/04/2009 4:29 PM, Joshua Wiley wrote:
Hi Christophe, I am able to plot dashed circles on Windows. I'm afraid I do not have any suggestions for you. What happens when you try to plot it on Windows?
Were you using the same code as Christophe? I see what he saw: the circle comes out with a solid line. Duncan Murdoch
Joshua Wiley ---- Original message ----
Date: Mon, 27 Apr 2009 22:15:53 +0200 From: r-help-bounces at r-project.org (on behalf of Christophe Dutang <dutangc at gmail.com>) Subject: [R] problem with symbol function To: r-help at r-project.org Hi all, I use the symbol functions to draw circles. But the argument lty does not work on windows but works correctly on my macbook: x <- -4:4 y <- -4:4 plot(x,y,type="n") symbols(0, 0, add = TRUE, circles = 1, inches = 1, fg="black", lty="solid") symbols(0, 0, add = TRUE, circles = 1, inches = 2, fg="black", lty="dashed") The second circle should be drawn with dash... it works on my macbook but on my PC. I use R 2.9.0 on windows xp home and mac os 10.5. Does anyone have this problem? is it a limitation of windows? thanks in advance Christophe -- Christophe Dutang Ph. D. student at ISFA, Lyon, France website: http://dutangc.free.fr [[alternative HTML version deleted]]
______________________________________________ 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.
______________________________________________ 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.
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20090427/50013f4e/attachment-0001.pl>
On 27/04/2009 5:23 PM, Christophe Dutang wrote:
so it could be a limitation of graphics on windows?
It's not graphics on Windows, but it appears to be a limitation of the
windows() graphics device in R. It is used for bitmap plots as well as
on-screen plots, which is why you saw the same effect in jpeg, but
different devices are used for Postscript and PDF.
When drawing lines, R handles the dash style itself, rather than using
the built-in dashes. But it doesn't do so for circles, and doesn't make
use of the Windows line styles.
If you really need the dashes onscreen, you can draw the circle
yourself. Assuming the scales are equal on both axes that's easy, just use
> theta <- seq(0,2*pi, len=256)
> lines(x+r*cos(theta), y+r*sin(theta), lty="dashed")
(where (x,y) is the center and r is the radius). It's more work if you
want things to appear as circles when the scales are unequal, but I
think this works:
circle <- function(x, y, inches=1, ...) {
theta <- seq(0, 2*pi, len=256)
lines(x + grconvertX(inches*cos(theta), "inches", "user") -
grconvertX(0, "inches", "user"),
y + grconvertY(inches*sin(theta), "inches", "user") -
grconvertY(0, "inches", "user"),
...)
}
so you'd get the plot you wanted using
circle(0, 0, inches = 1.5, fg="black",lty="dashed")
The circle function is not vectorized, so it's not as useful as symbols,
but it could be improved.
Duncan Murdoch
It also appears with "long dash" lines. x <- -4:4 y <- -4:4 plot(x,y,type="n") symbols(0, 0, add = TRUE, circles = 1, inches = 1, fg="black", lty="solid") symbols(0, 0, add = TRUE, circles = 1, inches = 2, fg="black",lty="dashed") symbols(0, 0, add = TRUE, circles = 1, inches = 3, fg="black",lty="longdash", lwd=2) Le 27 avr. 09 ? 23:07, Joshua Wiley a ?crit :
I read that the lty=2 argument does not work on all graphics devices. You might double check that since it works on mac. Joshua Wiley ---- Original message ----
Date: Mon, 27 Apr 2009 22:58:11 +0200 From: Christophe Dutang <dutangc at gmail.com> Subject: Re: [R] problem with symbol function To: Joshua Wiley <jwile004 at ucr.edu> Cc: r-help at r-project.org This point is ok if I download R from the Austrian mirror. R is properly install on both computers. I also get this strange behavior with R 2.7.2. There is something I'm missing... Le 27 avr. 09 ? 22:54, Joshua Wiley a ?crit :
I am running SP3. You said earlier that you were having trouble downloading 2.9.0, are you sure everything downloaded and installed properly? There have been some questions about transitioning to the new build going around. Joshua Wiley ---- Original message ----
Date: Mon, 27 Apr 2009 22:45:26 +0200 From: Christophe Dutang <dutangc at gmail.com> Subject: Re: [R] problem with symbol function To: Joshua Wiley <jwile004 at ucr.edu> Cc: r-help at r-project.org what is your service pack version? at home I use the SP2 version. Le 27 avr. 09 ? 22:29, Joshua Wiley a ?crit :
Hi Christophe, I am able to plot dashed circles on Windows. I'm afraid I do not have any suggestions for you. What happens when you try to plot it on Windows? Joshua Wiley ---- Original message ----
Date: Mon, 27 Apr 2009 22:15:53 +0200 From: r-help-bounces at r-project.org (on behalf of Christophe Dutang <dutangc at gmail.com
)
Subject: [R] problem with symbol function To: r-help at r-project.org Hi all, I use the symbol functions to draw circles. But the argument lty does not work on windows but works correctly on my macbook: x <- -4:4 y <- -4:4 plot(x,y,type="n") symbols(0, 0, add = TRUE, circles = 1, inches = 1, fg="black", lty="solid") symbols(0, 0, add = TRUE, circles = 1, inches = 2, fg="black", lty="dashed") The second circle should be drawn with dash... it works on my macbook but on my PC. I use R 2.9.0 on windows xp home and mac os 10.5. Does anyone have this problem? is it a limitation of windows? thanks in advance Christophe -- Christophe Dutang Ph. D. student at ISFA, Lyon, France website: http://dutangc.free.fr [[alternative HTML version deleted]]
______________________________________________ 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.
-- Christophe Dutang Ph. D. student at ISFA, Lyon, France website: http://dutangc.free.fr
-- Christophe Dutang Ph. D. student at ISFA, Lyon, France website: http://dutangc.free.fr
-- Christophe Dutang Ph. D. student at ISFA, Lyon, France website: http://dutangc.free.fr [[alternative HTML version deleted]] ------------------------------------------------------------------------
______________________________________________ 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.
My apologies; I did not use exactly his code. I usually plot directly to postscript files. Since when I manipulated the lty argument, I got the expected results (via postscript), everything seemed in order. It never occurred to me that postscript would not give me the same view. I am very sorry for the inconvenience. Joshua Wiley ---- Original message ----
Date: Mon, 27 Apr 2009 17:12:18 -0400 From: Duncan Murdoch <murdoch at stats.uwo.ca> Subject: Re: [R] problem with symbol function To: Joshua Wiley <jwile004 at ucr.edu> Cc: r-help at r-project.org, Christophe Dutang <dutangc at gmail.com> On 27/04/2009 4:29 PM, Joshua Wiley wrote:
Hi Christophe, I am able to plot dashed circles on Windows. I'm afraid I do not have any suggestions for you. What happens when you try to plot it on Windows?
Were you using the same code as Christophe? I see what he saw: the circle comes out with a solid line. Duncan Murdoch
Joshua Wiley ---- Original message ----
Date: Mon, 27 Apr 2009 22:15:53 +0200 From: r-help-bounces at r-project.org (on behalf of Christophe Dutang <dutangc at gmail.com>) Subject: [R] problem with symbol function To: r-help at r-project.org Hi all, I use the symbol functions to draw circles. But the argument lty does not work on windows but works correctly on my macbook: x <- -4:4 y <- -4:4 plot(x,y,type="n") symbols(0, 0, add = TRUE, circles = 1, inches = 1, fg="black", lty="solid") symbols(0, 0, add = TRUE, circles = 1, inches = 2, fg="black", lty="dashed") The second circle should be drawn with dash... it works on my macbook but on my PC. I use R 2.9.0 on windows xp home and mac os 10.5. Does anyone have this problem? is it a limitation of windows? thanks in advance Christophe -- Christophe Dutang Ph. D. student at ISFA, Lyon, France website: http://dutangc.free.fr [[alternative HTML version deleted]]
______________________________________________ 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.
______________________________________________ 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.
ok, I'll try to use to your code or use pdf files. Thanks for all Christophe Le 28 avr. 09 ? 01:38, Joshua Wiley a ?crit :
My apologies; I did not use exactly his code. I usually plot directly to postscript files. Since when I manipulated the lty argument, I got the expected results (via postscript), everything seemed in order. It never occurred to me that postscript would not give me the same view. I am very sorry for the inconvenience. Joshua Wiley ---- Original message ----
Date: Mon, 27 Apr 2009 17:12:18 -0400 From: Duncan Murdoch <murdoch at stats.uwo.ca> Subject: Re: [R] problem with symbol function To: Joshua Wiley <jwile004 at ucr.edu> Cc: r-help at r-project.org, Christophe Dutang <dutangc at gmail.com> On 27/04/2009 4:29 PM, Joshua Wiley wrote:
Hi Christophe, I am able to plot dashed circles on Windows. I'm afraid I do not have any suggestions for you. What happens when you try to plot it on Windows?
Were you using the same code as Christophe? I see what he saw: the circle comes out with a solid line. Duncan Murdoch
Joshua Wiley ---- Original message ----
Date: Mon, 27 Apr 2009 22:15:53 +0200 From: r-help-bounces at r-project.org (on behalf of Christophe Dutang <dutangc at gmail.com>) Subject: [R] problem with symbol function To: r-help at r-project.org Hi all, I use the symbol functions to draw circles. But the argument lty does not work on windows but works correctly on my macbook: x <- -4:4 y <- -4:4 plot(x,y,type="n") symbols(0, 0, add = TRUE, circles = 1, inches = 1, fg="black", lty="solid") symbols(0, 0, add = TRUE, circles = 1, inches = 2, fg="black", lty="dashed") The second circle should be drawn with dash... it works on my macbook but on my PC. I use R 2.9.0 on windows xp home and mac os 10.5. Does anyone have this problem? is it a limitation of windows? thanks in advance Christophe -- Christophe Dutang Ph. D. student at ISFA, Lyon, France website: http://dutangc.free.fr [[alternative HTML version deleted]]
______________________________________________ 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.
______________________________________________ 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.
-- Christophe Dutang Ph. D. student at ISFA, Lyon, France website: http://dutangc.free.fr
The my.symbols function in the TeachingDemos package works here. It was designed to work like symbols, but with user defined symbols: library(TeachingDemos) theta <- seq(0, 2*pi, len=256) circ <- cbind( cos(theta), sin(theta) ) x <- runif(10) y <- rnorm(10, 100, 20) z <- runif(10, .5, 1) my.symbols(x,y, circ, inches=.3, add=FALSE) my.symbols(x,y, circ, inches=.3, lty='dashed', add=FALSE) my.symbols(x,y, circ, inches=.5*z, lty='dashed', add=FALSE)
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow at imail.org
801.408.8111
> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of Duncan Murdoch
> Sent: Monday, April 27, 2009 3:48 PM
> To: Christophe Dutang
> Cc: r-help at r-project.org
> Subject: Re: [R] problem with symbol function
>
> On 27/04/2009 5:23 PM, Christophe Dutang wrote:
> > so it could be a limitation of graphics on windows?
>
> It's not graphics on Windows, but it appears to be a limitation of the
> windows() graphics device in R. It is used for bitmap plots as well as
> on-screen plots, which is why you saw the same effect in jpeg, but
> different devices are used for Postscript and PDF.
>
> When drawing lines, R handles the dash style itself, rather than using
> the built-in dashes. But it doesn't do so for circles, and doesn't
> make
> use of the Windows line styles.
>
> If you really need the dashes onscreen, you can draw the circle
> yourself. Assuming the scales are equal on both axes that's easy, just
> use
>
> > theta <- seq(0,2*pi, len=256)
> > lines(x+r*cos(theta), y+r*sin(theta), lty="dashed")
>
> (where (x,y) is the center and r is the radius). It's more work if you
> want things to appear as circles when the scales are unequal, but I
> think this works:
>
> circle <- function(x, y, inches=1, ...) {
> theta <- seq(0, 2*pi, len=256)
> lines(x + grconvertX(inches*cos(theta), "inches", "user") -
> grconvertX(0, "inches", "user"),
> y + grconvertY(inches*sin(theta), "inches", "user") -
> grconvertY(0, "inches", "user"),
> ...)
> }
>
> so you'd get the plot you wanted using
>
> circle(0, 0, inches = 1.5, fg="black",lty="dashed")
>
> The circle function is not vectorized, so it's not as useful as
> symbols,
> but it could be improved.
>
> Duncan Murdoch
>
>
> >
> > It also appears with "long dash" lines.
> >
> > x <- -4:4
> > y <- -4:4
> >
> > plot(x,y,type="n")
> >
> > symbols(0, 0, add = TRUE, circles = 1, inches = 1, fg="black",
> > lty="solid")
> >
> > symbols(0, 0, add = TRUE, circles = 1, inches = 2,
> > fg="black",lty="dashed")
> >
> > symbols(0, 0, add = TRUE, circles = 1, inches = 3,
> > fg="black",lty="longdash", lwd=2)
> >
> >
> > Le 27 avr. 09 ? 23:07, Joshua Wiley a ?crit :
> >
> >> I read that the lty=2 argument does not work on all graphics
> >> devices. You might double check that since it works on mac.
> >>
> >>
> >> Joshua Wiley
> >>
> >>
> >>
> >> ---- Original message ----
> >>> Date: Mon, 27 Apr 2009 22:58:11 +0200
> >>> From: Christophe Dutang <dutangc at gmail.com>
> >>> Subject: Re: [R] problem with symbol function
> >>> To: Joshua Wiley <jwile004 at ucr.edu>
> >>> Cc: r-help at r-project.org
> >>>
> >>> This point is ok if I download R from the Austrian mirror. R is
> >>> properly install on both computers. I also get this strange
> behavior
> >>> with R 2.7.2. There is something I'm missing...
> >>>
> >>>
> >>> Le 27 avr. 09 ? 22:54, Joshua Wiley a ?crit :
> >>>
> >>>> I am running SP3. You said earlier that you were having trouble
> >>>> downloading 2.9.0, are you sure everything downloaded and
> installed
> >>>> properly? There have been some questions about transitioning to
> the
> >>>> new build going around.
> >>>>
> >>>> Joshua Wiley
> >>>>
> >>>>
> >>>>
> >>>> ---- Original message ----
> >>>>> Date: Mon, 27 Apr 2009 22:45:26 +0200
> >>>>> From: Christophe Dutang <dutangc at gmail.com>
> >>>>> Subject: Re: [R] problem with symbol function
> >>>>> To: Joshua Wiley <jwile004 at ucr.edu>
> >>>>> Cc: r-help at r-project.org
> >>>>>
> >>>>> what is your service pack version?
> >>>>>
> >>>>> at home I use the SP2 version.
> >>>>>
> >>>>> Le 27 avr. 09 ? 22:29, Joshua Wiley a ?crit :
> >>>>>
> >>>>>> Hi Christophe,
> >>>>>>
> >>>>>> I am able to plot dashed circles on Windows. I'm afraid I do not
> >>>>>> have any suggestions for you. What happens when you try to plot
> it
> >>>>>> on Windows?
> >>>>>>
> >>>>>>
> >>>>>> Joshua Wiley
> >>>>>>
> >>>>>>
> >>>>>> ---- Original message ----
> >>>>>>> Date: Mon, 27 Apr 2009 22:15:53 +0200
> >>>>>>> From: r-help-bounces at r-project.org (on behalf of Christophe
> >>>>>>> Dutang <dutangc at gmail.com
> >>>>>>>> )
> >>>>>>> Subject: [R] problem with symbol function
> >>>>>>> To: r-help at r-project.org
> >>>>>>>
> >>>>>>> Hi all,
> >>>>>>>
> >>>>>>> I use the symbol functions to draw circles. But the argument
> lty
> >>>>>>> does
> >>>>>>> not work on windows but works correctly on my macbook:
> >>>>>>>
> >>>>>>> x <- -4:4
> >>>>>>> y <- -4:4
> >>>>>>>
> >>>>>>> plot(x,y,type="n")
> >>>>>>>
> >>>>>>> symbols(0, 0, add = TRUE, circles = 1, inches = 1, fg="black",
> >>>>>>> lty="solid")
> >>>>>>>
> >>>>>>> symbols(0, 0, add = TRUE, circles = 1, inches = 2, fg="black",
> >>>>>>> lty="dashed")
> >>>>>>>
> >>>>>>>
> >>>>>>> The second circle should be drawn with dash... it works on my
> >>>>>>> macbook
> >>>>>>> but on my PC.
> >>>>>>>
> >>>>>>> I use R 2.9.0 on windows xp home and mac os 10.5.
> >>>>>>>
> >>>>>>> Does anyone have this problem? is it a limitation of windows?
> >>>>>>>
> >>>>>>> thanks in advance
> >>>>>>>
> >>>>>>>
> >>>>>>> Christophe
> >>>>>>>
> >>>>>>> --
> >>>>>>> Christophe Dutang
> >>>>>>> Ph. D. student at ISFA, Lyon, France
> >>>>>>> website: http://dutangc.free.fr
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>> [[alternative HTML version deleted]]
> >>>>>>>
> >>>>>>> ______________________________________________
> >>>>>>> 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.
> >>>>> --
> >>>>> Christophe Dutang
> >>>>> Ph. D. student at ISFA, Lyon, France
> >>>>> website: http://dutangc.free.fr
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>> --
> >>> Christophe Dutang
> >>> Ph. D. student at ISFA, Lyon, France
> >>> website: http://dutangc.free.fr
> >>>
> >>>
> >>>
> >>>
> >
> > --
> > Christophe Dutang
> > Ph. D. student at ISFA, Lyon, France
> > website: http://dutangc.free.fr
> >
> >
> >
> >
> >
> > [[alternative HTML version deleted]]
> >
> >
> >
> > ---------------------------------------------------------------------
> ---
> >
> > ______________________________________________
> > 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.
>
> ______________________________________________
> 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.
Based on your solution, could we not fix this issue for the symbol function? Le 27 avr. 09 ? 23:47, Duncan Murdoch a ?crit :
On 27/04/2009 5:23 PM, Christophe Dutang wrote:
so it could be a limitation of graphics on windows?
It's not graphics on Windows, but it appears to be a limitation of the windows() graphics device in R. It is used for bitmap plots as well as on-screen plots, which is why you saw the same effect in jpeg, but different devices are used for Postscript and PDF. When drawing lines, R handles the dash style itself, rather than using the built-in dashes. But it doesn't do so for circles, and doesn't make use of the Windows line styles. If you really need the dashes onscreen, you can draw the circle yourself. Assuming the scales are equal on both axes that's easy, just use
theta <- seq(0,2*pi, len=256) lines(x+r*cos(theta), y+r*sin(theta), lty="dashed")
(where (x,y) is the center and r is the radius). It's more work if
you want things to appear as circles when the scales are unequal,
but I think this works:
circle <- function(x, y, inches=1, ...) {
theta <- seq(0, 2*pi, len=256)
lines(x + grconvertX(inches*cos(theta), "inches", "user") -
grconvertX(0, "inches", "user"),
y + grconvertY(inches*sin(theta), "inches", "user") -
grconvertY(0, "inches", "user"),
...)
}
so you'd get the plot you wanted using
circle(0, 0, inches = 1.5, fg="black",lty="dashed")
The circle function is not vectorized, so it's not as useful as
symbols, but it could be improved.
Duncan Murdoch
It also appears with "long dash" lines. x <- -4:4 y <- -4:4 plot(x,y,type="n") symbols(0, 0, add = TRUE, circles = 1, inches = 1, fg="black", lty="solid") symbols(0, 0, add = TRUE, circles = 1, inches = 2, fg="black",lty="dashed") symbols(0, 0, add = TRUE, circles = 1, inches = 3, fg="black",lty="longdash", lwd=2) Le 27 avr. 09 ? 23:07, Joshua Wiley a ?crit :
I read that the lty=2 argument does not work on all graphics devices. You might double check that since it works on mac. Joshua Wiley ---- Original message ----
Date: Mon, 27 Apr 2009 22:58:11 +0200 From: Christophe Dutang <dutangc at gmail.com> Subject: Re: [R] problem with symbol function To: Joshua Wiley <jwile004 at ucr.edu> Cc: r-help at r-project.org This point is ok if I download R from the Austrian mirror. R is properly install on both computers. I also get this strange behavior with R 2.7.2. There is something I'm missing... Le 27 avr. 09 ? 22:54, Joshua Wiley a ?crit :
I am running SP3. You said earlier that you were having trouble downloading 2.9.0, are you sure everything downloaded and installed properly? There have been some questions about transitioning to the new build going around. Joshua Wiley ---- Original message ----
Date: Mon, 27 Apr 2009 22:45:26 +0200 From: Christophe Dutang <dutangc at gmail.com> Subject: Re: [R] problem with symbol function To: Joshua Wiley <jwile004 at ucr.edu> Cc: r-help at r-project.org what is your service pack version? at home I use the SP2 version. Le 27 avr. 09 ? 22:29, Joshua Wiley a ?crit :
Hi Christophe, I am able to plot dashed circles on Windows. I'm afraid I do not have any suggestions for you. What happens when you try to plot it on Windows? Joshua Wiley ---- Original message ----
Date: Mon, 27 Apr 2009 22:15:53 +0200 From: r-help-bounces at r-project.org (on behalf of Christophe Dutang <dutangc at gmail.com
)
Subject: [R] problem with symbol function To: r-help at r-project.org Hi all, I use the symbol functions to draw circles. But the argument lty does not work on windows but works correctly on my macbook: x <- -4:4 y <- -4:4 plot(x,y,type="n") symbols(0, 0, add = TRUE, circles = 1, inches = 1, fg="black", lty="solid") symbols(0, 0, add = TRUE, circles = 1, inches = 2, fg="black", lty="dashed") The second circle should be drawn with dash... it works on my macbook but on my PC. I use R 2.9.0 on windows xp home and mac os 10.5. Does anyone have this problem? is it a limitation of windows? thanks in advance Christophe -- Christophe Dutang Ph. D. student at ISFA, Lyon, France website: http://dutangc.free.fr [[alternative HTML version deleted]]
______________________________________________ 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.
-- Christophe Dutang Ph. D. student at ISFA, Lyon, France website: http://dutangc.free.fr
-- Christophe Dutang Ph. D. student at ISFA, Lyon, France website: http://dutangc.free.fr
-- Christophe Dutang Ph. D. student at ISFA, Lyon, France website: http://dutangc.free.fr [[alternative HTML version deleted]] ------------------------------------------------------------------------
______________________________________________ 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.
-- Christophe Dutang Ph. D. student at ISFA, Lyon, France website: http://dutangc.free.fr
Christophe Dutang wrote:
Based on your solution, could we not fix this issue for the symbol function?
Sure, send a patch. Duncan Murdoch
Le 27 avr. 09 ? 23:47, Duncan Murdoch a ?crit :
On 27/04/2009 5:23 PM, Christophe Dutang wrote:
so it could be a limitation of graphics on windows?
It's not graphics on Windows, but it appears to be a limitation of
the windows() graphics device in R. It is used for bitmap plots as
well as on-screen plots, which is why you saw the same effect in
jpeg, but different devices are used for Postscript and PDF.
When drawing lines, R handles the dash style itself, rather than
using the built-in dashes. But it doesn't do so for circles, and
doesn't make use of the Windows line styles.
If you really need the dashes onscreen, you can draw the circle
yourself. Assuming the scales are equal on both axes that's easy,
just use
theta <- seq(0,2*pi, len=256)
lines(x+r*cos(theta), y+r*sin(theta), lty="dashed")
(where (x,y) is the center and r is the radius). It's more work if
you want things to appear as circles when the scales are unequal,
but I think this works:
circle <- function(x, y, inches=1, ...) {
theta <- seq(0, 2*pi, len=256)
lines(x + grconvertX(inches*cos(theta), "inches", "user") -
grconvertX(0, "inches", "user"),
y + grconvertY(inches*sin(theta), "inches", "user") -
grconvertY(0, "inches", "user"),
...)
}
so you'd get the plot you wanted using
circle(0, 0, inches = 1.5, fg="black",lty="dashed")
The circle function is not vectorized, so it's not as useful as
symbols, but it could be improved.
Duncan Murdoch
It also appears with "long dash" lines.
x <- -4:4
y <- -4:4
plot(x,y,type="n")
symbols(0, 0, add = TRUE, circles = 1, inches = 1, fg="black",
lty="solid")
symbols(0, 0, add = TRUE, circles = 1, inches = 2,
fg="black",lty="dashed")
symbols(0, 0, add = TRUE, circles = 1, inches = 3,
fg="black",lty="longdash", lwd=2)
Le 27 avr. 09 ? 23:07, Joshua Wiley a ?crit :
I read that the lty=2 argument does not work on all graphics
devices. You might double check that since it works on mac.
Joshua Wiley
---- Original message ----
Date: Mon, 27 Apr 2009 22:58:11 +0200
From: Christophe Dutang <dutangc at gmail.com>
Subject: Re: [R] problem with symbol function
To: Joshua Wiley <jwile004 at ucr.edu>
Cc: r-help at r-project.org
This point is ok if I download R from the Austrian mirror. R is
properly install on both computers. I also get this strange
behavior
with R 2.7.2. There is something I'm missing...
Le 27 avr. 09 ? 22:54, Joshua Wiley a ?crit :
I am running SP3. You said earlier that you were having trouble
downloading 2.9.0, are you sure everything downloaded and
installed
properly? There have been some questions about transitioning to
the
new build going around.
Joshua Wiley
---- Original message ----
Date: Mon, 27 Apr 2009 22:45:26 +0200
From: Christophe Dutang <dutangc at gmail.com>
Subject: Re: [R] problem with symbol function
To: Joshua Wiley <jwile004 at ucr.edu>
Cc: r-help at r-project.org
what is your service pack version?
at home I use the SP2 version.
Le 27 avr. 09 ? 22:29, Joshua Wiley a ?crit :
Hi Christophe,
I am able to plot dashed circles on Windows. I'm afraid I do not
have any suggestions for you. What happens when you try to
plot it
on Windows?
Joshua Wiley
---- Original message ----
Date: Mon, 27 Apr 2009 22:15:53 +0200
From: r-help-bounces at r-project.org (on behalf of Christophe
Dutang <dutangc at gmail.com
)
Subject: [R] problem with symbol function To: r-help at r-project.org Hi all, I use the symbol functions to draw circles. But the argument lty does not work on windows but works correctly on my macbook: x <- -4:4 y <- -4:4 plot(x,y,type="n") symbols(0, 0, add = TRUE, circles = 1, inches = 1, fg="black", lty="solid") symbols(0, 0, add = TRUE, circles = 1, inches = 2, fg="black", lty="dashed") The second circle should be drawn with dash... it works on my macbook but on my PC. I use R 2.9.0 on windows xp home and mac os 10.5. Does anyone have this problem? is it a limitation of windows? thanks in advance Christophe -- Christophe Dutang Ph. D. student at ISFA, Lyon, France website: http://dutangc.free.fr [[alternative HTML version deleted]]
______________________________________________ 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.
-- Christophe Dutang Ph. D. student at ISFA, Lyon, France website: http://dutangc.free.fr
-- Christophe Dutang Ph. D. student at ISFA, Lyon, France website: http://dutangc.free.fr
-- Christophe Dutang Ph. D. student at ISFA, Lyon, France website: http://dutangc.free.fr [[alternative HTML version deleted]] ------------------------------------------------------------------------
______________________________________________ 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.
-- Christophe Dutang Ph. D. student at ISFA, Lyon, France website: http://dutangc.free.fr