Skip to content

Plot keyword arguments are unused in DataFrame plot() #4

Closed
@wesm

Description

@wesm

Reported by twhitcomb, Jul 27, 2010
What steps will reproduce the problem?

  1. Import pandas
  2. Create a sample DataFrame
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions