-
Notifications
You must be signed in to change notification settings - Fork 2
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
hexbin and tribin throwing an error related to a cast #15
Comments
As a work around, I am normalizing my data before calling hexbin(norm=None) or tribin(norm=None) and that allows me to plot my data successfully.
|
Hello @jonnyprouty thank you for using mpltern and reporting your issue. As your error message says, the issue is that your t = np.asarray(t, float)
l = np.asarray(l, float)
r = np.asarray(r, float) Actually when loaded using import matplotlib.pyplot as plt
import mpltern
import numpy as np
# t, l, r = np.loadtxt("foobar.csv", delimiter=",", unpack=True, dtype=">u2")
t, l, r = np.loadtxt("foobar.csv", delimiter=",", unpack=True)
roi_fig = plt.figure()
roi_ax = roi_fig.add_subplot(projection="ternary", ternary_sum=100.0)
# roi_ax.scatter(t, l, r)
roi_ax.hexbin(t, l, r) I however agree that, for better consistency within mpltern and with Matplotlib, the error message should be suppressed. I will fix this in the next bug-fix release. BTW each row in your |
Just now mpltern 1.0.4 with the fix of the casting is published in PyPI. With this, I would like to close this issue. Thank you @jonnyprouty once again for your report and using |
Hello @yuzie007 , thanks for the quick response and update.
In this case it's ok, as the 3 datatypes are a subset of a larger dataset which sums to 100. Thanks for checking though!
No problem at all! Thanks again. |
Hello, I am receiving the following error when attempting to use either hexbin() or tribin() via the following.
t,l,r is loaded from the attached csv: foobar.csv
But if I instead try to do either a hexbin() or a tribin()
I receive the following error
I did a bit of hunting to see if I could bypass the error, and found this:
https://stackoverflow.com/questions/38673531/numpy-cannot-cast-ufunc-multiply-output-from-dtype
It looks like it will solve the issue, sadly I don't have the time at the moment to actually implement the fix. Hopefully this helps! Thanks for releasing mpltern, it's very useful!
The text was updated successfully, but these errors were encountered: