pyradi
pyradi copied to clipboard
ryplot.Plotter.polar Type error
I found an issue when trying to use rtplot.Plotter.polar.
`~\pyradi\ryplot.py in polar(self, plotnum, theta, r, ptitle, plotCol, label, labelLocation, highlightNegative, highlightCol, highlightWidth, legendAlpha, linestyle, rscale, rgrid, thetagrid, direction, zerooffset, titlefsize, drawGrid, zorders, clip_on, markers, markevery) 2893 if rgrid[0] is not 0: 2894 numrgrid = (rscale[1] - rscale[0] ) / rgrid[0] -> 2895 ax.set_yticks(np.linspace(rscale[0],rscale[1],numrgrid++1.000001)) 2896 2897 ax.set_ylim(rscale[0],rscale[1])
<array_function internals> in linspace(*args, **kwargs)
~\anaconda3\lib\site-packages\numpy\core\function_base.py in linspace(start, stop, num, endpoint, retstep, dtype, axis) 119 raise TypeError( 120 "object of type {} cannot be safely interpreted as an integer." --> 121 .format(type(num))) 122 123 if num < 0:
TypeError: object of type <class 'float'> cannot be safely interpreted as an integer.`
The issue comes from this part of the code:
ax.set_yticks(np.linspace(rscale[0],rscale[1],numrgrid++1.000001))
The 3rd argument into np.linspace()
is a float. Per the documentation of Numpy 1.18 documentation. The number of samples generated can not be a float.
I am not sure if just changing it to 1 is a correct solution either.