fine for line_plot, but not for stack_plot


min@...
 

Hi all,

I see almost no one in this forum, so I am not sure whether this is for filing issues or not. But I give it a try. (If not here, should it be on GitHub?)

I am trying to plot a stacked plot and getting an error, while I find it working fine with a line plot. I expect they should work in the same setting, but they aren't. Why?

Thanks!

Jihoon

data.filter(region="World").stack_plot()
Traceback (most recent call last):
  File "<ipython-input-19-6aa8ca15d58f>", line 1, in <module>
    data.filter(region="World").stack_plot()
  File "C:\ProgramData\Anaconda3\lib\site-packages\pyam\core.py", line 1227, in stack_plot
    ax = plotting.stack_plot(df, *args, **kwargs)
  File "C:\ProgramData\Anaconda3\lib\site-packages\pyam\plotting.py", line 503, in stack_plot
    upper = positive_only_cumulative.iloc[:, 0].values
  File "C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\indexing.py", line 1418, in __getitem__
    return self._getitem_tuple(key)
  File "C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\indexing.py", line 2092, in _getitem_tuple
    self._has_valid_tuple(tup)
  File "C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\indexing.py", line 235, in _has_valid_tuple
    self._validate_key(k, i)
  File "C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\indexing.py", line 2014, in _validate_key
    self._validate_integer(key, axis)
  File "C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\indexing.py", line 2088, in _validate_integer
    raise IndexError("single positional indexer is out-of-bounds")
IndexError: single positional indexer is out-of-bounds

Join forum@pyam.groups.io to automatically receive all group messages.