Skip to content

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

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

Closed
eleanor-m opened this issue Apr 27, 2020 · 1 comment · Fixed by #133
Closed

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

eleanor-m opened this issue Apr 27, 2020 · 1 comment · Fixed by #133
Assignees
Labels

Comments

@eleanor-m
Copy link

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!

@marcharper
Copy link
Owner

Thanks for the report and investigation!

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.

2 participants