Hi Stiffler,
Duncan Murdoch wrote:
The point is that a scatterplot is a graph of real numbers, not of
integers.
Use a plot designed for a discrete data type if you don't want things
displayed as their real values ...
To drive home Duncan's point (not that it needs it) ...and to complete
Hello,
I was wondering why the plot() command ignores the datatype when displaying
axis labels. More specifically, if the data points are integers then the
axis labels should intuitively also be integers, right?
x - as.integer(c(1,2,3))
y -x
typeof(x)
[1] integer
plot(x,y)
The axis
On Tue, 2008-02-19 at 09:17 -0800, Stiffler wrote:
Hello,
I was wondering why the plot() command ignores the datatype when displaying
axis labels. More specifically, if the data points are integers then the
axis labels should intuitively also be integers, right?
x - as.integer(c(1,2,3))
Hi Stiffler,
I was wondering why the plot() command ignores the datatype when
displaying axis labels...
plot() doesn't ignore the datatype:
x - as.integer(c(1,2,3))
y -x
typeof(x)
[1] integer
mode(x)
[1] numeric
plot(x,y) calls xy.coords(), which recasts x as: x = as.double(x), which is
Gavin Simpson wrote:
PS what's the right way to get integer labels?
Do them by hand, if they are (numeric) integers
plot(x,y, axes = FALSE)
axis(2)
axis(1, at = x)
box()
You could try writing your own Axis.integer function if doing the extra
steps is a pain - something like:
Mark Difford wrote:
I was wondering why the plot() command ignores the datatype when
displaying axis labels...
plot() doesn't ignore the datatype:
[...]
plot(x,y) calls xy.coords(), which recasts x as: x = as.double(x), which
is fine, since x is (also/primarily) numeric.
HTH, Mark.
On 19/02/2008 5:40 PM, Stiffler wrote:
Mark Difford wrote:
I was wondering why the plot() command ignores the datatype when
displaying axis labels...
plot() doesn't ignore the datatype:
[...]
plot(x,y) calls xy.coords(), which recasts x as: x = as.double(x), which
is fine, since x is
On Tue, 2008-02-19 at 14:40 -0800, Stiffler wrote:
Mark Difford wrote:
I was wondering why the plot() command ignores the datatype when
displaying axis labels...
plot() doesn't ignore the datatype:
[...]
plot(x,y) calls xy.coords(), which recasts x as: x = as.double(x), which
The output from xy.coords is not being sent to Axis since if it were then
Gavin's code earlier in this thread, which does work, would not.
On Feb 19, 2008 4:08 PM, Mark Difford [EMAIL PROTECTED] wrote:
Hi Stiffler,
I was wondering why the plot() command ignores the datatype when
displaying
9 matches
Mail list logo