0

I need to graph the function 1/sin(x) in matplotlib and I don't know how to find all the vertical asymptotes of the function, Python graphs them for me by mistake and I want to avoid this. What I can do?

My idea was to find the zeros of the denominator with solve in order to establish plotting intervals, but solve only gives me two zeros (0;pi) and the code does not work

JohanC
  • 71,591
  • 8
  • 33
  • 66
  • Hola, @Julio Para preguntas en español existe https://es.stackoverflow.com/ Pero también allí es aconsejado de añadir un código reproducible y explicar bien de que librería viene `solver`, y como lo has utilizado. – JohanC Aug 02 '23 at 20:33
  • Related: https://stackoverflow.com/questions/2540294/how-to-handle-an-asymptote-discontinuity-with-matplotlib and https://stackoverflow.com/questions/58520353/how-to-avoid-plotting-lines-through-discontinuities-vertical-asymptotes – JohanC Aug 02 '23 at 20:37
  • What do you mean by "graphs them for me by mistake? You said you need to graph the function. `0` and `pi` are, in fact, the two asymptotes of that function for one cycle (from 0 to 2pi). You can't find ALL the vertical asymptotes, because there are an infinite number of them: `n*pi` for every integer `n`. – Tim Roberts Aug 02 '23 at 20:37

0 Answers0