pydata-cookbook icon indicating copy to clipboard operation
pydata-cookbook copied to clipboard

Initial draft of james_bednar chapter

Open jbednar opened this issue 6 years ago • 1 comments

Initial draft of the PyViz/HoloViews chapter for the cookbook. Ready for review.

The notebook version of this chapter can be viewed at anaconda.org.

jbednar avatar Apr 27 '18 22:04 jbednar

For my own future reference, the .rst file was generated by running the included notebook in the pyviz environment, then saving it as .rst twice, with different display formats:

hv.extension('matplotlib', 'bokeh', width=100, display_formats=['svg','html'])
hv.extension('matplotlib', 'bokeh', width=100, display_formats=['png'])

The .svg versions of the Matplotlib figures used in the paper came from the first run (separately converted to PDF), and the PNG versions of the Bokeh figures came from the second one. I also took screenshots for cells that require HTML for proper display, such as those with associated widgets (from holomaps and parambokeh) or those with pandas tables. (Presumably there is some way to get a .rst-compatible table formatting of a pandas dataframe display, but I didn't see one.)

Because the paper alternates rapidly between text, code, and graphical output, I did not designate the plots as figures with captions, but if that's deemed necessary I can do so. Seems to me like that would detract from the flow, in this case, where inline images seem more appropriate (and more notebook-like).

I had to substantially reorganize the code to fit into the two-column format, making it not always as clean and easy to read, so it might be worth considering whether the book should be in a one-column format.

Note that the code and output cells are designated as different markup categories in the .rst, but when compiled to PDF via latex in this workflow, they end up being rendered similarly, which is confusing. Maybe the code listings could have a light-grey background or a box around them or something else to distinguish them visibly from textual output?

jbednar avatar Apr 28 '18 15:04 jbednar