Open JenniferShelton opened 6 years ago
Same problem here, did you manage to fix this?
I'm having the same issue, is there still no fix?
(edit) Okay so this definitely isn't the best fix, but I noticed in _prepare_figure, line 179-182, the gs_top was being indexed like gs_top[-1:-setsize_h, ...] but setsize_h is always greater than -1, causing that to return a null list. I think this is where the Index Error stems from. I simple changed the order (gs_top[-setsize_h:-1, ...]) so it could at least get past those lines correctly, and this lets me at least display the figure. This may ruin some functionality for additional plots, but those were unneeded for my purpose anyway. Hope this helps!
This isn't strictly a py-upset issue although it will most likely need to be resolved here.
In matplotlib > 2.2.0, the getitem method was re-written to include a new "normalize" definition. This normalize validates slices to ensure that the end key is greater than the start key, effectively blocking negative indexing.
I'm not sure this is a problem in matplotlib rather than desired behaviour but there are two ways of fixing it:
patch matplotlib.gridspec:138-154
def __getitem__(self, key):
"""Create and return a SuplotSpec instance.
"""
nrows, ncols = self.get_geometry()
def _normalize(key, size): # Includes last index.
if isinstance(key, slice):
start, stop, _ = key.indices(size)
if stop > start:
return start, stop - 1
+ return stop - 1, start
else:
if key < 0:
key += size
if 0 <= key < size:
return key, key
raise IndexError("invalid index")
I'm Still having the same issue !
Any Fix around >?
Also still having the same issue despite mproffitt's suggestion. The error's just moved to line 154.. Due to other dependencies, I have no means to downgrade matplotlib to 1.4.3 or alike.
Any ideas?
Same here...invalid index when I try to demo the code
IndexError Traceback (most recent call last)
Fork using Cole Boudreau's solution above:
(my first try at forking and changing someone else's code, so if I did something reproachable please let me know!)
Due to this issue I've switched to this version of UpSet implementation: https://github.com/jnothman/UpSetPlot and it seems to be working fine.
Thanks for the package it is very useful. I do get an index error unless I use matplotlib 1.4.3. The new version (2.2.0) fails with the following trace back
You can recreate the error running your test dataset with updated matplotlib.
Best, Jennifer