O'Reilly logo

Beginning Python Visualization by Shai Vaingast

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

APPENDIX

image

Additional Source Listing

This appendix is a collection of source listings that didn’t quite belong in the chapters themselves, but nevertheless might be of interest to you.

Nudge Subplots

In generating subplots of size 2 by 2 for this book, I noticed that the text for the x-axis of the top subplots clashes with the titles of the lower subplots. To overcome this, I defined nudge_subplot(), a function designed to modify the location of subplots within a figure (see Listing A-1).

Listing A-1. Source Listing of nudge_subplot()

def nudge_subplot(sp, dy):    """A helper function to move subplots."""    sp_ax = sp.get_position()    sp.set_position([sp_ax.x0, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required