y limit and Bessel function plot to file

"Jarvis Wyatt" <[email protected]>
Newsgroups gmane.comp.python.scientific.user
Message-ID <trinity-2d77e665-8dc3-443b-ad4f-a43afb8d68ea-1540485345650@3c-app-mailcom-bs06>
Hello!
I am new to SciPy, and with only a basic knowledge about Python. Using
Python 3, I am considering the code in this page

http://ctan.math.washington.edu/tex-archive/macros/latex/contrib/hybrid-latex/examples/example-04.pdf

It has been written for the Bessel function of the first kind. I am trying
to adapt it for the Bessel function of the second kind. Being interested
only in generating an output file, the useful lines in my case are just:

#!/usr/bin/python3

import numpy as np
import scipy.special as sp

x = np.linspace(0, 15, 500)

np.savetxt('example-04.txt',list(   zip(x,sp.yn(0,x),sp.yn(1,x),sp.yn(2,x),
                                    sp.yn(3,x),sp.yn(4,x),sp.yn(5,x))),
                                    fmt="% .10e")

I have used the special function yn instead of jv.

This is the `example-04.txt' output file:
https://pastebin.com/xfCMQ4cH

(first line is `0.0000000000e+00 -inf -inf -inf -inf -inf -inf'!)

And this is the image generated using example-04.txt in LaTeX:
https://imagebin.ca/v/4KKebbscyqSr

How to limit the output y range? I am interested in particular in y values
between -2 and 1. With mathplotlib, it would be for example
`plt.ylim((-2, 1))'. But what about scipy?
Thank you anyway!

Jarvis
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.