Plotting Functions with Asymptotes

Description

We will be plotting a function with vertical asymptotes using multiple plotting functions. Due to the nature of the way Sage generates graphs, not using these options will likely result in a graph with an enormous range and inaccurate function values near the asymptotes. Specifically, we will be setting ymin, ymax, and detect_poles.

Sage Cell

Setting ymin and ymax prevents Sage from plotting on a range in the thousands, while setting detect_poles=True prevents Sage from mistakenly graphing on the asymptote (for this example, had we not set detect_poles=True we would have seen a line on \$-2\$ and \$2\$).

Code

plot(1/(x^3 -x ), -2, 2, ymin=-5, ymax=5, detect_poles=True)

Options

Option

Showing the asymptotes with a dashed line. Simply set select_poles='show'. Note the single quotes around 'show' because show is not a Sage keyword.

Code

plot(1/(x^3 -x ), -2, 2, ymin=-5, ymax=5, detect_poles='show')

Tags

Primary Tags—Plotting: Two-dimensional plots; Precalculus: Rational equations and functions

Secondary Tags—Two-dimensional plots: Rectangular plots; Rational equations and functions: Asymptotes