Skip to content

Commit a9110dd

Browse files
committed
DOC: some docstring work on plot methods
1 parent 3a5c711 commit a9110dd

File tree

1 file changed

+48
-13
lines changed

1 file changed

+48
-13
lines changed

pandas/tools/plotting.py

Lines changed: 48 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,6 @@ def __init__(self, data, kind=None, by=None, subplots=False, sharex=True,
101101

102102
self.kwds = kwds
103103

104-
# if self.xticks is None:
105-
# self.xticks = self._get_xticks()
106-
107104
def _iter_data(self):
108105
from pandas.core.frame import DataFrame
109106
from pandas.core.series import Series
@@ -411,8 +408,8 @@ def plot_frame(frame=None, subplots=False, sharex=True, sharey=False,
411408
kind='line',
412409
sort_columns=True, fontsize=None, **kwds):
413410
"""
414-
Make line plot of DataFrame's series with the index on the x-axis using
415-
matplotlib / pylab.
411+
Make line or bar plot of DataFrame's series with the index on the x-axis
412+
using matplotlib / pylab.
416413
417414
Parameters
418415
----------
@@ -424,16 +421,37 @@ def plot_frame(frame=None, subplots=False, sharex=True, sharey=False,
424421
In case subplots=True, share y axis
425422
use_index : boolean, default True
426423
Use index as ticks for x axis
427-
kind : {'line', 'bar'}
424+
stacked : boolean, default False
425+
If True, create stacked bar plot. Only valid for DataFrame input
428426
sort_columns: boolean, default True
429427
Sort column names to determine plot ordering
428+
title : string
429+
Title to use for the plot
430+
grid : boolean, default True
431+
Axis grid lines
432+
legend : boolean, default True
433+
Place legend on axis subplots
434+
435+
ax : matplotlib axis object, default None
436+
kind : {'line', 'bar', 'barh'}
437+
bar : vertical bar plot
438+
barh : horizontal bar plot
439+
logy : boolean, default False
440+
For line plots, use log scaling on y axis
441+
xticks : sequence
442+
Values to use for the xticks
443+
yticks : sequence
444+
Values to use for the yticks
445+
xlim : 2-tuple/list
446+
ylim : 2-tuple/list
447+
rot : int, default None
448+
Rotation for ticks
430449
kwds : keywords
431-
Options to pass to Axis.plot
450+
Options to pass to matplotlib plotting method
432451
433-
Notes
434-
-----
435-
This method doesn't make much sense for cross-sections,
436-
and will error.
452+
Returns
453+
-------
454+
ax_or_axes : matplotlib.AxesSubplot or list of them
437455
"""
438456
if kind == 'line':
439457
klass = LinePlot
@@ -472,13 +490,28 @@ def plot_series(series, label=None, kind='line', use_index=True, rot=None,
472490
If not passed, uses gca()
473491
style : string, default matplotlib default
474492
matplotlib line style to use
493+
494+
ax : matplotlib axis object
495+
If not passed, uses gca()
496+
kind : {'line', 'bar', 'barh'}
497+
bar : vertical bar plot
498+
barh : horizontal bar plot
499+
logy : boolean, default False
500+
For line plots, use log scaling on y axis
501+
xticks : sequence
502+
Values to use for the xticks
503+
yticks : sequence
504+
Values to use for the yticks
505+
xlim : 2-tuple/list
506+
ylim : 2-tuple/list
507+
rot : int, default None
508+
Rotation for ticks
475509
kwds : keywords
476-
To be passed to the actual plotting function
510+
Options to pass to matplotlib plotting method
477511
478512
Notes
479513
-----
480514
See matplotlib documentation online for more on this subject
481-
Intended to be used in ipython --pylab mode
482515
"""
483516
if kind == 'line':
484517
klass = LinePlot
@@ -560,12 +593,14 @@ def plot_group(grouped, ax):
560593
fig.subplots_adjust(bottom=0.15, top=0.9, left=0.1, right=0.9, wspace=0.2)
561594
return ax
562595

596+
563597
def _stringify(x):
564598
if isinstance(x, tuple):
565599
return '|'.join(str(y) for y in x)
566600
else:
567601
return str(x)
568602

603+
569604
def format_date_labels(ax):
570605
# mini version of autofmt_xdate
571606
try:

0 commit comments

Comments
 (0)