Plot keyword arguments are unused in DataFrame plot() · Issue #4 · pandas-dev/pandas (original) (raw)
Reported by twhitcomb, Jul 27, 2010
What steps will reproduce the problem?
- Import pandas
- Create a sample DataFrame
- Plot the DataFrame using a linewidth keyword argument.
What is the expected output? What do you see instead?
I expect to see the linewidth keyword argument passed through to the plotting routine. Instead, the plot is displayed with the default linewidth (see attached figure).
What version of the product are you using? On what operating system?
pandas.version
0.20000000000000001
Microsoft Windows Vista, Python(x,y) 2.6.5.1
Please provide any additional information below.
Looking at the plot function in frame.py it's obvious why this is happening:
def plot(self, kind='line', **kwds): # pragma: no cover
from pylab import plot
for col in sorted(self.columns):
s = self[col]
plot(s.index, s, label=col)
Note that **kwds is not used in the plot command.
If I load a new function into my workspace like
def plot_frame(frame, *_kwargs):
from pylab import plot
for col in sorted(frame.columns):
s = frame[col]
plot(s.index, s, label=col, *_kwargs)
Then the arguments are correctly passed on, and I get the proper response, as shown in the other attached figure.