Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

polar plots crashes if a value is less than thre minmum magnitude #8

Closed
doutriaux1 opened this issue Oct 4, 2017 · 0 comments · Fixed by #10
Closed

polar plots crashes if a value is less than thre minmum magnitude #8

doutriaux1 opened this issue Oct 4, 2017 · 0 comments · Fixed by #10
Assignees
Labels
Milestone

Comments

@doutriaux1
Copy link
Contributor

if a magnitude is less than the minimum magnitude the plot crashes with a cryptic error

import vcs
import vcsaddons
import numpy

p = vcsaddons.createpolar()

p.list()

mag = [1,2,3,4,5]
angle = numpy.arange(5)/180.*numpy.pi

import vcs
x=vcs.init(bg=True)
p.x=x
p.magnitude_ticks = [7.,15.,25]
p.plot(mag,angle)

dies with:

Traceback (most recent call last):
  File "bad_polar.py", line 16, in <module>
    p.plot(mag,angle)
  File "/home/doutriaux1/anaconda2/envs/dev-nox/lib/python2.7/site-packages/vcsaddons/polar.py", line 510, in plot
    r = self.magnitude_from_value(m, m_scale) * radius
  File "/home/doutriaux1/anaconda2/envs/dev-nox/lib/python2.7/site-packages/vcsaddons/polar.py", line 246, in magnitude_from_value
    pct_between_levs = (value - below) / float(v - below)
TypeError: unsupported operand type(s) for -: 'int' and 'NoneType'
@doutriaux1 doutriaux1 added the bug label Oct 4, 2017
@doutriaux1 doutriaux1 added this to the 3.0 milestone Oct 4, 2017
@doutriaux1 doutriaux1 self-assigned this Oct 4, 2017
doutriaux1 added a commit that referenced this issue Oct 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant