pydata/pandas — pull request #6661 by sinhrks (2014-03-18 14:42:00+00:00)
Title: Plotting DataFrame/Series with matplotlib.table

Related to #4803, I prepared some codes to add a `matplotlib.Table` to `DataFrame` and `Series` plot using `table` keyword. `table` can take followings as an input:
- ``False``: Do nothing (default).
- ``True``: Draw a table using the data called ``plot`` method. Data will be transposed to meet the matplotlib's default layout.
- ``DataFrame`` or ``Series``: Draw matplotlib.table using the passed data. The data will be drawn as displayed in print method (not transposed automatically).

Also, helper function ``pandas.tools.plotting.table`` is added to create a table from ``DataFrame`` and ``Series``, and add it to the ``matplotlib.Axes``.

*Example:*
```
fig, axes = plt.subplots(1, 3, figsize=(14, 4))
plt.subplots_adjust(top=0.97, bottom=0.2, left=0.05, right=0.97, hspace=0.2)

df.plot(ax=axes[0], table=True, legend=False)
axes[0].get_xaxis().set_visible(False)

df.plot(ax=axes[1], table=np.round(df.T, 2), legend=False)
axes[1].get_xaxis().set_visible(False)

df.plot(ax=axes[2], legend=False)

import pandas.tools.plotting as plotting
plotting.table(axes[2], np.round(df.describe(), 2),
loc='upper right', colWidths=[0.2, 0.2, 0.2])

plt.show()
```

*Outputs:*
![figure_table](https://f.cloud.github.com/assets/1696302/2448693/7d4028e6-aea9-11e3-9a2e-f36087638dac.png)