Skip to content

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

@doutriaux1

Description

@doutriaux1

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'

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions