Skip to content

numpy.linspace needs an integer from tax.get_ticks_from_axis_limits() #130

Closed
@eleanor-m

Description

@eleanor-m

Hi there,

I've been using this package for a few months and it's great! However, I recently reinstalled anaconda, and I'm now encountering a problem with setting axes limits in my ternary plots.

Now, every time I call tax.get_ticks_from_axis_limits(), I get an error from linspace: "TypeError: object of type <class 'float'> cannot be safely interpreted as an integer." I was able to reproduce this error just by running the custom_axis_scaling.py script in the examples folder.

The problem seems to be that when numpy.linspace(start, stop, num) is called in tax.get_ticks_from_axis_limits(), the num parameter is a float, but linspace wants an integer. It appears that linspace used to convert floats to ints automatically but no longer does (?) - see here.

I seemed to be able to fix the problem by converting the num parameter to an integer within the tax.get_ticks_from_axis_limits() function, e.g.: int(self._boundary_scale / float(multiple) + 1)

I hope this might be helpful, or please let me know if you think I've misunderstood something!

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions