Ask Your Question
2

csc plotting help

asked 2021-03-23 17:17:18 +0100

mzagrabe gravatar image

updated 2024-07-09 08:26:04 +0100

FrédéricC gravatar image

Hello,

I'm new to SAGE and am having trouble plotting a cosecant (csc) curve.

Here is my input:

plot(csc(x), (x,-3*pi, 3 * pi))

but the output doesn't show the curves approaching the asymptotes as I would expect.

What do folks think about this?

Thanks for the help!

-matt

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
3

answered 2021-03-23 18:03:06 +0100

tmonteil gravatar image

I would say that the plotting is messed with points of very high ordinate. To fix this, you can first give a name to your plot:

sage: p = plot(csc(x), (x,-3*pi, 3 * pi))

And then render it by limiting the ordinate, say, to the interval $[-4,4]$:

sage: p.show(ymin=-4, ymax=4)
edit flag offensive delete link more

Comments

Thanks for the tip, Thierry! It looks good now.

mzagrabe gravatar imagemzagrabe ( 2021-03-23 19:11:21 +0100 )edit

@mzagrabe -- if it solves your question, please accept the answer by clicking the check mark at its top left (below the question's score). This will mark the question as solved in the list of questions.

slelievre gravatar imageslelievre ( 2021-03-23 22:10:06 +0100 )edit
1

Alternative solution : add the ym{in|ax} arguments to the plot call :

plot(csc(x), (x,-3*pi, 3 * pi), ymin=-4, ymax=4)

HTH,

Emmanuel Charpentier gravatar imageEmmanuel Charpentier ( 2021-03-24 00:59:45 +0100 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2021-03-23 17:17:18 +0100

Seen: 654 times

Last updated: Mar 23 '21