MichaelChirico / r-bugs

A ⚠️read-only⚠️mirror of https://bugs.r-project.org/
20 stars 0 forks source link

[BUGZILLA #5328] wishlist item: symbols() to accept asp argument? #1964

Open MichaelChirico opened 4 years ago

MichaelChirico commented 4 years ago

From: Stephen Eglen <stephen@<::CENSORED -- SEE ORIGINAL ON BUGZILLA::>> Here is a potential wishlist item for adding an argument (asp) to symbols(). The following code produces a postscript file with two pages; both should show a circle of radius 2 units. Horizonal and vertical arrows are drawn to check that the circle is of the correct radius; in the first plot, the circle is wrong. To fix this, I found that I needed to first set up the plot bounds, using xlim, ylim and setting asp=1 so that the units are of the same size. (Below uses the postscript driver, but I get similar results using x11() device.)

postscript(file="circles.ps") symbols(x=6, y=6, circles=2, inches=F) arrows( 6, 6, 8, 6) #horiz radius, OK arrows( 6, 6, 6, 8) #vert radius, not OK.

## better version, but must set up axes first, and guess ylim plot(NA, xlim=c(1,10), ylim=c(4,10), asp=1) symbols(x=6, y=6, circles=2, inches=F, xlim=c(1,10), add=T) arrows( 6, 6, 8, 6) #horiz radius, OK arrows( 6, 6, 6, 8) #vert radius, OK. dev.off()

My suggestion is whether asp can be set within symbols(), such that

symbols(x=6, y=6, circles=2, inches=F, asp=1)

would then ensure that the circle is drawn correctly.

Thanks, Stephen

version
     _                

platform i686-pc-linux-gnu arch i686
os linux-gnu
system i686, linux-gnu
status
major 1
minor 8.1
year 2003
month 11
day 21
language R


METADATA

MichaelChirico commented 4 years ago

From: Prof Brian Ripley <ripley@<::CENSORED -- SEE ORIGINAL ON BUGZILLA::>> It's rather your peculiar example. If you give more than one circle, asp=1 is accepted and does work (with warnings).

Symbols is not designed for one symbol (as its name says), and the way it sets up xlim and ylim in the R code asp=1 does not work for a single symbol. In the same way plot(10, asp=1) does not work (and for the same reason).

That's not to say that it could not be fixed, but the issue is not that asp does not work with symbols() but rather that plot(10, asp=1) does not work.

Arrows is designed to work with vector too ....

On Wed, 26 Nov 2003 stephen@<::CENSORED -- SEE ORIGINAL ON BUGZILLA::> wrote:

Here is a potential wishlist item for adding an argument (asp) to
symbols().  The following code produces a postscript file with two
pages; both should show a circle of radius 2 units.  Horizonal and
vertical arrows are drawn to check that the circle is of the correct
radius; in the first plot, the circle is wrong.  To fix this, I found
that I needed to first set up the plot bounds, using xlim, ylim and
setting asp=1 so that the units are of the same size.  (Below uses the
postscript driver, but I get similar results using x11() device.)

postscript(file="circles.ps")
symbols(x=6, y=6, circles=2, inches=F)
arrows( 6, 6, 8, 6)       #horiz radius, OK
arrows( 6, 6, 6, 8)       #vert  radius, not OK.

## better version, but must set up axes first, and guess ylim
plot(NA, xlim=c(1,10), ylim=c(4,10), asp=1)
symbols(x=6, y=6, circles=2, inches=F, xlim=c(1,10), add=T)
arrows( 6, 6, 8, 6)       #horiz radius, OK
arrows( 6, 6, 6, 8)       #vert  radius, OK.
dev.off()

My suggestion is whether asp can be set within symbols(), such that

symbols(x=6, y=6, circles=2, inches=F, asp=1)

would then ensure that the circle is drawn correctly.

-- Brian D. Ripley, ripley@<::CENSORED -- SEE ORIGINAL ON BUGZILLA::> Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ <CENSORING FROM DETECTED PHONE NUMBER ONWARDS; SEE BUGZILLA>


METADATA

MichaelChirico commented 4 years ago

NOTES: wishlist, but the example fails as only a single point is given


METADATA

MichaelChirico commented 4 years ago

Audit (from Jitterbug): Mon Dec 8 13:59:35 2003 ripley changed notes Mon Dec 8 13:59:35 2003 ripley foobar Mon Dec 8 13:59:35 2003 ripley moved from incoming to wishlist


METADATA