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

Secondary Tags: Two-dimensional plots: Rectangular plots

Related Cells

Attribute

Permalink:

Author: Gregory V. Bard. Sage for Undergraduates. American Mathematical Society, Providence, RI, 2015. Available at http://www.gregorybard.com/Sage.html.

Date: 15 Feb 2019 01:20

Submitted by: Zane Corbiere

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License