Ask Your Question

csc plotting help

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

mzagrabe gravatar image


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!


edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

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

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:, ymax=4)
edit flag offensive delete link more


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

mzagrabe gravatar imagemzagrabe ( 2021-03-23 19:11:21 +0200 )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 +0200 )edit

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

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


Emmanuel Charpentier gravatar imageEmmanuel Charpentier ( 2021-03-24 00:59:45 +0200 )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


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

Seen: 393 times

Last updated: Mar 23 '21