move plotting stuff to own folder
70
plotting/lecture/Makefile
Normal file
@ -0,0 +1,70 @@
|
||||
BASENAME=plotting
|
||||
|
||||
PYFILES=$(wildcard *.py)
|
||||
PYPDFFILES=$(PYFILES:.py=.pdf)
|
||||
|
||||
GPTFILES=$(wildcard *.gpt)
|
||||
GPTTEXFILES=$(GPTFILES:.gpt=.tex)
|
||||
|
||||
|
||||
all: pdf slides thumbs
|
||||
|
||||
# script:
|
||||
pdf : $(BASENAME)-chapter.pdf
|
||||
$(BASENAME)-chapter.pdf : $(BASENAME)-chapter.tex $(BASENAME).tex $(GPTTEXFILES) $(PYPDFFILES)
|
||||
pdflatex -interaction=scrollmode $< | tee /dev/stderr | fgrep -q "Rerun to get cross-references right" && pdflatex -interaction=scrollmode $< || true
|
||||
|
||||
|
||||
# slides:
|
||||
slides: $(BASENAME)-slides.pdf
|
||||
$(BASENAME)-slides.pdf : $(BASENAME)-slides.tex $(GPTTEXFILES) $(PYPDFFILES)
|
||||
pdflatex -interaction=scrollmode $< | tee /dev/stderr | fgrep -q "Rerun to get cross-references right" && pdflatex -interaction=scrollmode $< || true
|
||||
|
||||
# thumbnails:
|
||||
thumbs: $(BASENAME)-handout.pdf
|
||||
$(BASENAME)-handout.pdf: $(BASENAME)-slides.tex $(GPTTEXFILES)
|
||||
sed -e 's/setboolean{presentation}{true}/setboolean{presentation}{false}/; s/usepackage{crop}/usepackage[frame]{crop}/' $< > thumbsfoils.tex
|
||||
pdflatex thumbsfoils | tee /dev/stderr | fgrep -q "Rerun to get cross-references right" && pdflatex thumbsfoils || true
|
||||
pdfnup --nup 2x4 --no-landscape --paper a4paper --trim "-1cm -1cm -1cm -1cm" --outfile $@ thumbsfoils.pdf # 1-19
|
||||
rm thumbsfoils.*
|
||||
|
||||
watchpdf :
|
||||
while true; do ! make -q pdf && make pdf; sleep 0.5; done
|
||||
|
||||
watchslides :
|
||||
while true; do ! make -q slides && make slides; sleep 0.5; done
|
||||
|
||||
# python plots:
|
||||
$(PYPDFFILES) : %.pdf: %.py
|
||||
python $<
|
||||
|
||||
# gnuplot plots:
|
||||
$(GPTTEXFILES) : %.tex: %.gpt whitestyles.gp
|
||||
gnuplot whitestyles.gp $<
|
||||
epstopdf $*.eps
|
||||
|
||||
|
||||
clean :
|
||||
rm -f *~
|
||||
rm -f $(BASENAME).aux $(BASENAME).log
|
||||
rm -f $(BASENAME)-chapter.aux $(BASENAME)-chapter.log $(BASENAME)-chapter.out
|
||||
rm -f $(BASENAME)-slides.aux $(BASENAME)-slides.log $(BASENAME)-slides.out $(BASENAME)-slides.toc $(BASENAME)-slides.nav $(BASENAME)-slides.snm $(BASENAME)-slides.vrb
|
||||
rm -f $(PYPDFFILES) $(GPTTEXFILES)
|
||||
|
||||
cleanall : clean
|
||||
rm -f $(BASENAME)-chapter.pdf $(BASENAME)-slides.pdf $(BASENAME)-handout.pdf
|
||||
|
||||
|
||||
help :
|
||||
@echo -e \
|
||||
"make pdf: make the pdf file of the script.\n"\
|
||||
"make slides: make the pdf file of the slides.\n"\
|
||||
"make thumbs: make color thumbnails of the talk.\n"\
|
||||
"make watchpdf: make the pdf file of the script\n"\
|
||||
" whenever the tex file is modified.\n"\
|
||||
"make watchpdf: make the pdf file of the slides\n"\
|
||||
" whenever the tex file is modified.\n"\
|
||||
"make clean: remove all intermediate files,\n"\
|
||||
" just leave the source files and the final .pdf files.\n"\
|
||||
"make cleanup: remove all intermediate files as well as\n"\
|
||||
" the final .pdf files.\n"\
|
61
plotting/lecture/beamercolorthemetuebingen.sty
Normal file
@ -0,0 +1,61 @@
|
||||
% Copyright 2007 by Till Tantau
|
||||
%
|
||||
% This file may be distributed and/or modified
|
||||
%
|
||||
% 1. under the LaTeX Project Public License and/or
|
||||
% 2. under the GNU Public License.
|
||||
%
|
||||
% See the file doc/licenses/LICENSE for more details.
|
||||
|
||||
\usepackage{color}
|
||||
\definecolor{karminrot}{RGB}{165,30,55}
|
||||
\definecolor{gold}{RGB}{180,160,105}
|
||||
\definecolor{anthrazit}{RGB}{50 ,65 ,75 }
|
||||
|
||||
\mode<presentation>
|
||||
|
||||
\setbeamercolor*{normal text}{fg=anthrazit,bg=white}
|
||||
\setbeamercolor*{alerted text}{fg=anthrazit}
|
||||
\setbeamercolor*{example text}{fg=anthrazit}
|
||||
\setbeamercolor*{structure}{fg=gold,bg=karminrot}
|
||||
|
||||
\providecommand*{\beamer@bftext@only}{%
|
||||
\relax
|
||||
\ifmmode
|
||||
\expandafter\beamer@bftext@warning
|
||||
\else
|
||||
\expandafter\bfseries
|
||||
\fi
|
||||
}
|
||||
\providecommand*{\beamer@bftext@warning}{%
|
||||
\ClassWarning{beamer}
|
||||
{Cannot use bold for alerted text in math mode}%
|
||||
}
|
||||
|
||||
\setbeamerfont{alerted text}{series=\beamer@bftext@only}
|
||||
|
||||
\setbeamercolor{palette primary}{fg=karminrot,bg=white}
|
||||
\setbeamercolor{palette secondary}{fg=gold,bg=white}
|
||||
\setbeamercolor{palette tertiary}{fg=anthrazit,bg=white}
|
||||
\setbeamercolor{palette quaternary}{fg=black,bg=white}
|
||||
|
||||
\setbeamercolor{sidebar}{bg=karminrot!100}
|
||||
|
||||
\setbeamercolor{palette sidebar primary}{fg=karminrot}
|
||||
\setbeamercolor{palette sidebar secondary}{fg=karminrot}
|
||||
\setbeamercolor{palette sidebar tertiary}{fg=karminrot}
|
||||
\setbeamercolor{palette sidebar quaternary}{fg=karminrot}
|
||||
|
||||
\setbeamercolor{item projected}{fg=black,bg=black!20}
|
||||
|
||||
\setbeamercolor*{block body}{}
|
||||
\setbeamercolor*{block body alerted}{}
|
||||
\setbeamercolor*{block body example}{}
|
||||
\setbeamercolor*{block title}{parent=structure}
|
||||
\setbeamercolor*{block title alerted}{parent=alerted text}
|
||||
\setbeamercolor*{block title example}{parent=example text}
|
||||
|
||||
\setbeamercolor*{titlelike}{parent=structure}
|
||||
|
||||
\mode
|
||||
<all>
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 41 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 47 KiB After Width: | Height: | Size: 47 KiB |
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 266 KiB After Width: | Height: | Size: 266 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 5.8 KiB |
17
plotting/lecture/plotting-chapter.tex
Normal file
@ -0,0 +1,17 @@
|
||||
\documentclass[12pt]{report}
|
||||
|
||||
\input{../../header}
|
||||
|
||||
\lstset{inputpath=../code}
|
||||
|
||||
\graphicspath{{images/}}
|
||||
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
\begin{document}
|
||||
|
||||
\include{psth_sta}
|
||||
|
||||
\end{document}
|
||||
|
11
plotting/lecture/plotting.tex
Normal file
@ -0,0 +1,11 @@
|
||||
\chapter{\tr{Data plotting}{Graphische Darstellung von Daten}}
|
||||
|
||||
\section{Graphische Darstellung von Daten}
|
||||
|
||||
|
||||
|
||||
\begin{figure}
|
||||
\includegraphics[width=0.9\columnwidth]{convincing}
|
||||
\caption{Die Folgen schlecht annotierter
|
||||
Plots. \url{www.xkcd.com}} \label{xkcdplotting}
|
||||
\end{figure}
|
26
programming/code/simplerandomwalk.m
Normal file
@ -0,0 +1,26 @@
|
||||
num_runs = 10;
|
||||
max_steps = 1000;
|
||||
|
||||
positions = zeros(max_steps, num_runs);
|
||||
|
||||
for run = 1:num_runs
|
||||
for step = 2:max_steps
|
||||
x = randn(1);
|
||||
if x < 0
|
||||
positions(step, run) = positions(step-1, run) + 1;
|
||||
elseif x > 0
|
||||
positions(step, run) = positions(step-1, run) - 1;
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
figure()
|
||||
hold on
|
||||
for run = 1:num_runs
|
||||
plot(1:max_steps, positions(:, run))
|
||||
end
|
||||
xlabel('Number of steps')
|
||||
ylabel('Position')
|
||||
box off
|
||||
|
||||
|
Before Width: | Height: | Size: 18 KiB |
29
programming/lectures/logicalIndexingTime.py
Normal file
@ -0,0 +1,29 @@
|
||||
import matplotlib.pyplot as plt
|
||||
import numpy as np
|
||||
from IPython import embed
|
||||
time = np.arange(0.,10., 0.001)
|
||||
x = np.random.randn(len(time))
|
||||
selection = x[(time > 5.) & (time < 6.)]
|
||||
|
||||
fig = plt.figure()
|
||||
fig.set_facecolor("white")
|
||||
fig.set_size_inches(5.5, 2.5)
|
||||
|
||||
ax = fig.add_subplot(111)
|
||||
ax.plot(time, x, label="data", lw=.5)
|
||||
ax.plot(time[(time > 5.) & (time < 6.)], selection, color='r', lw=0.5, label="selection")
|
||||
ax.spines["right"].set_visible(False)
|
||||
ax.spines["top"].set_visible(False)
|
||||
ax.yaxis.set_ticks_position('left')
|
||||
ax.xaxis.set_ticks_position('bottom')
|
||||
ax.xaxis.linewidth=1.5
|
||||
ax.yaxis.linewidth=1.5
|
||||
ax.tick_params(direction="out", width=1.25)
|
||||
ax.tick_params(direction="out", width=1.25)
|
||||
ax.set_xlabel("time [s]")
|
||||
ax.set_ylabel("intensity")
|
||||
ax.legend(fontsize=8)
|
||||
fig.tight_layout()
|
||||
fig.savefig("images/logicalIndexingTime.pdf")
|
||||
|
||||
|