Permalink
Browse files

Add ability to generate plots from scripts

  • Loading branch information...
stefanv committed Jul 30, 2015
1 parent 987f31b commit 55a30155a4c9583f7a4532fc81a0c7e3d264ac1f
Showing with 16 additions and 0 deletions.
  1. +5 −0 .gitignore
  2. +2 −0 .matplotlib/matplotlibrc
  3. +9 −0 Makefile
@@ -1,2 +1,7 @@
build_html/*
build_ipynb/*
figures/generated/*
.matplotlib/*.cache
*~
\#*
.ipynb_checkpoints
@@ -0,0 +1,2 @@
backend : Template

@@ -9,6 +9,7 @@ VPATH = markdown
# intermediate IPython notebooks.
BUILD_HTML = build_html
BUILD_NB = build_ipynb
FIGURES = figures/generated

# TITLES: This should be an exhaustive list of all the chapters to be
# built, and correspond to markdown filenames in the markdown
@@ -21,6 +22,11 @@ TITLES := preface ch1 ch2 ch3 ch4 ch5 ch6 ch7 ch8 epilogue
CHS_ := $(addprefix $(BUILD_HTML)/,$(TITLES))
chs: build_dirs $(addsuffix .html,$(CHS_))

ch3: $(FIGURES)/radar_time_signals.png

$(FIGURES)/%.png: script/%.py $(FIGURES)
MPLCONFIGDIR=./.matplotlib python $< $@

# %.html: How to build an HTML file from its corresponding IPython
# notebook.
$(BUILD_HTML)/%.html: $(BUILD_NB)/%.ipynb
@@ -46,6 +52,8 @@ $(BUILD_HTML):
mkdir -p $(BUILD_HTML)
$(BUILD_NB):
mkdir -p $(BUILD_NB)
$(FIGURES):
mkdir -p $(FIGURES)

# all: build the book.
all: chs
@@ -56,3 +64,4 @@ clean:

clobber: clean
rm -rf $(BUILD_HTML)
rm -rf $(FIGURES)

0 comments on commit 55a3015

Please sign in to comment.