-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
better input validation on fill_between
#7510
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
Comments
What should I think the change we should make here is to clarify that the inputs should be 1D and raise a better exception.
|
The problem originally came out when reading data from a file. The vectors were one dimenional but second dimension was fixed to 1 rather than empty. I think that case should be handled even when |
fill_between
with non empty second dimension
fill_between
with non empty second dimension
If If we start to take |
Ok. I see your point. I am ok with using |
fill_between
The exact work here:
|
Can i try this , if it is still open ? |
@gauthamzz Please do! I do not think anyone is currently working on this. |
Can you tell me the names of the associated files ? |
Both of those methods are in |
I am trying to run control chart module got below error . can you provide solution for this below error ? F:\Python Scripts\ppmBOTv07\bot\api\ppmutils.py in control_chart(MS_SP_X, directory, cc_data, target_mean, sigma, sub_group_size) F:\Python Scripts\ppmBOTv07\bot\spc\spc.py in save(self, filename, **kwargs) F:\Python Scripts\ppmBOTv07\bot\spc\spc.py in make(self, **kwargs) F:\Python Scripts\ppmBOTv07\bot\spc\results.py in init(self, ax, values, target, center, lcl, ucl, ltl, utl, title) F:\Python Scripts\ppmBOTv07\bot\spc\results.py in plot_chart(self, ax, values, target, center, lcl, ucl, ltl, utl, title, newvalues) F:\Anaconda\lib\site-packages\matplotlib_init_.py in inner(ax, data, *args, **kwargs) F:\Anaconda\lib\site-packages\matplotlib\axes_axes.py in fill_between(self, x, y1, y2, where, interpolate, step, **kwargs) ValueError: Input passed into argument "'y1'"is not 1-dimensional. |
What the error message says: y1 must be a 1-dimensional array. You've passed in something else. |
F:\Anaconda\lib\site-packages\matplotlib\axes_axes.py in fill_between(self, x, y1, y2, where, interpolate, step, **kwargs) |
this was working 2 weeks back. After I installed OS due to some reason, installed Anaconda python v3.7 this error I got |
Please check the shape of y1 in your code and make it 1D. I'm sorry this is popping up for you. However, this change just enforces what was implicitly assumed and explicitly documented on the data already. The former tolerance towards multi-dimensional arrays may or may not have worked properly depending on the actual data. And we don't want to risk wrong plots due to sloppy data verification. |
Hi,
So I am running on Python 3.5.2 and Matplotlib 1.5.3 and everything is installed via OS packet manager on Arch Linux. Here's the code I am having issue with:
I've already checked that this is due to
where=None
setting which constructrswhere
variable vialen
function. This seems inadequate in manynumpy
scenarios as occasionally arrays will pop up with or without second dimension. If they do have a second dimension though thewhere=None
will force the error below.Please advise.
The text was updated successfully, but these errors were encountered: