Opened 12 years ago

Last modified 12 years ago

#6895 new enhancement

Detect discontinuities when plotting the ceil function

Reported by: nbonifas Owned by: was
Priority: minor Milestone: sage-wishlist
Component: graphics Keywords:
Cc: Merged in:
Authors: Reviewers:
Report Upstream: Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description

The discontinuities in the ceil function are not detected.

Example: plot(lambda x: ceil(x), (-5,5), detect_poles='show') should not display vertical lines between the steps.

Change History (2)

comment:1 Changed 12 years ago by whuss

detect_poles is only meant for the case when the left/right side limits of the function are +/-Infinity. It was never intended to detect other discontinuities.

But ticket #6878 implements something like this. It does not automatically detect the discontinuities but lets you specify which points to exclude from the plot.

The following would have the effect you want:

sage: plot(ceil(x), (x, 1, 10), exclude = [1..10])

comment:2 Changed 12 years ago by nbonifas

I was thinking of implementing some kind of general automatic discontinuity detection, either numerical (when the numerical derivative of the function is locally above a threshold, consider this point to be a discontinuity) or via algebraic means, as in the Maple "discont" function.

Note: See TracTickets for help on using tickets.