i've noticed a strange problem when plotting a stepfun.

according to the documentation, the xlim parameter should bound the
range of the function being plotted, and is returned as the extreme
two values (i.e. first and last) in the vector t from the plot.stepfun
call.  instead, it plots beyond the desired range (although the limits
are preserved for the viewing space).

to reproduce:

foo <- stepfun(0.5, c(1, 0));
bar <- plot(foo, xlim = c(0, 1));

now look at the plot, notice how the function extends beyond the
desired range.  also look at bar, which contains the vector t showing
the actual bounds (-1, 2) chosen by the function:

$t
[1] -1.0 0.5 2.0

does anyone have an idea for me to limit the plotted function to the
specified extreme values (in this example c(0, 1))?

______________________________________________
R-help@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.

Reply via email to