-
Notifications
You must be signed in to change notification settings - Fork 67
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
Array conversion error? #177
Comments
The offending line of Matplotlib is x = x[:, np.newaxis] so it's assuming that the input is a numpy array. Seems like this is a bug (or undocumented feature) of Matplotlib? It should really do x = np.asarray(x) on its inputs to make sure. I guess you will have to do this yourself. |
I could be remembering wrong, but I feel like this used to work here, at least for single arguments. Trying it again seems to throw the same error now (on main): using PythonCall
@py import matplotlib.pyplot as plt
plt.plot(rand(10))
I guess we could just wrap everything in |
Yeah it used to work. The issue is that this function has changed. The old version (in the link) eventually does Unfortunately a Julia array looks enough like a numpy array that it passes through the current version of this function unchanged, which is a bug because the output really does need to be a numpy array. Should be an easy fix, I'll make an issue on Matplotlib. |
For now you can call |
Ah, gotcha, thanks for following up! |
Thank you for verifying the issue, I was not entirely sure it was just my setup. |
I changed something in PythonCall (wrapped Julia arrays now have a |
Support the 0.9 release (fixes JuliaPy/PythonCall.jl#177, for example)
MWE
results in
with
The text was updated successfully, but these errors were encountered: