Using maptplotlib
I have created 9 graphs which are combined in to a single pdf using the command savefig
. However I need to be able to show the statistical analysis below each plot with .describe()
. What would be the best way to do this?
2 Answers
Pandas has the possibility to include a table with a plot. See the table
kwarg to pandas.DataFrame.plot
. See the docs: http://pandas.pydata.org/pandas-docs/dev/visualization.html#visualization-table
-
This looks like a good option...Is there a way to unstack the table so that only the statistics for one of my columns is being displayed horizontally from
.describe()
– risailApr 2, 2015 at 14:15 -
It's a
pd.DataFrame
so you can manipulate it with the usual methods and slicer, e.g.df.describe()[["column1","column2"]]
. Apr 10, 2015 at 20:31
There are multiple possibilities:
- http://pbpython.com/pdf-reports.html
- http://gael-varoquaux.info/computers/pyreport/
- https://github.com/JanSchulz/knitpy
For the last, have a look at https://github.com/JanSchulz/knitpy/tree/master/examples, the docx, pdf and html versions were generated from the .pymd
source. The example includes both pandas.DataFrame
s and matplotlib figures.
Disclaimer: I'm the author of knitpy