DOC: shrink bounding box on table plot
State: closed

Doc formatting issue brought up in https://github.com/pydata/pandas/pull/6661#issuecomment-39748330

@jreback any way to view the doc build before merging into master? I was looking into `pandas/ci/build_docs.sh` but it looks likes I'd need to set up another travis job and a new GH pages site.


Labels:
name: Docs
name: Visualization
description: plotting

Comments:
I think you can add `echo `cat /tmp/doc.log`` at the end of `build_docs.sh` and it will print the output of the doc build to the travis log (its a bash shell command so may not be 100% right).

The docs are always built for the 2.7 build (just not uploaded except for master). The log is not shown though.

@TomAugspurger I realize that the doc build log IS THEIR already, at the bottom of the travis output, just click right above print_skipped

@TomAugspurger did this work? to see the debug output?

I guess the ipython_directive swallows up stdout except for Exceptions. I think I have a workaround. Testing locally first.

OK, this should work. I'm just going to raise an Exception where the message is the values from the debug statements.

@TomAugspurger good idea of raising to print the debug output!

did you figure out the size issue?

Not entirely. I am able to reproduce it locally now though, so I think it may be a matplotlib 1.1.1 thing.
The strange part is that the figure looks fine when the code is just run. It's only when it gets run through the doc build that the table get's cut off. Something with the savefig decorator is changing something.

@TomAugspurger And how does it look if you save it yourself with `savefig`?

Thanks for confirmation. I also could reproduce the issue using mpl1.1.1, and trying to dig in.

Here's where I'm at. These are running:

``` python
from pandas import *
from numpy.random import rand, randn

fig, ax = plt.subplots(1, 1)
df = DataFrame(rand(5, 3), columns=['a', 'b', 'c'])
ax.get_xaxis().set_visible(False)   # Hide Ticks
df.plot(table=True, ax=ax)
```

`bad`: matplotlib: 1.1.1
`good`: matplotlib 1.4.x
1. good, interpreter:
   ![pandas-dev_interpretor](https://cloud.githubusercontent.com/assets/1312546/2670788/3f3b44a0-c0d2-11e3-84ce-44bedfe81f0e.png)
2. good, doc build:
   ![pandas-dev_build](https://cloud.githubusercontent.com/assets/1312546/2670816/a5fbd362-c0d2-11e3-8049-d17beb3263e0.png)
3. bad interpreter:
   ![doc_interpretor](https://cloud.githubusercontent.com/assets/1312546/2670821/b02c517c-c0d2-11e3-94c9-6cddc795bec6.png)
4. bad doc build:
   ![doc_build](https://cloud.githubusercontent.com/assets/1312546/2670834/ba7fbb3c-c0d2-11e3-8733-a95fda844aac.png)

So it is being plotted correctly from the interpreter, it's just something in the doc build that changes what's saved. Presumably a matplotlib RCParam, but maybe something else. The confusing thing is why it affects MPL 1.1.1 differently than MPL 1.4.

Two solutions:
1. Use MPL 1.4 (maybe 1.2 or 1.3) for the doc build
2. figure out why MPL 1.1.1 is saved differently than MPL 1.4 and make the necessary adjustment in `visualization.rst`

1.3.1 is the current yes? 

```
requirements-2.7_LOCALE.txt:matplotlib==1.3.0
requirements-2.7.txt:matplotlib==1.1.1
requirements-3.2.txt:matplotlib==1.2.1
requirements-3.3.txt:matplotlib==1.2.1
```

so If i switch 2.7.txt to 1.3.1, should I change anything else? (that's the do build), while the 2.7-locale actually does the slow tests

yeah, 1.4 is the dev, 1.3.1 is the currently released version.

I think changing `requirements2.7.txt`'s matplotlib to 1.3.1 is all that's needed.

Once we have python 3.4 running, we'll have 2 builds using 1.3.1 then.

yep (I run 1.3.1 with 3.4 on windows as well)....ok...i'll push to master in a bit
(I have to build the wheel first), its all automated so pretty easy

ok....once this is finished let's see what things look like
https://travis-ci.org/pydata/pandas/builds/22712039

pls review all graphs....as we are now building with 1.3.1 (vs 1.1.1)

ok....graphs are up...look ok to me

http://pandas-docs.github.io/pandas-docs-travis/visualization.html#visualization-table

Yep. Thanks. I'll close this one.