Fixed interactive plots for PDF.

the plots generated by interactive plots (%matplotlib notebook) do
not show up in the PDF. This has meant that I haven't been able to
update the PDF since febuary. I switched the default plotting
mechanism to noninteractive.
This commit is contained in:
Roger Labbe
2016-09-20 06:49:15 -07:00
parent 97f3f64efb
commit 96749eb378
23 changed files with 2930 additions and 199503 deletions

BIN
pdf/book.synctex.gz Normal file

Binary file not shown.

View File

@@ -5,6 +5,19 @@ import sys
from formatting import *
def inplace_change(filename, old_string, new_string):
# Safely read the input filename using 'with'
with open(filename, encoding='utf-8') as f:
s = f.read()
if old_string not in s:
return
# Safely write the changed content, if found in the file
with open(filename, 'w', encoding='utf-8') as f:
s = s.replace(old_string, new_string)
f.write(s)
def merge_notebooks(outfile, filenames):
merged = None
added_appendix = False
@@ -27,27 +40,32 @@ def merge_notebooks(outfile, filenames):
if __name__ == '__main__':
f = open('book.ipynb', 'w', encoding='utf-8')
'''merge_notebooks(f,
['../02-Discrete-Bayes.ipynb'])'''
with open('book.ipynb', 'w', encoding='utf-8') as f:
merge_notebooks(f,
['../14-Adaptive-Filtering.ipynb'])
merge_notebooks(f,
['../00-Preface.ipynb',
'../01-g-h-filter.ipynb',
'../02-Discrete-Bayes.ipynb',
'../03-Gaussians.ipynb',
'../04-One-Dimensional-Kalman-Filters.ipynb',
'../05-Multivariate-Gaussians.ipynb',
'../06-Multivariate-Kalman-Filters.ipynb',
'../07-Kalman-Filter-Math.ipynb',
'../08-Designing-Kalman-Filters.ipynb',
'../09-Nonlinear-Filtering.ipynb',
'../10-Unscented-Kalman-Filter.ipynb',
'../11-Extended-Kalman-Filters.ipynb',
'../12-Particle-Filters.ipynb',
'../13-Smoothing.ipynb',
'../14-Adaptive-Filtering.ipynb',
'../Appendix-A-Installation.ipynb',
'../Appendix-B-Symbols-and-Notations.ipynb',
'../Appendix-D-HInfinity-Filters.ipynb',
'../Appendix-E-Ensemble-Kalman-Filters.ipynb'])
'''merge_notebooks(f,
['../00-Preface.ipynb',
'../01-g-h-filter.ipynb',
'../02-Discrete-Bayes.ipynb',
'../03-Gaussians.ipynb',
'../04-One-Dimensional-Kalman-Filters.ipynb',
'../05-Multivariate-Gaussians.ipynb',
'../06-Multivariate-Kalman-Filters.ipynb',
'../07-Kalman-Filter-Math.ipynb',
'../08-Designing-Kalman-Filters.ipynb',
'../09-Nonlinear-Filtering.ipynb',
'../10-Unscented-Kalman-Filter.ipynb',
'../11-Extended-Kalman-Filters.ipynb',
'../12-Particle-Filters.ipynb',
'../13-Smoothing.ipynb',
'../14-Adaptive-Filtering.ipynb',
'../Appendix-A-Installation.ipynb',
'../Appendix-B-Symbols-and-Notations.ipynb',
'../Appendix-D-HInfinity-Filters.ipynb',
'../Appendix-E-Ensemble-Kalman-Filters.ipynb'])'''
#remove text printed for matplotlib charts
inplace_change('book.ipynb', '<IPython.core.display.Javascript object>', '')
inplace_change('book.ipynb', '<IPython.core.display.HTML object>', '')